rotations not normalized in solver, causing colliders to expand and eventually explode #235
Labels
A-Dynamics
Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on
C-Bug
Something isn't working
Adding
*body1.rotation.0 = *body1.rotation.0.normalize();
after rotational updates inposition_constraints.rs
fixes this. (Doesn't seem to be necessarily in angular_constraints.rs, but I think that's because it happens that the constraints are applied with positional_constraints running after in all existing joints which use both — so that should also be done just in case.)I think rather than sticking the normalization after every rotation, it could be done by refactoring
get_delta_rot()
— this would mean less code duplication, but probably also it getting called a few more times than necessary. Maybe it's actually better to put it up into the solver step somewhere, so it only gets called once.If joints end up getting unified into one 6dof universal joint, that might change this entirely. So, I'm going to submit a PR for quick-and-easy fix now, but am also filing this so we can later look at putting the normalization at the most optimal level.
The text was updated successfully, but these errors were encountered: