Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize rotation after applying constraint delta
Adding *body1.rotation.0 = *body1.rotation.0.normalize(); after rotational updates in position_constraints.rs fixes Jondolf#235. (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.
- Loading branch information