ReactPhysics3D  v0.10.1
C++ Physics engine library
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. More...
 
RigidBodygetBody2 () const
 Return the reference to the body 2. More...
 
JointType getType () const
 Return the type of the constraint. More...
 
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. More...
 
Entity getEntity () const
 Return the entity id of the joint. More...
 
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

◆ 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

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