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

Prismatic 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 <PrismaticJoint.hpp>

Inheritance diagram for box2d::PrismaticJointDef:
box2d::JointDef

Public Member Functions

constexpr PrismaticJointDef () noexcept
 
 PrismaticJointDef (const PrismaticJointDef &copy)=default
 
 PrismaticJointDef (Body *bodyA, Body *bodyB, const Length2D anchor, const UnitVec2 axis) noexcept
 Initialize the bodies, anchors, axis, and reference angle using the world anchor and unit 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 unit axis in bodyA. More...
 
Angle referenceAngle = Angle{0}
 The constrained angle between the bodies: bodyB_angle - bodyA_angle. More...
 
bool enableLimit = false
 Enable/disable the joint limit. More...
 
Length lowerTranslation = Length{0}
 The lower translation limit. More...
 
Length upperTranslation = Length{0}
 The upper translation limit. 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...
 
- 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

Prismatic 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

◆ PrismaticJointDef() [1/3]

constexpr box2d::PrismaticJointDef::PrismaticJointDef ( )
inlinenoexcept

◆ PrismaticJointDef() [2/3]

box2d::PrismaticJointDef::PrismaticJointDef ( const PrismaticJointDef copy)
default

◆ PrismaticJointDef() [3/3]

PrismaticJointDef::PrismaticJointDef ( Body bodyA,
Body bodyB,
const Length2D  anchor,
const UnitVec2  axis 
)
noexcept

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

Member Data Documentation

◆ enableLimit

bool box2d::PrismaticJointDef::enableLimit = false

Enable/disable the joint limit.

◆ enableMotor

bool box2d::PrismaticJointDef::enableMotor = false

Enable/disable the joint motor.

◆ localAnchorA

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

The local anchor point relative to bodyA's origin.

◆ localAnchorB

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

The local anchor point relative to bodyB's origin.

◆ localAxisA

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

The local translation unit axis in bodyA.

◆ lowerTranslation

Length box2d::PrismaticJointDef::lowerTranslation = Length{0}

The lower translation limit.

◆ maxMotorTorque

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

The maximum motor torque, usually in N-m.

◆ motorSpeed

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

The desired motor speed (in radians per second).

◆ referenceAngle

Angle box2d::PrismaticJointDef::referenceAngle = Angle{0}

The constrained angle between the bodies: bodyB_angle - bodyA_angle.

◆ upperTranslation

Length box2d::PrismaticJointDef::upperTranslation = Length{0}

The upper translation limit.


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