Use rapier with an animated glb ? #556
-
Hi, Reading the getting started, and colliders I understand that I should update the character animation position at each tick myself (calculate final vertices position and resubmit a buffer of positions) and submit the updated Trimesh buffer to the proper collider in the collider set. And keep going up to the end of the anim. Is that it ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
From the collider's documentation: "It is discouraged to use a triangle meshes or a polylines for colliders attached to dynamic rigid-bodies." I'd also assume recreating a trimesh buffer every frame would be incredibly expensive over time. Have you tried creating your own ragdoll using joints? If your character has arms that need to interact with other rigid bodies, then you can use cuboids or capsules colliders for parts of the arm (upper + forearm). If your model is using bones, you can copy the position + rotation of each bone for all colliders. |
Beta Was this translation helpful? Give feedback.
That is correct, the documentation will tell you how to update the collider position/rotation after it is created:
https://rapier.rs/docs/user_guides/javascript/colliders