public class FPrismaticJoint extends FJoint
| Modifier and Type | Field and Description |
|---|---|
protected org.jbox2d.common.Vec2 |
m_anchor |
protected org.jbox2d.common.Vec2 |
m_axis |
protected FBody |
m_body1 |
protected FBody |
m_body2 |
protected boolean |
m_enableLimit
A flag to enable joint limits.
|
protected boolean |
m_enableMotor
A flag to enable the joint motor.
|
protected float |
m_force |
protected float |
m_limitForce |
protected float |
m_limitPositionImpulse |
protected org.jbox2d.common.Vec2 |
m_localAnchor1
The local anchor point relative to body1's origin.
|
protected org.jbox2d.common.Vec2 |
m_localAnchor2
The local anchor point relative to body2's origin.
|
protected org.jbox2d.common.Vec2 |
m_localAxis1 |
protected float |
m_lowerTranslation
The lower translation for the joint limit (world coords).
|
protected float |
m_maxMotorForce |
protected float |
m_maxMotorTorque
The maximum motor torque used to achieve the desired motor speed.
|
protected float |
m_motorForce |
protected float |
m_motorSpeed
The desired motor speed.
|
protected float |
m_referenceAngle
The body2 angle minus body1 angle in the reference state (radians).
|
protected float |
m_torque |
protected float |
m_upperTranslation
The upper translation for the joint limit (world coords).
|
m_collideConnected, m_joint, m_worldm_drawable, m_fill, m_fillColor, m_image, m_imageAlpha, m_mask, m_stroke, m_strokeColor, m_strokeWeight| Constructor and Description |
|---|
FPrismaticJoint(FBody body1,
FBody body2)
Construct a prismatic joint between two bodies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(def.processing.core.PGraphics applet)
This method is called when calling
world.draw(). |
void |
drawDebug(def.processing.core.PGraphics applet)
This method is called when calling
world.drawDebug(). |
float |
getAnchorX()
Get the horizontal coordinate of the anchor of the joint.
|
float |
getAnchorY()
Get the vertical coordinate of the anchor of the joint.
|
protected org.jbox2d.dynamics.joints.JointDef |
getJointDef(FWorld world) |
void |
setAnchor(float x,
float y)
Sets the position of the anchor of the joint.
|
void |
setAxis(float x,
float y)
Sets the axis of movement of the joint.
|
void |
setEnableLimit(boolean value)
Set limits to the allowed translation of one body respect to the other.
|
void |
setLowerTranslation(float translation)
Set the lowest translation allowed.
|
void |
setUpperTranslation(float translation)
Set the highest translation allowed.
|
protected void |
updateLocalAnchors() |
protected void |
updateLocalAxis() |
addToWorld, getBody1, getBody2, getBox2dJoint, getReactionForceX, getReactionForceY, getReactionTorque, postDraw, postDrawDebug, preDraw, preDrawDebug, processJoint, removeFromWorld, setCollideConnectedappletFill, appletFillStroke, appletStroke, attachImage, dettachImage, drawImage, getFillColor, getImageAlpha, isDrawable, setDrawable, setFill, setFill, setFill, setFill, setFillColor, setImageAlpha, setNoFill, setNoStroke, setStroke, setStroke, setStroke, setStroke, setStrokeColor, setStrokeWeight, updateStyleprotected FBody m_body1
protected FBody m_body2
protected org.jbox2d.common.Vec2 m_anchor
protected org.jbox2d.common.Vec2 m_axis
protected org.jbox2d.common.Vec2 m_localAxis1
protected float m_force
protected float m_torque
protected float m_motorForce
protected float m_limitForce
protected float m_limitPositionImpulse
protected float m_maxMotorForce
protected org.jbox2d.common.Vec2 m_localAnchor1
protected org.jbox2d.common.Vec2 m_localAnchor2
protected float m_referenceAngle
protected boolean m_enableLimit
protected float m_lowerTranslation
protected float m_upperTranslation
protected boolean m_enableMotor
protected float m_motorSpeed
protected float m_maxMotorTorque
protected void updateLocalAnchors()
protected void updateLocalAxis()
protected org.jbox2d.dynamics.joints.JointDef getJointDef(FWorld world)
getJointDef in class FJointpublic void setAxis(float x,
float y)
x - the horizontal component of the axis in global coordinates, relative to the center of the canvasy - the vertical coordinate of the axis in global coordinates, relative to the center of the canvaspublic void setAnchor(float x,
float y)
x - the horizontal coordinate of the anchor in global coordinates, relative to the center of the canvasy - the vertical coordinate of the anchor in global coordinates, relative to the center of the canvaspublic float getAnchorX()
public float getAnchorY()
public void setLowerTranslation(float translation)
enableLimit has been set to true using setEnableLimit(boolean).translation - lowest translation position in pixelspublic void setUpperTranslation(float translation)
enableLimit has been set to true using setEnableLimit(boolean).translation - highest translation position in pixelspublic void setEnableLimit(boolean value)
true the limits imposed using setLowerTranslation and setLowerTranslation are enforced.value - if true the bodies will be able to translate along the axis only between certain limitspublic void draw(def.processing.core.PGraphics applet)
FDrawableworld.draw().
This method may be overriden to allow custom drawing of the object.public void drawDebug(def.processing.core.PGraphics applet)
FDrawableworld.drawDebug().
This method may be overriden to allow custom debug drawing of the object.