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] Latest Release

Published by github-actions[bot] 4 months ago

Minor Changes

  • a155277: feat: bump @dimforge/rapier3d-compat from 0.12.0 to 0.13.1

    • Added World prop lengthUnit
    • Renamed World props allowedLinearError and predictionDistance to normalizedAllowedLinearError and normalizedPredictionDistance, matching upstream changes
    • Added softCcdPrediction RigidBody prop
    • Added contactSkin collider prop

Patch Changes

  • 1dc78d0: feat: add activeCollisionTypes prop to RigidBody and Collider components
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] 6 months ago

Patch Changes

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

Published by github-actions[bot] 6 months ago

Patch Changes

  • bad7da7: fix: move away from use-asset
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

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

Published by github-actions[bot] 8 months ago

Minor Changes

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

Published by github-actions[bot] 8 months ago

Minor Changes

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

Published by github-actions[bot] 8 months ago

Patch Changes

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

Published by github-actions[bot] 10 months ago

Patch Changes

  • a5a08a0: Update docs for setWorld to include example
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] 11 months ago

Patch Changes

  • a71ede9: Update changeset settings
react-three-rapier - @react-three/[email protected]

Published by github-actions[bot] 11 months ago

Minor Changes

  • a71ede9: Adds basic snapshot capabilities by adding setWorld
react-three-rapier - @react-three/[email protected]

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

Patch Changes

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

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

Patch Changes

  • c9e897a: Throw useful error when usePhysics used outside <Physics /> (@CodyJasonBennett)
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

Patch Changes

  • c50783a: Fix types for PrismaticJointParams (@wiledal)
react-three-rapier - @react-three/[email protected]

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

Minor Changes

  • 95a232b: Update deps

Patch Changes

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

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

Minor Changes

  • 95a232b: Update deps
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

Patch Changes

  • 787462d: Fix world settings not updating when being set (@wiledal)
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 [6c764cc]
  • Updated dependencies [3057f3c]
  • Updated dependencies [c4d2446]
  • Updated dependencies [af27f83]
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 get a proxied 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.raw().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 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
    }
    

Minor Changes

  • 93c7e8c: Add missing RoundCylinderCollider and RoundConeCollider (@wiledal)
  • c4d2446: Deprecate Vector3Array for Vector3Tuple (@wiledal)
  • af27f83: Add integrationProperties as mutable props on Physics (@wiledal)

Patch Changes

  • 3057f3c: Fix initiation to only happen in mount effects, never render, for increased stability (@wiledal)
  • c4d2446: Internal refactor regarding instances (@wiledal)