C# Класс FarseerPhysics.Dynamics.Joints.DistanceJoint

A distance joint rains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
Наследование: Joint
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
dampingRatio float
frequency float
length float
localAnchorA Vector2
localAnchorB Vector2

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

Метод Описание
DistanceJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false ) : System

This requires defining an anchor point on both bodies and the non-zero length of the distance joint. If you don't supply a length, the local anchor points is used 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.

getReactionForce ( float invDt ) : Vector2

Get the reaction force given the inverse time step. Unit is N.

getReactionTorque ( float invDt ) : float

Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.

Приватные методы

Метод Описание
DistanceJoint ( ) : System
initVelocityConstraints ( SolverData &data ) : void
solvePositionConstraints ( SolverData &data ) : bool
solveVelocityConstraints ( SolverData &data ) : void

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

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

This requires defining an anchor point on both bodies and the non-zero length of the distance joint. If you don't supply a length, the local anchor points is used 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.
public DistanceJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false ) : System
bodyA Body The first body
bodyB Body The second body
anchorA Vector2 The first body anchor
anchorB Vector2 The second body anchor
useWorldCoordinates bool Set to true if you are using world coordinates as anchors.
Результат System

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

Get the reaction force given the inverse time step. Unit is N.
public getReactionForce ( float invDt ) : Vector2
invDt float
Результат Vector2

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

Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.
public getReactionTorque ( float invDt ) : float
invDt float
Результат float

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

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

The damping ratio. 0 = no damping, 1 = critical damping.
public float dampingRatio
Результат float

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

The mass-spring-damper frequency in Hertz. A value of 0 disables softness.
public float frequency
Результат float

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

The natural length between the anchor points. Manipulating the length can lead to non-physical behavior when the frequency is zero.
public float length
Результат float

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

The local anchor point relative to bodyA's origin.
public Vector2 localAnchorA
Результат Vector2

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

The local anchor point relative to bodyB's origin.
public Vector2 localAnchorB
Результат Vector2