C# Class Box2D.Dynamics.Joints.RevoluteJointDef

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:
  • you might not know where the center of mass will be.
  • if you add/remove shapes from a body and recompute the mass, the joints will be broken.
Inheritance: JointDef
ファイルを表示 Open project: gerich-home/box2dnet Class Usage Examples

Public Properties

Property Type Description
EnableLimit bool
EnableMotor bool
LocalAnchorA Box2D.Common.Vec2
LocalAnchorB Box2D.Common.Vec2
LowerAngle float
MaxMotorTorque float
MotorSpeed float
ReferenceAngle float
UpperAngle float

Public Methods

Method Description
Initialize ( Body b1, Body b2, Vec2 anchor ) : void

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

RevoluteJointDef ( ) : Box2D.Common

Method Details

Initialize() public method

Initialize the bodies, anchors, and reference angle using the world anchor.
public Initialize ( Body b1, Body b2, Vec2 anchor ) : void
b1 Body
b2 Body
anchor Box2D.Common.Vec2
return void

RevoluteJointDef() public method

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

Property Details

EnableLimit public_oe property

A flag to enable joint limits.
public bool EnableLimit
return bool

EnableMotor public_oe property

A flag to enable the joint motor.
public bool EnableMotor
return bool

LocalAnchorA public_oe property

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

LocalAnchorB public_oe property

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

LowerAngle public_oe property

The lower angle for the joint limit (radians).
public float LowerAngle
return float

MaxMotorTorque public_oe property

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

MotorSpeed public_oe property

The desired motor speed. Usually in radians per second.
public float MotorSpeed
return float

ReferenceAngle public_oe property

The body2 angle minus body1 angle in the reference state (radians).
public float ReferenceAngle
return float

UpperAngle public_oe property

The upper angle for the joint limit (radians).
public float UpperAngle
return float