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

Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game. More...

#include <WheelJoint.hpp>

Inheritance diagram for box2d::WheelJointDef:
box2d::JointDef

Public Member Functions

constexpr WheelJointDef () noexcept
 
void Initialize (Body *bodyA, Body *bodyB, const Length2D anchor, const UnitVec2 axis)
 Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis. More...
 
- Public Member Functions inherited from box2d::JointDef
 JointDef ()=delete
 Deleted default constructor for abstract base class. More...
 
constexpr JointDef (JointType t) noexcept
 
constexpr JointDef (JointType t, Body *bA, Body *bB, bool cc=false, void *u=nullptr) noexcept
 

Public Attributes

Length2D localAnchorA = Vec2_zero * Meter
 The local anchor point relative to bodyA's origin. More...
 
Length2D localAnchorB = Vec2_zero * Meter
 The local anchor point relative to bodyB's origin. More...
 
UnitVec2 localAxisA = UnitVec2::GetRight()
 The local translation axis in bodyA. More...
 
bool enableMotor = false
 Enable/disable the joint motor. More...
 
Torque maxMotorTorque = Torque{0}
 The maximum motor torque, usually in N-m. More...
 
AngularVelocity motorSpeed = AngularVelocity{0}
 The desired motor speed in radians per second. More...
 
Frequency frequencyHz = RealNum{2} * Hertz
 Suspension frequency, zero indicates no suspension. More...
 
RealNum dampingRatio = 0.7f
 Suspension damping ratio, one indicates critical damping. More...
 
- Public Attributes inherited from box2d::JointDef
const JointType type
 The joint type is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 The first attached body. More...
 
BodybodyB = nullptr
 The second attached body. More...
 
bool collideConnected = false
 Set this flag to true if the attached bodies should collide. More...
 
void * userData = nullptr
 Use this to attach application specific data to your joints. More...
 

Detailed Description

Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Constructor & Destructor Documentation

◆ WheelJointDef()

constexpr box2d::WheelJointDef::WheelJointDef ( )
inlinenoexcept

Member Function Documentation

◆ Initialize()

void WheelJointDef::Initialize ( Body bodyA,
Body bodyB,
const Length2D  anchor,
const UnitVec2  axis 
)

Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.

Member Data Documentation

◆ dampingRatio

RealNum box2d::WheelJointDef::dampingRatio = 0.7f

Suspension damping ratio, one indicates critical damping.

◆ enableMotor

bool box2d::WheelJointDef::enableMotor = false

Enable/disable the joint motor.

◆ frequencyHz

Frequency box2d::WheelJointDef::frequencyHz = RealNum{2} * Hertz

Suspension frequency, zero indicates no suspension.

◆ localAnchorA

Length2D box2d::WheelJointDef::localAnchorA = Vec2_zero * Meter

The local anchor point relative to bodyA's origin.

◆ localAnchorB

Length2D box2d::WheelJointDef::localAnchorB = Vec2_zero * Meter

The local anchor point relative to bodyB's origin.

◆ localAxisA

UnitVec2 box2d::WheelJointDef::localAxisA = UnitVec2::GetRight()

The local translation axis in bodyA.

◆ maxMotorTorque

Torque box2d::WheelJointDef::maxMotorTorque = Torque{0}

The maximum motor torque, usually in N-m.

◆ motorSpeed

AngularVelocity box2d::WheelJointDef::motorSpeed = AngularVelocity{0}

The desired motor speed in radians per second.


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