HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Box2D.DistanceJointDef Class Referencesealed

Distance joint definition
This requires defining an anchor point on both bodies and the non-zero distance 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...

Public Member Functions

 DistanceJointDef (Body bodyA, Body bodyB, Vec2 anchorA, Vec2 anchorB, float length=0.0f, bool enableSpring=false, float hertz=0.0f, float dampingRatio=0.0f, bool enableLimit=false, float minLength=0.0f, float maxLength=0.0f, bool enableMotor=false, float maxMotorForce=0.0f, float motorSpeed=0.0f, bool collideConnected=false, object? userData=null)
 Construct a distance joint definition with the supplied values.
 
 DistanceJointDef ()
 Construct a distance joint definition with the default values.
 

Properties

ref Body BodyA [get]
 The first attached body.
 
ref Body BodyB [get]
 The second attached body.
 
ref Vec2 LocalAnchorA [get]
 The local anchor point relative to bodyA's origin.
 
ref Vec2 LocalAnchorB [get]
 The local anchor point relative to bodyB's origin.
 
ref float Length [get]
 The rest length of this joint. Clamped to a stable minimum value.
 
bool EnableSpring [get, set]
 Enable the distance constraint to behave like a spring. If false then the distance joint will be rigid, overriding the limit and motor.
 
ref float Hertz [get]
 The spring linear stiffness Hertz, cycles per second.
 
ref float DampingRatio [get]
 The spring linear damping ratio, non-dimensional.
 
bool EnableLimit [get, set]
 Enable/disable the joint limit.
 
ref float MinLength [get]
 Minimum length. Clamped to a stable minimum value.
 
ref float MaxLength [get]
 Maximum length. Must be greater than or equal to the minimum length.
 
bool EnableMotor [get, set]
 Enable/disable the joint motor.
 
ref float MaxMotorForce [get]
 The maximum motor force, usually in newtons.
 
ref float MotorSpeed [get]
 The desired motor speed, usually in meters per second.
 
bool CollideConnected [get, set]
 Set this flag to true if the attached bodies should collide.
 
object? UserData [get, set]
 Use this to store application specific shape data.
 

Detailed Description

Distance joint definition
This requires defining an anchor point on both bodies and the non-zero distance 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.

Constructor & Destructor Documentation

◆ DistanceJointDef()

Box2D.DistanceJointDef.DistanceJointDef ( Body  bodyA,
Body  bodyB,
Vec2  anchorA,
Vec2  anchorB,
float  length = 0::0f,
bool  enableSpring = false,
float  hertz = 0::0f,
float  dampingRatio = 0::0f,
bool  enableLimit = false,
float  minLength = 0::0f,
float  maxLength = 0::0f,
bool  enableMotor = false,
float  maxMotorForce = 0::0f,
float  motorSpeed = 0::0f,
bool  collideConnected = false,
object?  userData = null 
)
inline

Construct a distance joint definition with the supplied values.

Parameters
bodyAThe first attached body
bodyBThe second attached body
anchorAThe local anchor point on the first body
anchorBThe local anchor point on the second body
lengthThe rest length of the joint
enableSpringEnable the spring
hertzThe spring frequency in Hertz
dampingRatioThe damping ratio
enableLimitEnable the joint limit
minLengthThe minimum length of the joint
maxLengthThe maximum length of the joint
enableMotorEnable the joint motor
maxMotorForceThe maximum motor force
motorSpeedThe desired motor speed
collideConnectedSet this flag to true if the attached bodies should collide
userDataUser data

The documentation for this class was generated from the following file: