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

A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. In other words, it is a point to line constraint with a rotational motor and a linear spring/damper. This joint is designed for vehicle suspensions. More...

#include <WheelJoint.hpp>

Inheritance diagram for box2d::WheelJoint:
box2d::Joint

Public Member Functions

 WheelJoint (const WheelJointDef &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...
 
Length GetJointTranslation () const
 Get the current joint translation, usually in meters. More...
 
AngularVelocity GetJointSpeed () const
 Get the current joint translation speed, in Angle per second. More...
 
bool IsMotorEnabled () const noexcept
 Is the joint motor enabled? More...
 
void EnableMotor (bool flag)
 Enable/disable the joint motor. More...
 
void SetMotorSpeed (AngularVelocity speed)
 Set the motor speed, usually in radians per second. More...
 
AngularVelocity GetMotorSpeed () const
 Get the motor speed, usually in radians per second. More...
 
void SetMaxMotorTorque (Torque torque)
 Set/Get the maximum motor force, usually in N-m. More...
 
Torque GetMaxMotorTorque () const
 
Torque GetMotorTorque (Frequency inv_dt) const
 Get the current motor torque given the inverse time step, usually in N-m. More...
 
void SetSpringFrequencyHz (Frequency hz)
 Set/Get the spring frequency in Hertz. Setting the frequency to zero disables the spring. More...
 
Frequency GetSpringFrequencyHz () const
 
void SetSpringDampingRatio (RealNum ratio)
 Set/Get the spring damping ratio. More...
 
RealNum GetSpringDampingRatio () const
 
- 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

A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. In other words, it is a point to line constraint with a rotational motor and a linear spring/damper. This joint is designed for vehicle suspensions.

Constructor & Destructor Documentation

◆ WheelJoint()

WheelJoint::WheelJoint ( const WheelJointDef def)

Member Function Documentation

◆ EnableMotor()

void WheelJoint::EnableMotor ( bool  flag)

Enable/disable the joint motor.

◆ GetAnchorA()

Length2D WheelJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D WheelJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetJointSpeed()

AngularVelocity WheelJoint::GetJointSpeed ( ) const

Get the current joint translation speed, in Angle per second.

◆ GetJointTranslation()

Length WheelJoint::GetJointTranslation ( ) const

Get the current joint translation, usually in meters.

◆ GetLocalAnchorA()

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

The local anchor point relative to bodyA's origin.

◆ GetLocalAnchorB()

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

The local anchor point relative to bodyB's origin.

◆ GetLocalAxisA()

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

The local joint axis relative to bodyA.

◆ GetMaxMotorTorque()

Torque box2d::WheelJoint::GetMaxMotorTorque ( ) const
inline

◆ GetMotorSpeed()

AngularVelocity box2d::WheelJoint::GetMotorSpeed ( ) const
inline

Get the motor speed, usually in radians per second.

◆ GetMotorTorque()

Torque WheelJoint::GetMotorTorque ( Frequency  inv_dt) const

Get the current motor torque given the inverse time step, usually in N-m.

◆ GetReactionForce()

Force2D WheelJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

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

Implements box2d::Joint.

◆ GetReactionTorque()

Torque WheelJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements box2d::Joint.

◆ GetSpringDampingRatio()

RealNum box2d::WheelJoint::GetSpringDampingRatio ( ) const
inline

◆ GetSpringFrequencyHz()

Frequency box2d::WheelJoint::GetSpringFrequencyHz ( ) const
inline

◆ IsMotorEnabled()

bool box2d::WheelJoint::IsMotorEnabled ( ) const
inlinenoexcept

Is the joint motor enabled?

◆ SetMaxMotorTorque()

void WheelJoint::SetMaxMotorTorque ( Torque  torque)

Set/Get the maximum motor force, usually in N-m.

◆ SetMotorSpeed()

void WheelJoint::SetMotorSpeed ( AngularVelocity  speed)

Set the motor speed, usually in radians per second.

◆ SetSpringDampingRatio()

void box2d::WheelJoint::SetSpringDampingRatio ( RealNum  ratio)
inline

Set/Get the spring damping ratio.

◆ SetSpringFrequencyHz()

void box2d::WheelJoint::SetSpringFrequencyHz ( Frequency  hz)
inline

Set/Get the spring frequency in Hertz. Setting the frequency to zero disables the spring.


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