Question about using impulse with object direction #981
Answered
by
jrouwe
khoamaitan
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
jrouwe
Mar 15, 2024
Replies: 1 comment 2 replies
-
This is caused by small inaccuracies in the friction calculation that build up over time if you apply impulses in local space. If you set the friction on the floor to zero you will see that it stops happening. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The box has 4 contact points (marked 1 .. 4) and the friction axis are aligned with the world space axis in this case (red/green arrows, which is why it is less apparent if the box is aligned with the world space axis). The contact points are solved in order so that means when solving 1 the box starts rotating a little bit because the force is off center (but 3 should counter that rotation because it operates in the opposite direction), same for 2 and 4. Because the frictions are applied sequentially instead of all at once, they're not 100% countering each other so that causes drift. I'll check if there's a better solution for it.