63 init(parentFrame, childFrame);
70 PX_FORCE_INLINE void initMaxJointVelocity(
const PxReal maxJointV) { maxJointVelocity = maxJointV; }
71 PX_FORCE_INLINE void initFrictionCoefficient(
const PxReal coefficient) { frictionCoefficient = coefficient; }
75 PX_ASSERT(parentFrame.
isValid());
76 PX_ASSERT(childFrame.
isValid());
78 parentPose = parentFrame;
79 childPose = childFrame;
82 jointDirtyFlag = ArticulationJointCoreDirtyFlag::eMOTION;
84 initFrictionCoefficient(0.05f);
85 initMaxJointVelocity(100.0f);
86 initJointType(PxArticulationJointType::eUNDEFINED);
88 for(PxU32 i=0; i<PxArticulationAxis::eCOUNT; i++)
105 PX_CUDA_CALLABLE
bool setJointFrame(
PxQuat& relativeQuat)
107 if (jointDirtyFlag & ArticulationJointCoreDirtyFlag::eFRAME)
109 relativeQuat = (childPose.q * (parentPose.q.getConjugate())).getNormalized();
112 PxU8 flag = PxU8(ArticulationJointCoreDirtyFlag::eFRAME);
123 parentPose = other.parentPose;
124 childPose = other.childPose;
127 for(PxU32 i=0; i<PxArticulationAxis::eCOUNT; i++)
129 limits[i] = other.limits[i];
130 drives[i] = other.drives[i];
131 targetP[i] = other.targetP[i];
132 targetV[i] = other.targetV[i];
133 armature[i] = other.armature[i];
135 jointPos[i] = other.jointPos[i];
136 jointVel[i] = other.jointVel[i];
138 dofIds[i] = other.dofIds[i];
139 invDofIds[i] = other.invDofIds[i];
140 motion[i] = other.motion[i];
143 frictionCoefficient = other.frictionCoefficient;
144 maxJointVelocity = other.maxJointVelocity;
145 jointOffset = other.jointOffset;
146 jointDirtyFlag = other.jointDirtyFlag;
147 jointType = other.jointType;
154 PX_FORCE_INLINE void setParentPose(
const PxTransform& t) { parentPose = t; jointDirtyFlag |= ArticulationJointCoreDirtyFlag::eFRAME; }
155 PX_FORCE_INLINE void setChildPose(
const PxTransform& t) { childPose = t; jointDirtyFlag |= ArticulationJointCoreDirtyFlag::eFRAME; }
168 PxReal targetP[PxArticulationAxis::eCOUNT];
169 PxReal targetV[PxArticulationAxis::eCOUNT];
170 PxReal armature[PxArticulationAxis::eCOUNT];
172 PxReal jointPos[PxArticulationAxis::eCOUNT];
173 PxReal jointVel[PxArticulationAxis::eCOUNT];
175 PxReal frictionCoefficient;
176 PxReal maxJointVelocity;
181 PxU8 dofIds[PxArticulationAxis::eCOUNT];
182 PxU8 motion[PxArticulationAxis::eCOUNT];
183 PxU8 invDofIds[PxArticulationAxis::eCOUNT];
187 }PX_ALIGN_SUFFIX(16);