Box2D: b2DistanceJointDef Struct Reference

Box2D

b2DistanceJointDef Struct Reference

Distance joint definition. More...

Inheritance diagram for b2DistanceJointDef:

b2JointDef

List of all members.

Public Member Functions

void Initialize (b2Body *body1, b2Body *body2, const b2Vec2 &anchor1, const b2Vec2 &anchor2)
 Initialize the bodies, anchors, and length using the world anchors.

Public Attributes

b2Vec2 localAnchor1
 The local anchor point relative to body1's origin.
b2Vec2 localAnchor2
 The local anchor point relative to body2's origin.
float32 length
 The equilibrium length between the anchor points.
float32 frequencyHz
 The response speed.
float32 dampingRatio
 The damping ratio. 0 = no damping, 1 = critical damping.

Detailed Description

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.

Warning:
Do not use a zero or short length.

Member Function Documentation

void b2DistanceJointDef::Initialize ( b2Body body1,
b2Body body2,
const b2Vec2 anchor1,
const b2Vec2 anchor2 
)

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


The documentation for this struct was generated from the following files:
  • b2DistanceJoint.h
  • b2DistanceJoint.cpp

Generated on Sun Apr 13 15:21:27 2008 for Box2D by  doxygen 1.5.4