Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | List of all members
box2d::PrismaticJoint Class Reference

Prismatic Joint. More...

#include <PrismaticJoint.hpp>

Inheritance diagram for box2d::PrismaticJoint:
box2d::Joint

Public Member Functions

 PrismaticJoint (const PrismaticJointDef &def)
 
Length2D GetAnchorA () const override
 Get the anchor point on bodyA in world coordinates. More...
 
Length2D GetAnchorB () const override
 Get the anchor point on bodyB in world coordinates. More...
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Get the reaction torque on bodyB in N*m. More...
 
Length2D GetLocalAnchorA () const
 The local anchor point relative to bodyA's origin. More...
 
Length2D GetLocalAnchorB () const
 The local anchor point relative to bodyB's origin. More...
 
UnitVec2 GetLocalAxisA () const
 The local joint axis relative to bodyA. More...
 
Angle GetReferenceAngle () const
 Get the reference angle. More...
 
Length GetJointTranslation () const
 Get the current joint translation, usually in meters. More...
 
LinearVelocity GetJointSpeed () const
 Get the current joint translation speed, usually in meters per second. More...
 
bool IsLimitEnabled () const noexcept
 Is the joint limit enabled? More...
 
void EnableLimit (bool flag) noexcept
 Enable/disable the joint limit. More...
 
Length GetLowerLimit () const noexcept
 Get the lower joint limit, usually in meters. More...
 
Length GetUpperLimit () const noexcept
 Get the upper joint limit, usually in meters. More...
 
void SetLimits (Length lower, Length upper)
 Set the joint limits, usually in meters. More...
 
bool IsMotorEnabled () const noexcept
 Is the joint motor enabled? More...
 
void EnableMotor (bool flag) noexcept
 Enable/disable the joint motor. More...
 
void SetMotorSpeed (AngularVelocity speed) noexcept
 Set the motor speed, usually in radians per second. More...
 
AngularVelocity GetMotorSpeed () const noexcept
 Get the motor speed, usually in radians per second. More...
 
void SetMaxMotorForce (Force force) noexcept
 Set the maximum motor force, usually in N. More...
 
Force GetMaxMotorForce () const noexcept
 
Force GetMotorForce (Frequency inv_dt) const noexcept
 Get the current motor force given the inverse time step, usually in N. More...
 
- Public Member Functions inherited from box2d::Joint
JointType GetType () const noexcept
 Get the type of the concrete joint. More...
 
BodyGetBodyA () noexcept
 Get the first body attached to this joint. More...
 
BodyGetBodyB () noexcept
 Get the second body attached to this joint. More...
 
const BodyGetBodyA () const noexcept
 Get the first body attached to this joint. More...
 
const BodyGetBodyB () const noexcept
 Get the second body attached to this joint. More...
 
void * GetUserData () const noexcept
 Get the user data pointer. More...
 
void SetUserData (void *data) noexcept
 Set the user data pointer. More...
 
bool GetCollideConnected () const noexcept
 Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap. More...
 
virtual void ShiftOrigin (const Length2D newOrigin)
 Shift the origin for any points stored in world coordinates. More...
 

Additional Inherited Members

- Public Types inherited from box2d::Joint
enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 
- Static Public Member Functions inherited from box2d::Joint
static bool IsOkay (const JointDef &def) noexcept
 
- Protected Member Functions inherited from box2d::Joint
 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

Detailed Description

Prismatic Joint.

This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented.

Note
You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.

Constructor & Destructor Documentation

◆ PrismaticJoint()

PrismaticJoint::PrismaticJoint ( const PrismaticJointDef def)

Member Function Documentation

◆ EnableLimit()

void PrismaticJoint::EnableLimit ( bool  flag)
noexcept

Enable/disable the joint limit.

◆ EnableMotor()

void PrismaticJoint::EnableMotor ( bool  flag)
noexcept

Enable/disable the joint motor.

◆ GetAnchorA()

Length2D PrismaticJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D PrismaticJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetJointSpeed()

LinearVelocity PrismaticJoint::GetJointSpeed ( ) const

Get the current joint translation speed, usually in meters per second.

◆ GetJointTranslation()

Length PrismaticJoint::GetJointTranslation ( ) const

Get the current joint translation, usually in meters.

◆ GetLocalAnchorA()

Length2D box2d::PrismaticJoint::GetLocalAnchorA ( ) const
inline

The local anchor point relative to bodyA's origin.

◆ GetLocalAnchorB()

Length2D box2d::PrismaticJoint::GetLocalAnchorB ( ) const
inline

The local anchor point relative to bodyB's origin.

◆ GetLocalAxisA()

UnitVec2 box2d::PrismaticJoint::GetLocalAxisA ( ) const
inline

The local joint axis relative to bodyA.

◆ GetLowerLimit()

Length PrismaticJoint::GetLowerLimit ( ) const
noexcept

Get the lower joint limit, usually in meters.

◆ GetMaxMotorForce()

Force box2d::PrismaticJoint::GetMaxMotorForce ( ) const
inlinenoexcept

◆ GetMotorForce()

Force PrismaticJoint::GetMotorForce ( Frequency  inv_dt) const
noexcept

Get the current motor force given the inverse time step, usually in N.

◆ GetMotorSpeed()

AngularVelocity box2d::PrismaticJoint::GetMotorSpeed ( ) const
inlinenoexcept

Get the motor speed, usually in radians per second.

◆ GetReactionForce()

Force2D PrismaticJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Get the reaction force on bodyB at the joint anchor in Newtons.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque PrismaticJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements box2d::Joint.

◆ GetReferenceAngle()

Angle box2d::PrismaticJoint::GetReferenceAngle ( ) const
inline

Get the reference angle.

◆ GetUpperLimit()

Length PrismaticJoint::GetUpperLimit ( ) const
noexcept

Get the upper joint limit, usually in meters.

◆ IsLimitEnabled()

bool PrismaticJoint::IsLimitEnabled ( ) const
noexcept

Is the joint limit enabled?

◆ IsMotorEnabled()

bool PrismaticJoint::IsMotorEnabled ( ) const
noexcept

Is the joint motor enabled?

◆ SetLimits()

void PrismaticJoint::SetLimits ( Length  lower,
Length  upper 
)

Set the joint limits, usually in meters.

◆ SetMaxMotorForce()

void PrismaticJoint::SetMaxMotorForce ( Force  force)
noexcept

Set the maximum motor force, usually in N.

◆ SetMotorSpeed()

void PrismaticJoint::SetMotorSpeed ( AngularVelocity  speed)
noexcept

Set the motor speed, usually in radians per second.


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