HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.1
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

unsafe void EnableSpring (bool enableSpring)
 Enables/disables the spring on this distance joint.
 
unsafe void SetLengthRange (float minLength, float maxLength)
 Sets the minimum and maximum length parameters on this distance joint.
 
- Public Member Functions inherited from Box2D.Joint
unsafe void Destroy ()
 Destroys this joint.
 
unsafe void WakeBodies ()
 Wakes the bodies connected to this joint.
 
 unsafe (float hertz, float dampingRatio) ConstraintTuning
 Gets or sets the joint constraint tuning in Hertz and damping ratio. Advanced feature.
 

Properties

unsafe float Length [get, set]
 The rest length of this distance joint.
 
unsafe bool SpringEnabled [get, set]
 Gets or sets the spring enabled state on this distance joint.
 
unsafe float SpringHertz [get, set]
 The spring stiffness in Hertz on this distance joint.
 
unsafe float SpringDampingRatio [get, set]
 The spring damping ratio on this distance joint.
 
unsafe bool LimitEnabled [get, set]
 The limit enabled state of this distance joint.
 
unsafe float MinLength [get]
 Gets the minimum length of this distance joint.
 
unsafe float MaxLength [get]
 Gets the maximum length of this distance joint.
 
unsafe float CurrentLength [get]
 Gets the current length of this distance joint.
 
unsafe bool MotorEnabled [get, set]
 The motor enabled state of this distance joint.
 
unsafe float MotorSpeed [get, set]
 The desired motor speed, usually in meters per second.
 
unsafe float MaxMotorForce [get, set]
 The maximum motor force on this distance joint.
 
unsafe float MotorForce [get]
 Gets the current motor force on this distance joint.
 
- Properties inherited from Box2D.Joint
unsafe bool Valid [get]
 Checks if this joint is valid.
 
unsafe JointType Type [get]
 Gets the joint type.
 
unsafe Body BodyA [get]
 Gets body A on this joint.
 
unsafe Body BodyB [get]
 Gets body B on this joint.
 
unsafe World World [get]
 Gets the world that owns this joint.
 
unsafe Vec2 LocalAnchorA [get, set]
 The local anchor on body A.
 
unsafe Vec2 LocalAnchorB [get, set]
 The local anchor on body B.
 
unsafe bool CollideConnected [get, set]
 Set this flag to true if the attached bodies should collide.
 
unsafe? object UserData [get, set]
 The user data object for this joint.
 
unsafe Vec2 ConstraintForce [get]
 Gets the current constraint force for this joint.
 
unsafe float ConstraintTorque [get]
 Gets the current constraint torque for this joint.
 
unsafe float LinearSeparation [get]
 Gets the current linear separation error for this joint.
 
unsafe float AngularSeparation [get]
 Gets the current angular separation error for this joint.
 
unsafe float ReferenceAngle [get, set]
 The reference angle in radians for joints that support it.
 
unsafe Vec2 LocalAxisA [get, set]
 The local axis on body A for joints that support it.
 

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()

unsafe 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

◆ SetLengthRange()

unsafe 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

Property Documentation

◆ CurrentLength

unsafe float Box2D.DistanceJoint.CurrentLength
get

Gets the current length of this distance joint.

Returns
The current length

◆ LimitEnabled

unsafe 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

◆ MaxLength

unsafe float Box2D.DistanceJoint.MaxLength
get

Gets the maximum length of this distance joint.

Returns
The maximum length

◆ MinLength

unsafe float Box2D.DistanceJoint.MinLength
get

Gets the minimum length of this distance joint.

Returns
The minimum length

◆ MotorForce

unsafe float Box2D.DistanceJoint.MotorForce
get

Gets the current motor force on this distance joint.

Returns
The current motor force, usually in Newtons

◆ SpringEnabled

unsafe bool Box2D.DistanceJoint.SpringEnabled
getset

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

Returns
True if the spring is enabled

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