ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class represents a ball-and-socket joint that allows arbitrary rotation between two bodies. More...
#include <include/reactphysics3d/constraint/BallAndSocketJoint.h>
Public Member Functions | |
BallAndSocketJoint (Entity entity, PhysicsWorld &world, const BallAndSocketJointInfo &jointInfo) | |
Constructor. | |
virtual | ~BallAndSocketJoint () override=default |
Destructor. | |
BallAndSocketJoint (const BallAndSocketJoint &constraint)=delete | |
Deleted copy-constructor. | |
void | enableConeLimit (bool isLimitEnabled) |
Enable/disable the cone limit of the joint. | |
bool | isConeLimitEnabled () const |
Return true if the cone limit or the joint is enabled. | |
void | setConeLimitHalfAngle (decimal coneHalfAngle) |
Set the cone limit half angle. | |
decimal | getConeLimitHalfAngle () const |
Return the cone limit half angle (in radians) | |
decimal | getConeHalfAngle () const |
Return the current cone half angle (in radians) | |
virtual Vector3 | getReactionForce (decimal timeStep) const override |
Return the force (in Newtons) on body 2 required to satisfy the joint constraint in world-space. | |
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. | |
virtual std::string | to_string () const override |
Return a string representation. | |
BallAndSocketJoint & | operator= (const BallAndSocketJoint &constraint)=delete |
Deleted assignment operator. | |
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. | |
RigidBody * | getBody2 () const |
Return the reference to the body 2. | |
JointType | getType () const |
Return the type of the constraint. | |
bool | isCollisionEnabled () const |
Return true if the collision between the two bodies of the joint is enabled. | |
Entity | getEntity () const |
Return the entity id of the joint. | |
This class represents a ball-and-socket joint that allows arbitrary rotation between two bodies.
This joint has three degrees of freedom. It can be used to create a chain of bodies for instance.
void BallAndSocketJoint::enableConeLimit | ( | bool | isLimitEnabled | ) |
Enable/disable the cone limit of the joint.
It is possible to enable a cone-limit for the BallAndSocketJoint in order to restrict the angular motion between the two bodies.
Use this method to enable/disable the cone-limit.
isLimitEnabled | True if the limit must be enabled and false otherwise |
decimal BallAndSocketJoint::getConeHalfAngle | ( | ) | const |
Return the current cone half angle (in radians)
decimal BallAndSocketJoint::getConeLimitHalfAngle | ( | ) | const |
Return the cone limit half angle (in radians)
|
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 BallAndSocketJoint::isConeLimitEnabled | ( | ) | const |
Return true if the cone limit or the joint is enabled.
void BallAndSocketJoint::setConeLimitHalfAngle | ( | decimal | coneHalfAngle | ) |
Set the cone limit half angle.
coneHalfAngle | The angle of the cone limit (in radian) from [0; PI] |
|
overridevirtual |
Return a string representation.
Implements reactphysics3d::Joint.