Return the current hinge angle * @return The current hinge angle (in radians) in the range [-pi; pi] */
| 257 | * @return The current hinge angle (in radians) in the range [-pi; pi] |
| 258 | */ |
| 259 | decimal HingeJoint::getAngle() const { |
| 260 | |
| 261 | // Get the bodies entities |
| 262 | const Entity body1Entity = mWorld.mJointsComponents.getBody1Entity(mEntity); |
| 263 | const Entity body2Entity = mWorld.mJointsComponents.getBody2Entity(mEntity); |
| 264 | |
| 265 | const Quaternion& orientationBody1 = mWorld.mTransformComponents.getTransform(body1Entity).getOrientation(); |
| 266 | const Quaternion& orientationBody2 = mWorld.mTransformComponents.getTransform(body2Entity).getOrientation(); |
| 267 | |
| 268 | // Compute the current angle around the hinge axis |
| 269 | return mWorld.mConstraintSolverSystem.mSolveHingeJointSystem.computeCurrentHingeAngle(mEntity, orientationBody1, orientationBody2); |
| 270 | } |
| 271 | |
| 272 | // Return the force (in Newtons) on body 2 required to satisfy the joint constraint in world-space |
| 273 | /** |
nothing calls this directly
no test coverage detected