public class FPrismaticJoint extends FJoint
Constructor and Description |
---|
FPrismaticJoint(FBody body1,
FBody body2)
Construct a prismatic joint between two bodies.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(processing.core.PGraphics applet)
This method is called when calling
world.draw() . |
void |
drawDebug(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.
|
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.
|
addToWorld, getBody1, getBody2, getBox2dJoint, getReactionForceX, getReactionForceY, getReactionTorque, removeFromWorld, setCollideConnected
attachImage, dettachImage, draw, drawDebug, getFillColor, getImageAlpha, isDrawable, setDrawable, setFill, setFill, setFill, setFill, setFillColor, setImageAlpha, setNoFill, setNoStroke, setStroke, setStroke, setStroke, setStroke, setStrokeColor, setStrokeWeight
public 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(processing.core.PGraphics applet)
FDrawable
world.draw()
.
This method may be overriden to allow custom drawing of the object.public void drawDebug(processing.core.PGraphics applet)
FDrawable
world.drawDebug()
.
This method may be overriden to allow custom debug drawing of the object.processing library fisica by Ricard Marxer. (c) 2009-2014