ReactPhysics3D
v0.10.1
C++ Physics engine library
|
This class represents a hinge joint that allows arbitrary rotation between two bodies around a single axis. More...
#include <include/reactphysics3d/constraint/HingeJoint.h>
Public Member Functions | |
HingeJoint (Entity entity, PhysicsWorld &world, const HingeJointInfo &jointInfo) | |
Constructor. | |
virtual | ~HingeJoint () override=default |
Destructor. | |
HingeJoint (const HingeJoint &constraint)=delete | |
Deleted copy-constructor. | |
HingeJoint & | operator= (const HingeJoint &constraint)=delete |
Deleted assignment operator. | |
bool | isLimitEnabled () const |
Return true if the limits or the joint are enabled. More... | |
bool | isMotorEnabled () const |
Return true if the motor of the joint is enabled. More... | |
void | enableLimit (bool isLimitEnabled) |
Enable/Disable the limits of the joint. More... | |
void | enableMotor (bool isMotorEnabled) |
Enable/Disable the motor of the joint. More... | |
decimal | getMinAngleLimit () const |
Return the minimum angle limit. More... | |
void | setMinAngleLimit (decimal lowerLimit) |
Set the minimum angle limit. More... | |
decimal | getMaxAngleLimit () const |
Return the maximum angle limit. More... | |
void | setMaxAngleLimit (decimal upperLimit) |
Set the maximum angle limit. More... | |
decimal | getMotorSpeed () const |
Return the motor speed. More... | |
void | setMotorSpeed (decimal motorSpeed) |
Set the motor speed. More... | |
decimal | getMaxMotorTorque () const |
Return the maximum motor torque. More... | |
void | setMaxMotorTorque (decimal maxMotorTorque) |
Set the maximum motor torque. More... | |
decimal | getMotorTorque (decimal timeStep) const |
Return the intensity of the current torque applied for the joint motor. More... | |
decimal | getAngle () const |
Return the current hinge angle (in radians) More... | |
virtual Vector3 | getReactionForce (decimal timeStep) const override |
Return the force (in Newtons) on body 2 required to satisfy the joint constraint in world-space. More... | |
virtual Vector3 | getReactionTorque (decimal timeStep) const override |
Return the torque (in Newtons * meters) on body 2 required to satisfy the joint constraint in world-space. More... | |
virtual std::string | to_string () const override |
Return a string representation. | |
Public Member Functions inherited from reactphysics3d::Joint | |
Joint (Entity entity, PhysicsWorld &world) | |
Constructor. | |
virtual | ~Joint ()=default |
Destructor. | |
Joint (const Joint &constraint)=delete | |
Deleted copy-constructor. | |
Joint & | operator= (const Joint &constraint)=delete |
Deleted assignment operator. | |
RigidBody * | getBody1 () const |
Return the reference to the body 1. More... | |
RigidBody * | getBody2 () const |
Return the reference to the body 2. More... | |
JointType | getType () const |
Return the type of the constraint. More... | |
bool | isCollisionEnabled () const |
Return true if the collision between the two bodies of the joint is enabled. More... | |
Entity | getEntity () const |
Return the entity id of the joint. More... | |
This class represents a hinge joint that allows arbitrary rotation between two bodies around a single axis.
This joint has one degree of freedom. It can be useful to simulate doors or pendulumns.
void HingeJoint::enableLimit | ( | bool | isLimitEnabled | ) |
Enable/Disable the limits of the joint.
isLimitEnabled | True if you want to enable the limits of the joint and false otherwise |
void HingeJoint::enableMotor | ( | bool | isMotorEnabled | ) |
Enable/Disable the motor of the joint.
isMotorEnabled | True if you want to enable the motor of the joint and false otherwise |
decimal HingeJoint::getAngle | ( | ) | const |
Return the current hinge angle (in radians)
decimal HingeJoint::getMaxAngleLimit | ( | ) | const |
Return the maximum angle limit.
decimal HingeJoint::getMaxMotorTorque | ( | ) | const |
Return the maximum motor torque.
decimal HingeJoint::getMinAngleLimit | ( | ) | const |
Return the minimum angle limit.
decimal HingeJoint::getMotorSpeed | ( | ) | const |
Return the motor speed.
decimal HingeJoint::getMotorTorque | ( | decimal | timeStep | ) | const |
Return the intensity of the current torque applied for the joint motor.
timeStep | The current time step (in seconds) |
|
overridevirtual |
Return the force (in Newtons) on body 2 required to satisfy the joint constraint in world-space.
Implements reactphysics3d::Joint.
|
overridevirtual |
Return the torque (in Newtons * meters) on body 2 required to satisfy the joint constraint in world-space.
Implements reactphysics3d::Joint.
bool HingeJoint::isLimitEnabled | ( | ) | const |
Return true if the limits or the joint are enabled.
bool HingeJoint::isMotorEnabled | ( | ) | const |
Return true if the motor of the joint is enabled.
void HingeJoint::setMaxAngleLimit | ( | decimal | upperLimit | ) |
Set the maximum angle limit.
upperLimit | The maximum limit angle of the joint (in radian) |
void HingeJoint::setMaxMotorTorque | ( | decimal | maxMotorTorque | ) |
Set the maximum motor torque.
maxMotorTorque | The maximum torque (in Newtons) of the joint motor |
void HingeJoint::setMinAngleLimit | ( | decimal | lowerLimit | ) |
Set the minimum angle limit.
lowerLimit | The minimum limit angle of the joint (in radian) |
void HingeJoint::setMotorSpeed | ( | decimal | motorSpeed | ) |
Set the motor speed.
motorSpeed | The speed of the motor |