|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfisica.FDrawable
fisica.FJoint
fisica.FPrismaticJoint
public class FPrismaticJoint
Represents a prismatic joint that restricts the movement of one body with respect to another to a translation along a given axis. Often this joint is used with one of the bodies being static in order to only allow translation of the other body along a given axis. This translation can also be bounded given lower and upper translation limits.
Constructor Summary | |
---|---|
FPrismaticJoint(FBody body1,
FBody body2)
Construct a prismatic joint between two bodies. |
Method Summary | |
---|---|
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. |
Methods inherited from class fisica.FJoint |
---|
addToWorld, getBody1, getBody2, getBox2dJoint, getReactionForceX, getReactionForceY, getReactionTorque, removeFromWorld, setCollideConnected |
Methods inherited from class fisica.FDrawable |
---|
attachImage, dettachImage, draw, drawDebug, getFillColor, getImageAlpha, isDrawable, setDrawable, setFill, setFill, setFill, setFill, setFillColor, setImageAlpha, setNoFill, setNoStroke, setStroke, setStroke, setStroke, setStroke, setStrokeColor, setStrokeWeight |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FPrismaticJoint(FBody body1, FBody body2)
body1
- first body of the jointbody2
- second body of the jointMethod Detail |
---|
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.
draw
in class FDrawable
applet
- the graphics onto which the object must be drawn.public void drawDebug(processing.core.PGraphics applet)
FDrawable
world.drawDebug()
.
This method may be overriden to allow custom debug drawing of the object.
drawDebug
in class FDrawable
applet
- the graphics onto which the object must be drawn.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |