C# Класс 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.
Наследование: JointDef
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EnableLimit bool
EnableMotor bool
LocalAnchorA Box2D.Common.Vec2
LocalAnchorB Box2D.Common.Vec2
LowerAngle float
MaxMotorTorque float
MotorSpeed float
ReferenceAngle float
UpperAngle float

Открытые методы

Метод Описание
Initialize ( Body b1, Body b2, Vec2 anchor ) : void

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

RevoluteJointDef ( ) : Box2D.Common

Описание методов

Initialize() публичный Метод

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
Результат void

RevoluteJointDef() публичный Метод

public RevoluteJointDef ( ) : Box2D.Common
Результат Box2D.Common

Описание свойств

EnableLimit публичное свойство

A flag to enable joint limits.
public bool EnableLimit
Результат bool

EnableMotor публичное свойство

A flag to enable the joint motor.
public bool EnableMotor
Результат bool

LocalAnchorA публичное свойство

The local anchor point relative to body1's origin.
public Vec2,Box2D.Common LocalAnchorA
Результат Box2D.Common.Vec2

LocalAnchorB публичное свойство

The local anchor point relative to body2's origin.
public Vec2,Box2D.Common LocalAnchorB
Результат Box2D.Common.Vec2

LowerAngle публичное свойство

The lower angle for the joint limit (radians).
public float LowerAngle
Результат float

MaxMotorTorque публичное свойство

The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
public float MaxMotorTorque
Результат float

MotorSpeed публичное свойство

The desired motor speed. Usually in radians per second.
public float MotorSpeed
Результат float

ReferenceAngle публичное свойство

The body2 angle minus body1 angle in the reference state (radians).
public float ReferenceAngle
Результат float

UpperAngle публичное свойство

The upper angle for the joint limit (radians).
public float UpperAngle
Результат float