60physx::PxJoint *QPrismaticJoint::createPhysxJoint(physx::PxRigidActor *actorA,
61 physx::PxRigidActor *actorB,
62 const physx::PxTransform &trfA,
63 const physx::PxTransform &trfB)
65 return physx::PxPrismaticJointCreate(*StaticPhysXObjects::getReference().physics, actorA, trfA,
69void QPrismaticJoint::setJointProperties()
71 physx::PxPrismaticJoint *joint =
static_cast<physx::PxPrismaticJoint *>(m_joint);
72 const physx::PxTolerancesScale scale =
73 StaticPhysXObjects::getReference().physics->getTolerancesScale();
74 const float lowerLimit = qMin(m_lowerLimit, m_upperLimit);
75 const float upperLimit = qMax(m_lowerLimit, m_upperLimit);
77 physx::PxJointLinearLimitPair limit(scale, lowerLimit, upperLimit);
78 limit.stiffness = m_stiffness;
79 limit.damping = m_damping;
81 joint->setLimit(limit);
82 joint->setPrismaticJointFlag(physx::PxPrismaticJointFlag::eLIMIT_ENABLED,
true);