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...
|
| 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.
|
|
|
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.
|
|
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.
◆ 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
-
bodyA | The first attached body |
bodyB | The second attached body |
anchorA | The local anchor point on the first body |
anchorB | The local anchor point on the second body |
length | The rest length of the joint |
enableSpring | Enable the spring |
hertz | The spring frequency in Hertz |
dampingRatio | The damping ratio |
enableLimit | Enable the joint limit |
minLength | The minimum length of the joint |
maxLength | The maximum length of the joint |
enableMotor | Enable the joint motor |
maxMotorForce | The maximum motor force |
motorSpeed | The desired motor speed |
collideConnected | Set this flag to true if the attached bodies should collide |
userData | User data |
The documentation for this class was generated from the following file:
- src/Box2DBindings/Defs/DistanceJointDef.cs