17-05-2026, 09:21 AM
(This post was last modified: 17-05-2026, 09:21 AM by josemendez.)
Hi,
If I understood your code correctly, you're calculating velocity from the solver's world space positions in the previous/current frame (totalVelocity), then calculating its velocity in local space (velocityFromLocal) and subtracting them to get velocity due to the parent's movement (velocityFromParent).
Unless I'm missing something, this means that in addition to moving due to the parent-child relationship between the solver and an object driven by an ECS rigidbody, the solver is also moving in that object's local space and you need to scale inertial forces due to that as well? Not sure anymore what you are trying to do, but if it works for you it works!
The solver's linear velocity is transform.position - prevTransform.position. To be consistent we have to calculate angular velocity using backward finite differences as well, and that means using an r vector that's also expressed in the previous frame's space.
If I understood your code correctly, you're calculating velocity from the solver's world space positions in the previous/current frame (totalVelocity), then calculating its velocity in local space (velocityFromLocal) and subtracting them to get velocity due to the parent's movement (velocityFromParent).
Unless I'm missing something, this means that in addition to moving due to the parent-child relationship between the solver and an object driven by an ECS rigidbody, the solver is also moving in that object's local space and you need to scale inertial forces due to that as well? Not sure anymore what you are trying to do, but if it works for you it works!
(16-05-2026, 07:46 PM)Jawsarn Wrote: One thing maybe you can explain to me is why you are using prevFrame.translation for VelocityAtPoint and not the current one (I changed it to that)?
The solver's linear velocity is transform.position - prevTransform.position. To be consistent we have to calculate angular velocity using backward finite differences as well, and that means using an r vector that's also expressed in the previous frame's space.

