Bot releases are visible (Hide)
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
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
}
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
<Attractor />
to @react-three/rapier-addonsPublished 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
<Debug />
component, in favor of setting debug={true}
on the <Physics />
component instead<Attractor />
to @react-three/rapier-addonsPublished by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
<Debug />
component, in favor of setting debug={true}
on the <Physics />
component instead<Attractor />
to @react-three/rapier-addonsPublished by github-actions[bot] over 1 year ago
<Attractor />
to @react-three/rapier-addonsPublished by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
useBeforePhysicsStep
and useAfterPhysicsStep
to be mutable (@isaac-mason)