react-three-rapier

🤺 Rapier physics in React

MIT License

Downloads
57.1K
Stars
836
Committers
24

Bot releases are visible (Hide)

react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • 6c764cc: Remove WorldApi, replace with singleton instance proxy (@wiledal)

    BREAKING CHANGE: The WorldApi has been removed. Instead, you can now import the singleton instance of the world from @react-three/rapier. This is a breaking change, but it should be easy to migrate to.

    Before:

    import { useRapier } from "@react-three/rapier";
    
    const Component = () => {
      const { world } = useRapier();
    
      useEffect(() => {
        // Access to the WorldApi (limited)
        world.bodies.forEach(() => {
          // Do something
        });
    
        // Access the raw Rapier World instance
        const rawWorldInstance = world.raw();
        rawWorldInstance.raw().setGravity(new Vector3(0, -9.81, 0));
      }, []);
    };
    

    Now:

    import { useRapier } from "@react-three/rapier";
    
    const Component = () => {
      const { world } = useRapier();
    
      useEffect(() => {
        // Access the Rapier World instance directly
        world.bodies.forEach(() => {
          // Do something
        });
        world.setGravity(new Vector3(0, -9.81, 0));
      }, []);
    };
    

    Note: it is best to avoid accessing properties and methods on the world outside of useEffect, or useLayoutEffect in order for the world to be properly synchronized with the React component lifecycle.

    // bad
    const Component = () => {
      const {world} = useRapier()
    
      world.setGravity(...)
    
      return null
    }
    
    // good
    const Component = () => {
      const {world} = useRapier()
    
      useEffect(() => {
        world.setGravity(...)
      }, [])
    
      return null
    }
    
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • Updated dependencies [93c7e8c]
  • Updated dependencies [c4d2446]
  • Updated dependencies [c4d2446]
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 3057f3c: Fix initiation to only happen in mount effects, never render, for increased stability (@wiledal)
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 93c7e8c: Add missing RoundCylinderCollider and RoundConeCollider (@wiledal)
  • c4d2446: Deprecate Vector3Array for Vector3Tuple (@wiledal)

Patch Changes

  • c4d2446: Internal refactor regarding instances
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 35ee03b: Loosen peer deps in attempt to solve npm install conflicts
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 35ee03b: Loosen peer deps in attempt to solve npm install conflicts
  • Updated dependencies [35ee03b]
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons

Patch Changes

  • 97d82c5: Fix broken imports from source instead of package
  • Updated dependencies [3d8f152]
  • Updated dependencies [3d8f152]
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

⚠️ This update contains a few breaking changes. See migration guide: https://github.com/pmndrs/react-three-rapier/wiki/0.14.x-to-0.15.x-Migration-Guide

Minor Changes

  • 3d8f152: Removes the <Debug /> component, in favor of setting debug={true} on the <Physics /> component instead
  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 97d82c5: Fix broken imports from source instead of package
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 3d8f152: Removes the <Debug /> component, in favor of setting debug={true} on the <Physics /> component instead
  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Major Changes

  • 3d8f152: Move <Attractor /> to @react-three/rapier-addons

Patch Changes

  • Updated dependencies [3d8f152]
  • Updated dependencies [3d8f152]
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • eabf8b1: Add on-demand rendering for usage with the r3f 'demand' frameloop strategy (@wiledal)
  • 4f88218: Add dominance group to RigidBody (@vynetic)
  • 6ddace8: Update @dimforge/rapier3d-compat to 0.11.2 (@wiledal)
  • 92423f1: Allow users to control if the update loop runs independently or on useFrame (@wiledal)

Patch Changes

  • 668659f: Fix missing React import (@wiledal)
  • 6547d0e: Fix tsdoc typo (@balraj-johal)
  • 1f41278: Fix collision events firing multiple times on RigidBodies (@wiledal)
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 6ddace8: Update @dimforge/rapier3d-compat to 0.11.2
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 668659f: Fix missing React import
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • 92423f1: Allow users to control if the update loop runs independently or on useFrame
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 1f41278: Fix collision events firing multiple times on RigidBodies
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • eabf8b1: Add on-demand rendering for usage with the r3f 'demand' frameloop strategy.
  • 4f88218: Add dominance group to RigidBody (@vynetic)

Patch Changes

  • 6547d0e: Fix tsdoc typo (@balraj-johal)
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • d27d688: Fix eager initiation of Rapier objects when called before ref-objects are available
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 0104039: feat: change callbacks for useBeforePhysicsStep and useAfterPhysicsStep to be mutable (@isaac-mason)