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
Datei anzeigen Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
localAnchorA Vector2
localAnchorB Vector2
motorImpulse float
referenceAngle float

Public Methods

Method 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

Method Description
PrismaticJoint ( ) : System
initVelocityConstraints ( SolverData &data ) : void
solvePositionConstraints ( SolverData &data ) : bool
solveVelocityConstraints ( SolverData &data ) : void

Method Details

PrismaticJoint() public method

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.
return System

PrismaticJoint() public method

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

getMotorForce() public method

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

getReactionForce() public method

public getReactionForce ( float invDt ) : Vector2
invDt float
return Vector2

getReactionTorque() public method

public getReactionTorque ( float invDt ) : float
invDt float
return float

initialize() public method

public initialize ( Vector2 localAnchorA, Vector2 localAnchorB, Vector2 axis, bool useWorldCoordinates ) : void
localAnchorA Vector2
localAnchorB Vector2
axis Vector2
useWorldCoordinates bool
return void

setLimits() public method

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

Property Details

localAnchorA public_oe property

The local anchor point on BodyA
public Vector2 localAnchorA
return Vector2

localAnchorB public_oe property

The local anchor point on BodyB
public Vector2 localAnchorB
return Vector2

motorImpulse public_oe property

Get the current motor impulse, usually in N.
public float motorImpulse
return float

referenceAngle public_oe property

The reference angle.
public float referenceAngle
return float