6#include "physxnode/qphysxactorbody_p.h"
10#include <extensions/PxRevoluteJoint.h>
15
16
17
18
19
20
21
22
23
24
25
26
27
30
31
32
33
34
35
38
39
40
41
42
43
46
47
48
49
50
51
53float QRevoluteJoint::angularLimitLower()
const
55 return m_angularLimitLower;
58void QRevoluteJoint::setAngularLimitLower(
float newAngularLimitLower)
60 if (qFuzzyCompare(m_angularLimitLower, newAngularLimitLower))
62 m_angularLimitLower = newAngularLimitLower;
63 m_dirtyProperties =
true;
64 emit angularLimitLowerChanged();
67float QRevoluteJoint::angularLimitUpper()
const
69 return m_angularLimitUpper;
72void QRevoluteJoint::setAngularLimitUpper(
float newAngularLimitUpper)
74 if (qFuzzyCompare(m_angularLimitUpper, newAngularLimitUpper))
76 m_angularLimitUpper = newAngularLimitUpper;
77 m_dirtyProperties =
true;
78 emit angularLimitUpperChanged();
81bool QRevoluteJoint::enableAngularLimit()
const
83 return m_enableAngularLimit;
86void QRevoluteJoint::setEnableAngularLimit(
bool newEnableAngularLimit)
88 if (m_enableAngularLimit == newEnableAngularLimit)
90 m_enableAngularLimit = newEnableAngularLimit;
91 m_dirtyProperties =
true;
92 emit enableAngularLimitChanged();
95physx::PxJoint *QRevoluteJoint::createPhysxJoint(physx::PxRigidActor *actorA,
96 physx::PxRigidActor *actorB,
97 const physx::PxTransform &trfA,
98 const physx::PxTransform &trfB)
100 return physx::PxRevoluteJointCreate(*StaticPhysXObjects::getReference().physics, actorA, trfA,
104void QRevoluteJoint::setJointProperties()
106 physx::PxRevoluteJoint *joint =
static_cast<physx::PxRevoluteJoint *>(m_joint);
107 joint->setLimit(physx::PxJointAngularLimitPair(m_angularLimitLower, m_angularLimitUpper));
108 joint->setRevoluteJointFlag(physx::PxRevoluteJointFlag::eLIMIT_ENABLED, m_enableAngularLimit);
#define QT_BEGIN_NAMESPACE