C# Class Box2D.Dynamics.Joints.DistanceJointDef

Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length 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.
Inheritance: JointDef
Show file Open project: gerich-home/box2dnet Class Usage Examples

Public Properties

Property Type Description
DampingRatio float
FrequencyHz float
Length float
LocalAnchorA Box2D.Common.Vec2
LocalAnchorB Box2D.Common.Vec2

Public Methods

Method Description
DistanceJointDef ( ) : Box2D.Common
Initialize ( Body b1, Body b2, Vec2 anchor1, Vec2 anchor2 ) : void

Initialize the bodies, anchors, and length using the world anchors.

Method Details

DistanceJointDef() public method

public DistanceJointDef ( ) : Box2D.Common
return Box2D.Common

Initialize() public method

Initialize the bodies, anchors, and length using the world anchors.
public Initialize ( Body b1, Body b2, Vec2 anchor1, Vec2 anchor2 ) : void
b1 Body First body
b2 Body Second body
anchor1 Box2D.Common.Vec2 World anchor on first body
anchor2 Box2D.Common.Vec2 World anchor on second body
return void

Property Details

DampingRatio public property

The damping ratio. 0 = no damping, 1 = critical damping.
public float DampingRatio
return float

FrequencyHz public property

The mass-spring-damper frequency in Hertz.
public float FrequencyHz
return float

Length public property

The equilibrium length between the anchor points.
public float Length
return float

LocalAnchorA public property

The local anchor point relative to body1's origin.
public Vec2,Box2D.Common LocalAnchorA
return Box2D.Common.Vec2

LocalAnchorB public property

The local anchor point relative to body2's origin.
public Vec2,Box2D.Common LocalAnchorB
return Box2D.Common.Vec2