public class PrismaticJoint extends Joint
Modifier and Type | Field and Description |
---|---|
protected Vec2 |
m_localAnchorA |
protected Vec2 |
m_localAnchorB |
protected Vec2 |
m_localXAxisA |
protected Vec2 |
m_localYAxisA |
protected float |
m_referenceAngle |
m_bodyA, m_bodyB, m_edgeA, m_edgeB, m_islandFlag, m_next, m_prev, m_userData, pool
Modifier | Constructor and Description |
---|---|
protected |
PrismaticJoint(IWorldPool argWorld,
PrismaticJointDef def) |
Modifier and Type | Method and Description |
---|---|
void |
enableLimit(boolean flag)
Enable/disable the joint limit.
|
void |
enableMotor(boolean flag)
Enable/disable the joint motor.
|
void |
getAnchorA(Vec2 argOut)
get the anchor point on bodyA in world coordinates.
|
void |
getAnchorB(Vec2 argOut)
get the anchor point on bodyB in world coordinates.
|
float |
getJointSpeed()
Get the current joint translation, usually in meters.
|
float |
getJointTranslation() |
Vec2 |
getLocalAnchorA() |
Vec2 |
getLocalAnchorB() |
Vec2 |
getLocalAxisA() |
float |
getLowerLimit()
Get the lower joint limit, usually in meters.
|
float |
getMaxMotorForce() |
float |
getMotorForce(float inv_dt)
Get the current motor force, usually in N.
|
float |
getMotorSpeed()
Get the motor speed, usually in meters per second.
|
void |
getReactionForce(float inv_dt,
Vec2 argOut)
get the reaction force on body2 at the joint anchor in Newtons.
|
float |
getReactionTorque(float inv_dt)
get the reaction torque on body2 in N*m.
|
float |
getReferenceAngle() |
float |
getUpperLimit()
Get the upper joint limit, usually in meters.
|
void |
initVelocityConstraints(SolverData data) |
boolean |
isLimitEnabled()
Is the joint limit enabled?
|
boolean |
isMotorEnabled()
Is the joint motor enabled?
|
void |
setLimits(float lower,
float upper)
Set the joint limits, usually in meters.
|
void |
setMaxMotorForce(float force)
Set the maximum motor force, usually in N.
|
void |
setMotorSpeed(float speed)
Set the motor speed, usually in meters per second.
|
boolean |
solvePositionConstraints(SolverData data)
This returns true if the position errors are within tolerance.
|
void |
solveVelocityConstraints(SolverData data) |
create, destroy, destructor, getBodyA, getBodyB, getCollideConnected, getNext, getType, getUserData, isActive, setUserData
protected final Vec2 m_localAnchorA
protected final Vec2 m_localAnchorB
protected final Vec2 m_localXAxisA
protected final Vec2 m_localYAxisA
protected float m_referenceAngle
protected PrismaticJoint(IWorldPool argWorld, PrismaticJointDef def)
public Vec2 getLocalAnchorA()
public Vec2 getLocalAnchorB()
public void getAnchorA(Vec2 argOut)
Joint
getAnchorA
in class Joint
public void getAnchorB(Vec2 argOut)
Joint
getAnchorB
in class Joint
public void getReactionForce(float inv_dt, Vec2 argOut)
Joint
getReactionForce
in class Joint
public float getReactionTorque(float inv_dt)
Joint
getReactionTorque
in class Joint
public float getJointSpeed()
public float getJointTranslation()
public boolean isLimitEnabled()
public void enableLimit(boolean flag)
flag
- public float getLowerLimit()
public float getUpperLimit()
public void setLimits(float lower, float upper)
lower
- upper
- public boolean isMotorEnabled()
public void enableMotor(boolean flag)
flag
- public void setMotorSpeed(float speed)
speed
- public float getMotorSpeed()
public void setMaxMotorForce(float force)
force
- public float getMotorForce(float inv_dt)
inv_dt
- public float getMaxMotorForce()
public float getReferenceAngle()
public Vec2 getLocalAxisA()
public void initVelocityConstraints(SolverData data)
initVelocityConstraints
in class Joint
public void solveVelocityConstraints(SolverData data)
solveVelocityConstraints
in class Joint
public boolean solvePositionConstraints(SolverData data)
Joint
solvePositionConstraints
in class Joint
Copyright © 2017. All Rights Reserved.