You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey 👋 I recently came across this example in rust for one way platforms in rapier and tried to recreate the effect.
I'm currently able to let the ball pass through the platform by adding a PhysicsHook
Screen.Recording.2024-01-22.at.00.58.46.mov
However, I'm only able to disable the collision check. I'm not able to access the RigidBody's linvel, or translation and it results in an recursive use of an object detected which would lead to unsafe aliasing error. I'd like to check if the ball is above the platform to enable the collision check again.
How does this currently work?
In order to get this to work we need to be able to pass an additional hooks param to world.step(eventQueue, hooks) of type PhysicsHooks.
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?
Hey 👋 I recently came across this example in rust for one way platforms in rapier and tried to recreate the effect.
I'm currently able to let the ball pass through the platform by adding a PhysicsHook
Screen.Recording.2024-01-22.at.00.58.46.mov
However, I'm only able to disable the collision check. I'm not able to access the RigidBody's
linvel
, ortranslation
and it results in anrecursive use of an object detected which would lead to unsafe aliasing
error. I'd like to check if the ball is above the platform to enable the collision check again.How does this currently work?
In order to get this to work we need to be able to pass an additional
hooks
param toworld.step(eventQueue, hooks)
of typePhysicsHooks
.In order for us to get access to this in components, I added
filterContactPairHooks
andfilterIntersectionPairHooks
touseRapier
.This allows us to register a
hook
in ourOneWayPlatform.jsx
demo that we can push tofilterContactPairHooks
. We also need to make sure we setsetActiveHooks
to one for either our ball or platform.This works, but when I try to get access to body's
linvel
ortranslation
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?Code: #603
Run locally
yarn
cd demo
yarn dev
The text was updated successfully, but these errors were encountered: