HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
|
A distance joint.
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 | |
void | EnableSpring (bool enableSpring) |
Enables/disables the spring on this distance joint. | |
void | SetLengthRange (float minLength, float maxLength) |
Sets the minimum and maximum length parameters on this distance joint. | |
![]() | |
void | Destroy () |
Destroys this joint. | |
void | WakeBodies () |
Wakes the bodies connected to this joint. | |
Properties | |
float | Length [get, set] |
The rest length of this distance joint. | |
bool | SpringEnabled [get, set] |
Gets or sets the spring enabled state on this distance joint. | |
float | SpringHertz [get, set] |
The spring stiffness in Hertz on this distance joint. | |
float | SpringDampingRatio [get, set] |
The spring damping ratio on this distance joint. | |
bool | LimitEnabled [get, set] |
The limit enabled state of this distance joint. | |
float | MinLength [get] |
Gets the minimum length of this distance joint. | |
float | MaxLength [get] |
Gets the maximum length of this distance joint. | |
float | CurrentLength [get] |
Gets the current length of this distance joint. | |
bool | MotorEnabled [get, set] |
The motor enabled state of this distance joint. | |
float | MotorSpeed [get, set] |
The desired motor speed, usually in meters per second. | |
float | MaxMotorForce [get, set] |
The maximum motor force on this distance joint. | |
float | MotorForce [get] |
Gets the current motor force on this distance joint. | |
![]() | |
bool | Valid [get] |
Checks if this joint is valid. | |
JointType | Type [get] |
Gets the joint type. | |
Body | BodyA [get] |
Gets body A on this joint. | |
Body | BodyB [get] |
Gets body B on this joint. | |
World | World [get] |
Gets the world that owns this joint. | |
Vec2 | LocalAnchorA [get] |
Gets the local anchor on body A. | |
Vec2 | LocalAnchorB [get] |
Gets the local anchor on body B. | |
bool | CollideConnected [get, set] |
Set this flag to true if the attached bodies should collide. | |
object? | UserData [get, set] |
The user data object for this joint. | |
Vec2 | ConstraintForce [get] |
Gets the current constraint force for this joint. | |
float | ConstraintTorque [get] |
Gets the current constraint torque for this joint. | |
A distance joint.
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.
void Box2D.DistanceJoint.EnableSpring | ( | bool | enableSpring | ) |
Enables/disables the spring on this distance joint.
enableSpring | True to enable the spring, false to disable the spring |
This wraps b2DistanceJoint_EnableSpring
void Box2D.DistanceJoint.SetLengthRange | ( | float | minLength, |
float | maxLength | ||
) |
Sets the minimum and maximum length parameters on this distance joint.
minLength | The minimum length |
maxLength | The maximum length |
This wraps b2DistanceJoint_SetLengthRange
|
get |
Gets the current length of this distance joint.
This wraps b2DistanceJoint_GetCurrentLength
|
getset |
The rest length of this distance joint.
This wraps b2DistanceJoint_SetLength and b2DistanceJoint_GetLength
|
getset |
The limit enabled state of this distance joint.
The limit only works if the joint spring is enabled. Otherwise the joint is rigid and the limit has no effect
This wraps b2DistanceJoint_EnableLimit and b2DistanceJoint_IsLimitEnabled
|
get |
Gets the maximum length of this distance joint.
This wraps b2DistanceJoint_GetMaxLength
|
getset |
The maximum motor force on this distance joint.
This wraps b2DistanceJoint_SetMaxMotorForce and b2DistanceJoint_GetMaxMotorForce
|
get |
Gets the minimum length of this distance joint.
This wraps b2DistanceJoint_GetMinLength
|
getset |
The motor enabled state of this distance joint.
This wraps b2DistanceJoint_EnableMotor and b2DistanceJoint_IsMotorEnabled
|
get |
Gets the current motor force on this distance joint.
This wraps b2DistanceJoint_GetMotorForce
|
getset |
The desired motor speed, usually in meters per second.
This wraps b2DistanceJoint_SetMotorSpeed and b2DistanceJoint_GetMotorSpeed
|
getset |
The spring damping ratio on this distance joint.
This wraps b2DistanceJoint_SetSpringDampingRatio and b2DistanceJoint_GetSpringDampingRatio
|
getset |
Gets or sets the spring enabled state on this distance joint.
This wraps b2DistanceJoint_IsSpringEnabled and b2DistanceJoint_EnableSpring
|
getset |
The spring stiffness in Hertz on this distance joint.
This wraps b2DistanceJoint_SetSpringHertz and b2DistanceJoint_GetSpringHertz