Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Categories
- All Discussions1,524
- General534
- Graphics109
- GPU Computing419
- Mobile141
- Pro Graphics163
- Tools158
In this Discussion
- Hai Loc Lu February 13
- whalebiologist February 13
Tags in this Discussion
- physx 272
PhysX - Joint drives not waking up sleeping bodies
-
I am trying to model machinery in PhysX using rigid bodies and joints. I use joint drives to 'power' the joints in order to get the machine's parts to move.
I had an issue where no matter when velocities/orientations I fed into the joint drives, the bodies would not move at all. After some time I figured that the machine stabilises and so gets put to sleep. It seems as though the joint drives will not wake a sleeping body, so I have to manually wake the body up before I set the drive velocity.
Is this correct behaviour? Is it correct to be modelling the machine via powered joints to move the individual parts? -
2 Comments sorted by
-
Can you post your code here?
Are you able to drive after you have to manually wake the body up? Or it doesn't even move?
Did you forget to eFREE those movements?
joint->setMotion(PxD6Axis::eX, PxD6Motion::eFREE);
joint->setDrive(PxD6Drive::eX, PxD6JointDrive(100, 20, PX_MAX_F32, PxD6JointDriveFlag::eACCELERATION));
joint->setDrivePosition(PxTransform(PxVec3(5,0,0))); -
For one joint, I tried using a revolute joint and a D6 joint with only the SWING1 axis set to eFREE. It happens with both joints. At the moment I am using a revolute joint, and the params I am setting up are;
joint->setConstraintFlag(PxConstraintFlag::eVISUALIZATION, true);
joint->setConstraintFlag(PxConstraintFlag::eCOLLISION_ENABLED, false);
joint->setRevoluteJointFlag(PxRevoluteJointFlag::eDRIVE_ENABLED, true);
joint->setDriveForceLimit(10000000);
If I manually wake the body up I can set the drive velocity and the bodies move as expected. For now I am manually waking the bodies up each frame, because if the machine stabilises again everything gets put back to sleep.