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

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...

Inheritance diagram for Box2D.DistanceJoint:
Inheritance graph
[legend]
Collaboration diagram for Box2D.DistanceJoint:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from Box2D.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.
 
- Properties inherited from Box2D.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.
 

Detailed Description

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.

Member Function Documentation

◆ EnableSpring()

void Box2D.DistanceJoint.EnableSpring ( bool  enableSpring)

Enables/disables the spring on this distance joint.

Parameters
enableSpringTrue to enable the spring, false to disable the spring

This wraps b2DistanceJoint_EnableSpring

◆ SetLengthRange()

void Box2D.DistanceJoint.SetLengthRange ( float  minLength,
float  maxLength 
)

Sets the minimum and maximum length parameters on this distance joint.

Parameters
minLengthThe minimum length
maxLengthThe maximum length

This wraps b2DistanceJoint_SetLengthRange

Property Documentation

◆ CurrentLength

float Box2D.DistanceJoint.CurrentLength
get

Gets the current length of this distance joint.

Returns
The current length

This wraps b2DistanceJoint_GetCurrentLength

◆ Length

float Box2D.DistanceJoint.Length
getset

The rest length of this distance joint.

This wraps b2DistanceJoint_SetLength and b2DistanceJoint_GetLength

◆ LimitEnabled

bool Box2D.DistanceJoint.LimitEnabled
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

◆ MaxLength

float Box2D.DistanceJoint.MaxLength
get

Gets the maximum length of this distance joint.

Returns
The maximum length

This wraps b2DistanceJoint_GetMaxLength

◆ MaxMotorForce

float Box2D.DistanceJoint.MaxMotorForce
getset

The maximum motor force on this distance joint.

This wraps b2DistanceJoint_SetMaxMotorForce and b2DistanceJoint_GetMaxMotorForce

◆ MinLength

float Box2D.DistanceJoint.MinLength
get

Gets the minimum length of this distance joint.

Returns
The minimum length

This wraps b2DistanceJoint_GetMinLength

◆ MotorEnabled

bool Box2D.DistanceJoint.MotorEnabled
getset

The motor enabled state of this distance joint.

This wraps b2DistanceJoint_EnableMotor and b2DistanceJoint_IsMotorEnabled

◆ MotorForce

float Box2D.DistanceJoint.MotorForce
get

Gets the current motor force on this distance joint.

Returns
The current motor force, usually in Newtons

This wraps b2DistanceJoint_GetMotorForce

◆ MotorSpeed

float Box2D.DistanceJoint.MotorSpeed
getset

The desired motor speed, usually in meters per second.

This wraps b2DistanceJoint_SetMotorSpeed and b2DistanceJoint_GetMotorSpeed

◆ SpringDampingRatio

float Box2D.DistanceJoint.SpringDampingRatio
getset

The spring damping ratio on this distance joint.

This wraps b2DistanceJoint_SetSpringDampingRatio and b2DistanceJoint_GetSpringDampingRatio

◆ SpringEnabled

bool Box2D.DistanceJoint.SpringEnabled
getset

Gets or sets the spring enabled state on this distance joint.

Returns
True if the spring is enabled

This wraps b2DistanceJoint_IsSpringEnabled and b2DistanceJoint_EnableSpring

◆ SpringHertz

float Box2D.DistanceJoint.SpringHertz
getset

The spring stiffness in Hertz on this distance joint.

This wraps b2DistanceJoint_SetSpringHertz and b2DistanceJoint_GetSpringHertz


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