Added acceleration-mode velocity drive to SixDOFConstraint motors#1977
Added acceleration-mode velocity drive to SixDOFConstraint motors#1977khiner wants to merge 1 commit intojrouwe:masterfrom
Conversation
A velocity motor whose MotorSettings::mSpringSettings has damping > 0 and no stiffness/frequency now produces a soft, mass-normalized velocity drive (a = -damping * v_err) via an implicit-Euler soft constraint. Previously the damping was ignored and the motor acted as a hard velocity constraint. Motors with damping == 0, and position motors, are unchanged. Added unit test TestSixDOFMotorVelocityAcceleration covering both translation and rotation motor paths, both spring modes, and two body sizes to verify mass/inertia independence.
…opy Transforms / Child Of). Auto-wire skin joints to physics-driven ancestors. - Per-bone constraint stack with inspector UI. Evaluated in the pose-sync loop against a new BonePoseWorld scratch buffer. - On glTF import, bones whose joint node has a physics-driven ancestor get a Child Of constraint with InverseMatrix baked to the rest offset, so skins follow rigid bodies. - Acceleration-mode drives with stiffness > 0 now convert to frequency/damping-ratio - EmptyShape fallback for motion-only bodies without colliders - skip BoneAttachment on physics-driven joint-node objects - Fork JoltPhysics with jrouwe/JoltPhysics#1977
|
Thanks! It will take me some time to validate this change. In the mean time: What is your use case for this and can't you use the built in friction of the constraints (e.g. |
|
Thanks for taking a look! My use case is the KHR_physics_rigid_bodies Robot_skinned glTF sample. It defines three angular drives in
So that case reduces to
robot_with_1977_fix.mp4
robot_sub_mMaxFriction_1977_fix.mp4Since it's a passive friction cap, the leg and cog drives apply no force toward their However, I went back and realized for this scene, on master, letting Jolt's velocity motor handle these drives robot_no_patch.mp4Still, silently dropping the damping prevents implementing KHR_physics_rigid_bodies exactly. Instantaneous lock to Anyway, not as blocked as I thought on this one, so feel free to do what you'd like with this PR, thanks for looking :) |
A velocity motor whose MotorSettings::mSpringSettings has damping > 0 and no stiffness/frequency now produces a soft, mass-normalized velocity drive (a = -damping * v_err) via an implicit-Euler soft constraint. Previously the damping was ignored and the motor acted as a hard velocity constraint. Motors with damping == 0, and position motors, are unchanged.
Added unit test TestSixDOFMotorVelocityAcceleration covering both translation and rotation motor paths, both spring modes, and two body sizes to verify mass/inertia independence.
Disclosure: I developed this with the help of Claude Code.