C# Class FarseerPhysics.Dynamics.Joints.PrismaticJoint

A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Inheritance: Joint
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Свойство Type Description
localAnchorA Vector2
localAnchorB Vector2
motorImpulse float
referenceAngle float

Méthodes publiques

Méthode Description
PrismaticJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 axis, bool useWorldCoordinates = false ) : System

This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

PrismaticJoint ( Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis, bool useWorldCoordinates = false ) : System
getMotorForce ( float invDt ) : float

Gets the motor force.

getReactionForce ( float invDt ) : Vector2
getReactionTorque ( float invDt ) : float
initialize ( Vector2 localAnchorA, Vector2 localAnchorB, Vector2 axis, bool useWorldCoordinates ) : void
setLimits ( float lower, float upper ) : void

Set the joint limits, usually in meters.

Private Methods

Méthode Description
PrismaticJoint ( ) : System
initVelocityConstraints ( SolverData &data ) : void
solvePositionConstraints ( SolverData &data ) : bool
solveVelocityConstraints ( SolverData &data ) : void

Method Details

PrismaticJoint() public méthode

This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.
public PrismaticJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 axis, 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.
axis Vector2 The axis.
useWorldCoordinates bool Set to true if you are using world coordinates as anchors.
Résultat System

PrismaticJoint() public méthode

public PrismaticJoint ( Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis, bool useWorldCoordinates = false ) : System
bodyA Body
bodyB Body
anchor Vector2
axis Vector2
useWorldCoordinates bool
Résultat System

getMotorForce() public méthode

Gets the motor force.
public getMotorForce ( float invDt ) : float
invDt float The inverse delta time
Résultat float

getReactionForce() public méthode

public getReactionForce ( float invDt ) : Vector2
invDt float
Résultat Vector2

getReactionTorque() public méthode

public getReactionTorque ( float invDt ) : float
invDt float
Résultat float

initialize() public méthode

public initialize ( Vector2 localAnchorA, Vector2 localAnchorB, Vector2 axis, bool useWorldCoordinates ) : void
localAnchorA Vector2
localAnchorB Vector2
axis Vector2
useWorldCoordinates bool
Résultat void

setLimits() public méthode

Set the joint limits, usually in meters.
public setLimits ( float lower, float upper ) : void
lower float The lower limit
upper float The upper limit
Résultat void

Property Details

localAnchorA public_oe property

The local anchor point on BodyA
public Vector2 localAnchorA
Résultat Vector2

localAnchorB public_oe property

The local anchor point on BodyB
public Vector2 localAnchorB
Résultat Vector2

motorImpulse public_oe property

Get the current motor impulse, usually in N.
public float motorImpulse
Résultat float

referenceAngle public_oe property

The reference angle.
public float referenceAngle
Résultat float