Open driescroons opened 7 months ago
Latest commit: 45087bf925760f4e335a4af7f8c3f55e9ad2f61b
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Description
PR for https://github.com/pmndrs/react-three-rapier/issues/597
We can get one-way-platforms to work by passing an additional hooks param to world.step(eventQueue, hooks) of type PhysicsHooks.
In order for us to get access to this in components, I added filterContactPairHooks and filterIntersectionPairHooks to useRapier.
This allows us to register a hook in our OneWayPlatform.jsx demo that we can push to filterContactPairHooks. We also need to make sure we set setActiveHooks to one for either our ball or platform.
This works, but when I try to get access to body's linvel or translation in the hook, from either the ref, or the params I get the above error. How am I able to access the body in that hook?
Run locally
yarn
cd demo
yarn dev
Type of change
Checklist: