Skip to content

Does react-three-rapier support on-demand rendering? #305

Answered by wiledal
jlarmstrongiv asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @jlarmstrongiv,

Out of the box, the "demand" frameloop strategy will cause some unexpected behavior, mainly due to the physics stepping function using the delta between frames to calculate physics steps, which will cause physics bodies to move at a faster speed than you might want.

So to achieve a complete manual step, you'd need to pause the physics world and utilize the step function provided in useRapier().

Here's a small example, using invalidate and step()
https://codesandbox.io/s/manual-stepping-demand-frameloop-m429m4

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@jlarmstrongiv
Comment options

@wiledal
Comment options

@wiledal
Comment options

@jlarmstrongiv
Comment options

@jlarmstrongiv
Comment options

Answer selected by jlarmstrongiv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants