Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because: More...
#include <RevoluteJoint.hpp>
Public Member Functions | |
constexpr | RevoluteJointDef () noexcept |
RevoluteJointDef (Body *bodyA, Body *bodyB, const Length2D anchor, bool cc=false) | |
Initialize the bodies, anchors, and reference angle using a world anchor point. 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... | |
Angle | referenceAngle = Angle{0} |
The bodyB angle minus bodyA angle in the reference state (radians). More... | |
bool | enableLimit = false |
A flag to enable joint limits. More... | |
Angle | lowerAngle = Angle{0} |
The lower angle for the joint limit (radians). More... | |
Angle | upperAngle = Angle{0} |
The upper angle for the joint limit (radians). More... | |
bool | enableMotor = false |
A flag to enable the joint motor. More... | |
AngularVelocity | motorSpeed = AngularVelocity{0} |
The desired motor speed. More... | |
Torque | maxMotorTorque = 0 |
The maximum motor torque used to achieve the desired motor speed. Usually in N-m. 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... | |
Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because:
|
inlinenoexcept |
RevoluteJointDef::RevoluteJointDef | ( | Body * | bodyA, |
Body * | bodyB, | ||
const Length2D | anchor, | ||
bool | cc = false |
||
) |
Initialize the bodies, anchors, and reference angle using a world anchor point.
bool box2d::RevoluteJointDef::enableLimit = false |
A flag to enable joint limits.
bool box2d::RevoluteJointDef::enableMotor = false |
A flag to enable the joint motor.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.
Torque box2d::RevoluteJointDef::maxMotorTorque = 0 |
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
AngularVelocity box2d::RevoluteJointDef::motorSpeed = AngularVelocity{0} |
The desired motor speed.
The bodyB angle minus bodyA angle in the reference state (radians).