PackageBox2D.Dynamics.Joints
Classpublic class b2RevoluteJointDef
Inheritanceb2RevoluteJointDef Inheritance b2JointDef
Sourceb2RevoluteJointDef.as

Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because: 1. you might not know where the center of mass will be. 2. if you add/remove shapes from a body and recompute the mass, the joints will be broken.



Public Properties
 PropertyDefined by
 Inheritedbody1 : b2Body
The first attached body.
b2JointDef
 Inheritedbody2 : b2Body
The second attached body.
b2JointDef
 InheritedcollideConnected : Boolean
Set this flag to true if the attached bodies should collide.
b2JointDef
  enableLimit : Boolean
A flag to enable joint limits.
b2RevoluteJointDef
  enableMotor : Boolean
A flag to enable the joint motor.
b2RevoluteJointDef
  localAnchor1 : b2Vec2
The local anchor point relative to body1's origin.
b2RevoluteJointDef
  localAnchor2 : b2Vec2
The local anchor point relative to body2's origin.
b2RevoluteJointDef
  lowerAngle : Number
The lower angle for the joint limit (radians).
b2RevoluteJointDef
  maxMotorTorque : Number
The maximum motor torque used to achieve the desired motor speed.
b2RevoluteJointDef
  motorSpeed : Number
The desired motor speed.
b2RevoluteJointDef
  referenceAngle : Number
The body2 angle minus body1 angle in the reference state (radians).
b2RevoluteJointDef
 Inheritedtype : int
The joint type is set automatically for concrete joint types.
b2JointDef
  upperAngle : Number
The upper angle for the joint limit (radians).
b2RevoluteJointDef
 InheriteduserData : *
Use this to attach application specific data to your joints.
b2JointDef
Public Methods
 MethodDefined by
  
b2RevoluteJointDef
  
Initialize(b1:b2Body, b2:b2Body, anchor:b2Vec2):void
Initialize the bodies, anchors, and reference angle using the world anchor.
b2RevoluteJointDef
Property detail
enableLimitproperty
public var enableLimit:Boolean

A flag to enable joint limits.

enableMotorproperty 
public var enableMotor:Boolean

A flag to enable the joint motor.

localAnchor1property 
public var localAnchor1:b2Vec2

The local anchor point relative to body1's origin.

localAnchor2property 
public var localAnchor2:b2Vec2

The local anchor point relative to body2's origin.

lowerAngleproperty 
public var lowerAngle:Number

The lower angle for the joint limit (radians).

maxMotorTorqueproperty 
public var maxMotorTorque:Number

The maximum motor torque used to achieve the desired motor speed. Usually in N-m.

motorSpeedproperty 
public var motorSpeed:Number

The desired motor speed. Usually in radians per second.

referenceAngleproperty 
public var referenceAngle:Number

The body2 angle minus body1 angle in the reference state (radians).

upperAngleproperty 
public var upperAngle:Number

The upper angle for the joint limit (radians).

Constructor detail
b2RevoluteJointDef()constructor
public function b2RevoluteJointDef()
Method detail
Initialize()method
public function Initialize(b1:b2Body, b2:b2Body, anchor:b2Vec2):void

Initialize the bodies, anchors, and reference angle using the world anchor.

Parameters
b1:b2Body
 
b2:b2Body
 
anchor:b2Vec2