-
Bodies do not seem to gain kinetic energy when they are moved by point constraint. Using Jolt point constraint to drag bodies:
Using Bullet point constraint to drag bodies:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
A point constraint has no spring element in it, all it does it to try to keep the points together. If all you do is to set the world attachment point every frame, then the velocity of that point will be zero (because you've attached it to the fixed world). Constraints are solved in the velocity domain (by SolveVelocityConstraint) and by setting a new position you haven't violated the relative velocity between the bodies. The position of the body is incorrect though, but this will be fixed up by SolvePositionConstraint which will just fix up the positions and not actually introduce any velocity on the body. This works differently in Bullet, where the position error is solved together with the velocity error, which effectively gives you the spring you're looking for (but it has the disadvantage that it adds energy to the system and can cause oscillations). Long story short, you can fix it in 2 ways:
|
Beta Was this translation helpful? Give feedback.
A point constraint has no spring element in it, all it does it to try to keep the points together. If all you do is to set the world attachment point every frame, then the velocity of that point will be zero (because you've attached it to the fixed world). Constraints are solved in the velocity domain (by SolveVelocityConstraint) and by setting a new position you haven't violated the relative velocity between the bodies. The position of the body is incorrect though, but this will be fixed up by SolvePositionConstraint which will just fix up the positions and not actually introduce any velocity on the body. This works differently in Bullet, where the position error is solved together with …