I created 6DJoint and would drive it along its X Axis. But if I change the velocity vector nothin happens.
This is the code for the joint initialization:
const physx::PxReal DENSITY_STEEL = 7850.0;
physx::PxRigidDynamic* actor1 = physics->createRigidDynamic(physx::PxTransform(0.0,3.0,0.0,physx::PxQuat(physx::PxIdentity)));
physx::PxVec3 com1(0.295, 0.0, 0.0);
physx::PxRigidBodyExt::setMassAndUpdateInertia(*(actor1), 0.00328f * DENSITY_STEEL, &(com1));
physx::PxRigidDynamic* actor2 = physics->createRigidDynamic(physx::PxTransform(0.0,3.0,0.0,physx::PxQuat(physx::PxIdentity)));
physx::PxVec3 com2(0.424, 0.0, 0.0);
physx::PxRigidBodyExt::setMassAndUpdateInertia(*(actor2), 0.00187f * DENSITY_STEEL, &(com2));
physx::PxD6Joint* joint = physx::PxD6JointCreate(
*physics,
actor1,
physx::PxTransform(0.0, 0.0, 0.0, physx::PxQuat(physx::PxIdentity)),
actor2,
physx::PxTransform(0.0, 0.0, 0.0, physx::PxQuat(physx::PxIdentity));
joint->setMotion(physx::PxD6Axis::eX, physx::PxD6Motion::eFREE);
physx::PxD6JointDrive drive(1000000.0f, 2000000.0f, PX_MAX_F32, true);
joint->setDrive(physx::PxD6Drive::eX, drive2);
joint->setDrivePosition(physx::PxTransform(0.0,0.0,0.0,physx::PxQuat(physx::PxIdentity)));
joint->setDriveVelocity(physx::PxVec3(0.0,0.0,0.0), physx::PxVec3(0.0));
later in my code I set the drive Velocity in the PreTick function with:
joint->setDriveVelocity(physx::PxVec3(velocity,0.0,0.0),physx::PxVec3(0.0));
But the drive do not move at all. In PVD I can see that the right target velocity is set to the drive.
What did I wrong?
Thanks a lot for your answers.