Replies: 1 comment
-
If you had a rope hanging from the ceiling and Y is defined as the up-axis, then "twist" is the rotation around the Y axis, while "swing" is the rotation around the X and Z axes. You can sort of imagine the limits as a cone that resembles how far the objects can swing relative to each other; with a "steep" cone, the allowed rotation angle is small, while a very "wide" limit cone allows a lot more rotation. I believe swing is currently applied symmetrically for the X and Z axes, but we could probably allow them to be separate, which would resemble an elliptical limit cone. I'll have to check the math on this when I get to it (probably for the generic joint we discussed). On a somewhat related note, for joint motors, there are several ways that a joint can be driven to a specific rotation in 3D. We'll probably want to have two different drive models like PhysX: a twist and swing drive that interpolates each axis separately, and a SLERP drive (Spherical linear interpolation) that uses quaternions directly and follows the shortest arc for the interpolation. You can find more info on PhysX's drives (and other joint things) here. |
Beta Was this translation helpful? Give feedback.
-
I'm looking at https://docs.rs/bevy_xpbd_3d/latest/bevy_xpbd_3d/constraints/joints/struct.SphericalJoint.html, and have what is probably another silly question.
I see that there is a
swing_limit
and atwist_limit
. But, a spherical joint has three degrees of freedom. Presuming that Y is "twist", does "swing" apply to the other two axes identically? Consider a shoulder joint: three degrees of freedom, each with their own constraints:Each of these has its own angular limits... how would I configure these?
Beta Was this translation helpful? Give feedback.
All reactions