Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
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>
Public Member Functions | |
constexpr | PrismaticJointDef () noexcept |
PrismaticJointDef (const PrismaticJointDef ©)=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... | |
![]() | |
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... | |
![]() | |
const JointType | type |
The joint type is set automatically for concrete joint types. More... | |
Body * | bodyA = nullptr |
The first attached body. More... | |
Body * | bodyB = 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... | |
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.
|
inlinenoexcept |
|
default |
|
noexcept |
Initialize the bodies, anchors, axis, and reference angle using the world anchor and unit world axis.
bool box2d::PrismaticJointDef::enableLimit = false |
Enable/disable the joint limit.
bool box2d::PrismaticJointDef::enableMotor = false |
Enable/disable the joint motor.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.
UnitVec2 box2d::PrismaticJointDef::localAxisA = UnitVec2::GetRight() |
The local translation unit axis in bodyA.
The maximum motor torque, usually in N-m.
AngularVelocity box2d::PrismaticJointDef::motorSpeed = AngularVelocity{0} |
The desired motor speed (in radians per second).
The constrained angle between the bodies: bodyB_angle - bodyA_angle.