ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::Joint Class Referenceabstract

This abstract class represents a joint between two bodies. More...

#include <include/reactphysics3d/constraint/Joint.h>

Inheritance diagram for reactphysics3d::Joint:
reactphysics3d::BallAndSocketJoint reactphysics3d::FixedJoint reactphysics3d::HingeJoint reactphysics3d::SliderJoint

Public Member Functions

 Joint (Entity entity, PhysicsWorld &world)
 Constructor.
 
virtual ~Joint ()=default
 Destructor.
 
 Joint (const Joint &constraint)=delete
 Deleted copy-constructor.
 
Jointoperator= (const Joint &constraint)=delete
 Deleted assignment operator.
 
RigidBodygetBody1 () const
 Return the reference to the body 1.
 
RigidBodygetBody2 () const
 Return the reference to the body 2.
 
JointType getType () const
 Return the type of the constraint.
 
virtual Vector3 getReactionForce (decimal timeStep) const =0
 Return the force (in Newtons) on body 2 required to satisfy the joint constraint.
 
virtual Vector3 getReactionTorque (decimal timeStep) const =0
 Return the torque (in Newtons * meters) on body 2 required to satisfy the joint 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.
 
virtual std::string to_string () const =0
 Return a string representation.
 

Detailed Description

This abstract class represents a joint between two bodies.

Member Function Documentation

◆ getBody1()

RigidBody * Joint::getBody1 ( ) const

Return the reference to the body 1.

Returns
The first body involved in the joint

◆ getBody2()

RigidBody * Joint::getBody2 ( ) const

Return the reference to the body 2.

Returns
The second body involved in the joint

◆ getEntity()

RP3D_FORCE_INLINE Entity reactphysics3d::Joint::getEntity ( ) const

Return the entity id of the joint.

Returns
The entity of the joint

◆ getReactionForce()

virtual Vector3 reactphysics3d::Joint::getReactionForce ( decimal  timeStep) const
pure virtual

Return the force (in Newtons) on body 2 required to satisfy the joint constraint.

Implemented in reactphysics3d::BallAndSocketJoint, reactphysics3d::FixedJoint, reactphysics3d::HingeJoint, and reactphysics3d::SliderJoint.

◆ getReactionTorque()

virtual Vector3 reactphysics3d::Joint::getReactionTorque ( decimal  timeStep) const
pure virtual

Return the torque (in Newtons * meters) on body 2 required to satisfy the joint constraint.

Implemented in reactphysics3d::BallAndSocketJoint, reactphysics3d::FixedJoint, reactphysics3d::HingeJoint, and reactphysics3d::SliderJoint.

◆ getType()

JointType Joint::getType ( ) const

Return the type of the constraint.

Returns
The type of the joint

◆ isCollisionEnabled()

bool Joint::isCollisionEnabled ( ) const

Return true if the collision between the two bodies of the joint is enabled.

Returns
True if the collision is enabled between the two bodies of the joint is enabled and false otherwise

◆ to_string()

virtual std::string reactphysics3d::Joint::to_string ( ) const
pure virtual

The documentation for this class was generated from the following files: