Hi everybody,
I want to use phyx to simulate the ragdoll effect.
I have a character skeleton, and I made each bone of this character as a “sphere dynamic actor”, then use “D6 joint” to link them together, first I tried the eLocked flag, made each degree( translation or rotation ) locked, the constraint solver is perfectly, then I changed the rotation( swing & twist ) flag to eLimited, and set up the twist and swing limits, now the artifacts appeared, the bone actor appeared has no constraint,they are jitter and flying around, I have no idea why this happened, because I have tested the D6 joint in the SDK “samplebridge” demo, and they are stable in the demo.
Then I read the document, and found this:
void PxRigidDynamic::setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters);
this API can set the solver iteration count for each bone actor, and in the samplebridge demo, it is used:
setSolverIterationCounts(8,8).
“8,8” is OK for this demo scene, but is not in my application scene, I then tried some other values, eg. 32, 64, 128, 255, the greater the value, the more stable the joints, yes it is very stable when I set the count to “255,255”, I think I should use this value, cos it is so perfect for my simulation, but the document saied that “If you find a need to use a setting higher than 30, you may wish to reconsider the configuration of your simulation”. I guess the greater the value, the less effecient the simulation. YES, it is the case, when the amount of joints is large enough, the FPS of my application drops rapidlly, so I can’t use this value.
Now the question is :
-
Why “8,8” is suitable for the “samplebridge” demo, but not for my application. In samplebridge demo,I use D6 joints to connect the planks, and the phyx scene settings of the demo and my application is the same, also the tolerance scale, the gravity, etc.
-
255 is not effective for application, but it can make solver stable. “you may wish to reconsider the configuration of your simulation”, but configure what? I don’t know, the doc has no hints about it.
-
If there is no regular way to make it stable, should I use some other methods ? for example, seperate the single skeleton joint chain to multiple joint chains, and each chain contains a few actors and joints. because the fewer the joints, the more stable the solver.
Thanks!