Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
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>
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... | |
![]() | |
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... | |
![]() | |
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... | |
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.
|
inlinenoexcept |
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.
RealNum box2d::WheelJointDef::dampingRatio = 0.7f |
Suspension damping ratio, one indicates critical damping.
bool box2d::WheelJointDef::enableMotor = false |
Enable/disable the joint motor.
Suspension frequency, zero indicates no suspension.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.
UnitVec2 box2d::WheelJointDef::localAxisA = UnitVec2::GetRight() |
The local translation axis in bodyA.
AngularVelocity box2d::WheelJointDef::motorSpeed = AngularVelocity{0} |
The desired motor speed in radians per second.