I’m using Physx 3.2.3 and experiencing issues with capsules not coming to a complete stop in angular velocity. The damping is affecting it but it weakens at ~2 occasions in time.
When I plot the angular velocity, the curve goes down but at ~2 moments the curve gets a bend towards flatlining which it eventually does. Spheres don’t have this issue.
I suspect it is numerical error having to do with the half-height value of the capsule being 0.0001. I see that the angular velocity deviates from the Y axis near frame 792, and the slope of the Y-value of the angular velocity changes a bit there.
Sorry for the confusion, I attached it to the first message when you asked for it since I didn’t find the button when typing a new message.
Okay, the example was a bad one. I have recorded a new one with a height on the capsule. I don’t have the source code but can you see any reason for the less dampening behaviour?
I didn’t plot the speed, I can’t get that easily from PVD yet because the graphing feature doesn’t allow for plotting vector components. By eye I can’t detect the problem you describe, although I admit that the angular velocity loss does seem to be minimal towards the end. However, it’s not supposed to decrease linearly, the damping torque is always proportional to the angular velocity. From the User Guide document:
Damping
The rates at which rigid bodies dissipate angular and linear momentum are governed by damping rates. In the PhysX SDK two damping rates may be specified for a rigid body:
void PxRigidDynamic::setLinearDamping(PxReal linDamp);
void PxRigidDynamic::setAngularDamping(PxReal angDamp);
With a linear damping value of linDamp a rigid body will experience a damping force each update equal to -linDampvelocity. Similarly, a rigid body with damping rate angDamp will experience a damping torque -angDampangularVelocity. The damping forces and torques always act against the velocity and angular velocity and are applied in a way that ensures that a moving and rotating rigid body will asymptotically approach the rest state in the absence of other forces.
Yes, that’s what I thought as well. It doesn’t matter how much angular damping I specify, it will just rotate at a faster constant speed in the end. It’s too expensive to use capsules because of this which is too bad because capsules are quite essential.
It didn’t matter if it were static.
The sphere got the same issue as the capsule however if the ground is a trianglemesh instead of a box.
The first recording has angular damping of 1 and the second has 10. The second got a weird 90 degree turn at the ground’s intersection. Nonstop-trianglemesh.zip (2.69 MB)
The weird right turn is a problem with contact generation between the sphere and the trimesh. This could be because the triangle mesh is actually not smooth, or it could just be lousy contact generation. I know we fixed some contact gen bugs after 3.2.3, so if I were you I would upgrade to latest instead of running older releases. External Media