MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / getAngle

Method getAngle

src/constraint/HingeJoint.cpp:259–270  ·  view source on GitHub ↗

Return the current hinge angle * @return The current hinge angle (in radians) in the range [-pi; pi] */

Source from the content-addressed store, hash-verified

257 * @return The current hinge angle (in radians) in the range [-pi; pi]
258 */
259decimal 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/**

Callers

nothing calls this directly

Calls 3

getBody1EntityMethod · 0.80
getBody2EntityMethod · 0.80

Tested by

no test coverage detected