ReactPhysics3D: reactphysics3d::SliderJoint Class Reference

| ReactPhysics3D v0.10.2 C++ Physics engine library

Loading...
Searching...
No Matches
Public Member Functions | List of all members
reactphysics3d::SliderJoint Class Reference

This class represents a slider joint. More...

`#include <include/reactphysics3d/constraint/SliderJoint.h>`

Inheritance diagram for reactphysics3d::SliderJoint:

## Public Member Functions
| SliderJoint (Entity entity, PhysicsWorld &world, const SliderJointInfo &jointInfo)
| Constructor.
virtual | ~SliderJoint () override=default
| Destructor.
| SliderJoint (const SliderJoint &constraint)=delete
| Deleted copy-constructor.
SliderJoint & | operator= (const SliderJoint &constraint)=delete
| Deleted assignment operator.
bool | isLimitEnabled () const
| Return true if the limits or the joint are enabled.
bool | isMotorEnabled () const
| Return true if the motor of the joint is enabled.
void | enableLimit (bool isLimitEnabled)
| Enable/Disable the limits of the joint.
void | enableMotor (bool isMotorEnabled)
| Enable/Disable the motor of the joint.
decimal | getTranslation () const
| Return the current translation value of the joint.
decimal | getMinTranslationLimit () const
| Return the minimum translation limit.
void | setMinTranslationLimit (decimal lowerLimit)
| Set the minimum translation limit.
decimal | getMaxTranslationLimit () const
| Return the maximum translation limit.
void | setMaxTranslationLimit (decimal upperLimit)
| Set the maximum translation limit.
decimal | getMotorSpeed () const
| Return the motor speed.
void | setMotorSpeed (decimal motorSpeed)
| Set the motor speed.
decimal | getMaxMotorForce () const
| Return the maximum motor force.
void | setMaxMotorForce (decimal maxMotorForce)
| Set the maximum motor force.
decimal | getMotorForce (decimal timeStep) const
| Return the intensity of the current force applied for the joint motor.
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.
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.
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 class represents a slider joint.

This joint has a one degree of freedom. It only allows relative translation of the bodies along a single direction and no rotation.

## Member Function Documentation

## ◆ enableLimit()

void SliderJoint::enableLimit | ( | bool | isLimitEnabled | ) |

Enable/Disable the limits of the joint.

Parameters

  isLimitEnabled | True if you want to enable the joint limits and false otherwise

## ◆ enableMotor()

void SliderJoint::enableMotor | ( | bool | isMotorEnabled | ) |

Enable/Disable the motor of the joint.

Parameters

  isMotorEnabled | True if you want to enable the joint motor and false otherwise

## ◆ getMaxMotorForce()

decimal SliderJoint::getMaxMotorForce | ( |  | ) | const

Return the maximum motor force.

Returns
  The maximum force of the joint motor (in Newton x meters)

## ◆ getMaxTranslationLimit()

decimal SliderJoint::getMaxTranslationLimit | ( |  | ) | const

Return the maximum translation limit.

Returns
  The maximum translation limit of the joint (in meters)

## ◆ getMinTranslationLimit()

decimal SliderJoint::getMinTranslationLimit | ( |  | ) | const

Return the minimum translation limit.

Returns
  The minimum translation limit of the joint (in meters)

## ◆ getMotorForce()

decimal SliderJoint::getMotorForce | ( | decimal | timeStep | ) | const

Return the intensity of the current force applied for the joint motor.

Parameters

  timeStep | Time step (in seconds)

Returns
  The current force of the joint motor (in Newton x meters)

## ◆ getMotorSpeed()

decimal SliderJoint::getMotorSpeed | ( |  | ) | const

Return the motor speed.

Returns
  The current motor speed of the joint (in meters per second)

## ◆ getReactionForce()

Vector3 SliderJoint::getReactionForce | ( | decimal | timeStep | ) | const
| overridevirtual

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

Returns
  The current force (in Newtons) applied on body 2

Implements reactphysics3d::Joint.

## ◆ getReactionTorque()

Vector3 SliderJoint::getReactionTorque | ( | decimal | timeStep | ) | const
| overridevirtual

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

Returns
  The current torque (in Newtons * meters) applied on body 2

Implements reactphysics3d::Joint.

## ◆ getTranslation()

decimal SliderJoint::getTranslation | ( |  | ) | const

Return the current translation value of the joint.

Returns
  The current translation distance of the joint (in meters)

## ◆ isLimitEnabled()

bool SliderJoint::isLimitEnabled | ( |  | ) | const

Return true if the limits or the joint are enabled.

Returns
  True if the joint limits are enabled

## ◆ isMotorEnabled()

bool SliderJoint::isMotorEnabled | ( |  | ) | const

Return true if the motor of the joint is enabled.

Returns
  True if the joint motor is enabled

## ◆ setMaxMotorForce()

void SliderJoint::setMaxMotorForce | ( | decimal | maxMotorForce | ) |

Set the maximum motor force.

Parameters

  maxMotorForce | The maximum force of the joint motor (in Newton x meters)

## ◆ setMaxTranslationLimit()

void SliderJoint::setMaxTranslationLimit | ( | decimal | upperLimit | ) |

Set the maximum translation limit.

Parameters

  upperLimit | The maximum translation limit of the joint (in meters)

## ◆ setMinTranslationLimit()

void SliderJoint::setMinTranslationLimit | ( | decimal | lowerLimit | ) |

Set the minimum translation limit.

Parameters

  lowerLimit | The minimum translation limit of the joint (in meters)

## ◆ setMotorSpeed()

void SliderJoint::setMotorSpeed | ( | decimal | motorSpeed | ) |

Set the motor speed.

Parameters

  motorSpeed | The speed of the joint motor (in meters per second)

## ◆ to_string()

std::string SliderJoint::to_string | ( |  | ) | const
| overridevirtual

Return a string representation.

Implements reactphysics3d::Joint.

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

- include/reactphysics3d/constraint/SliderJoint.h
- src/constraint/SliderJoint.cpp