Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game. More...
#include <DistanceJoint.hpp>
Public Member Functions | |
constexpr | DistanceJointDef () noexcept |
DistanceJointDef (const DistanceJointDef ©)=default | |
DistanceJointDef (Body *bodyA, Body *bodyB, const Length2D anchorA=Vec2_zero *Meter, const Length2D anchorB=Vec2_zero *Meter, Frequency freq=Frequency{0}, RealNum damp=0) noexcept | |
Initialize the bodies, anchors, and length using the world anchors. 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... | |
Length | length = RealNum{1} * Meter |
The natural length between the anchor points. More... | |
Frequency | frequencyHz = Frequency{0} |
Mass-spring-damper frequency in Hertz. More... | |
RealNum | dampingRatio = 0 |
The damping ratio. 0 = no damping, 1 = 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... | |
Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.
|
inlinenoexcept |
|
default |
|
noexcept |
Initialize the bodies, anchors, and length using the world anchors.
RealNum box2d::DistanceJointDef::dampingRatio = 0 |
The damping ratio. 0 = no damping, 1 = critical damping.
Mass-spring-damper frequency in Hertz.
The natural length between the anchor points.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.