|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfisica.FJoint
public abstract class FJoint
Represents a joint between two or more bodies. A joint establishes some kind of relation between two or more bodies. Depending on the specific joint the relation might be a distance relation, a rotation relation or even a volume conservation relation. This class cannot be be instantiated, instead use one of the derived classes.
| Constructor Summary | |
|---|---|
FJoint()
|
|
| Method Summary | |
|---|---|
void |
addToWorld(FWorld world)
|
void |
attachImage(processing.core.PImage img)
Attach an image to the object. |
void |
dettachImage()
Dettach any image that has been attached to the object. |
void |
draw(processing.core.PApplet applet)
|
void |
draw(processing.core.PGraphics applet)
This method is called when calling world.draw(). |
FBody |
getBody1()
Returns the first body attached to this joint. |
FBody |
getBody2()
Returns the second body attached to this joint. |
int |
getFillColor()
Returns the fill color of the object. |
float |
getImageAlpha()
Get the opacity with which to draw the attached image. |
float |
getReactionForceX(float invDt)
Returns the horizontal component of the reaction force on the second body at the joint anchor. |
float |
getReactionForceY(float invDt)
Returns the vertical component of the reaction force on the second body at the joint anchor. |
float |
getReactionTorque(float invDt)
Returns the reaction torque on the second body at the joint anchor. |
boolean |
isDrawable()
Get whether the object must be drawn or not. |
void |
removeFromWorld()
|
void |
setCollideConnected(boolean value)
Sets whether the bodies connected by the joint should collide with each other. |
void |
setDrawable(boolean drawable)
Set whether the object must be drawn or not. |
void |
setFill(float g)
Set the fill color of the object. |
void |
setFill(float g,
float a)
Set the fill color of the object. |
void |
setFill(float r,
float g,
float b)
Set the fill color of the object. |
void |
setFill(float r,
float g,
float b,
float a)
Set the fill color of the object. |
void |
setFillColor(int col)
Set the fill color of the object. |
void |
setImageAlpha(float alpha)
Set the opacity with which to draw the attached image. |
void |
setNoFill()
Set that the object must be drawn without fill. |
void |
setNoStroke()
Set that the object must be drawn without stroke. |
void |
setStroke(float g)
Set the stroke color of the object. |
void |
setStroke(float g,
float a)
Set the stroke color of the object. |
void |
setStroke(float r,
float g,
float b)
Set the stroke color of the object. |
void |
setStroke(float r,
float g,
float b,
float a)
Set the stroke color of the object. |
void |
setStrokeColor(int col)
Set the stroke color of the object. |
void |
setStrokeWeight(float weight)
Set the stroke weight of the object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FJoint()
| Method Detail |
|---|
public void addToWorld(FWorld world)
public void removeFromWorld()
public FBody getBody1()
public FBody getBody2()
public void setCollideConnected(boolean value)
value - if true the bodies connected by this joint will be allowed to collide with each otherpublic float getReactionForceX(float invDt)
public float getReactionForceY(float invDt)
public float getReactionTorque(float invDt)
public void draw(processing.core.PGraphics applet)
world.draw().
This method may be overriden to allow custom drawing of the object.
applet - the applet onto which the object must be drawn.public void draw(processing.core.PApplet applet)
public void attachImage(processing.core.PImage img)
draw(PApplet) method.
img - the PImage to attach to the object.public void dettachImage()
attachImage(PImage)public float getImageAlpha()
attachImage(PImage),
setImageAlpha(float)public void setImageAlpha(float alpha)
alpha - the opacity, a value from 0.0 to 1.0 with which to draw the attached imageattachImage(PImage),
getImageAlpha()public void setDrawable(boolean drawable)
drawable - if true the object will be drawn, else it will notisDrawable()public boolean isDrawable()
true the object will be drawn, else it will notsetDrawable(boolean)public int getFillColor()
myBody.setFillColor(color(20,100,30,90));setNoFill(),
setFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)public void setFillColor(int col)
setFill(float), setFill(float,float), setFill(float,float,float) or setFill(float,float,float,float)
col - a Processing color type. e.g. myBody.setFillColor(color(20,100,30,90));setNoFill(),
setFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)public void setNoFill()
setFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)public void setFill(float g)
g - gray valuesetFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)
public void setFill(float g,
float a)
g - gray valuea - alpha (opacity) valuesetFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)
public void setFill(float r,
float g,
float b)
r - red valueg - green valueb - blue valuesetFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)
public void setFill(float r,
float g,
float b,
float a)
r - red valueg - green valueb - blue valuea - alpha (opacity) valuesetFill(float),
setFill(float,float),
setFill(float,float,float),
setFill(float,float,float,float)public void setStrokeColor(int col)
setStroke(float), setStroke(float,float), setStroke(float,float,float) or setStroke(float,float,float,float)
col - a Processing color type. e.g. myBody.setStrokeColor(color(20,100,30,90));setNoStroke(),
setStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)public void setNoStroke()
setStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)public void setStroke(float g)
g - gray valuesetStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)
public void setStroke(float g,
float a)
g - gray valuea - alpha (opacity) valuesetStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)
public void setStroke(float r,
float g,
float b)
r - red valueg - green valueb - blue valuesetStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)
public void setStroke(float r,
float g,
float b,
float a)
r - red valueg - green valueb - blue valuea - alpha (opacity) valuesetStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)public void setStrokeWeight(float weight)
weight - weight value in pixelssetStroke(float),
setStroke(float,float),
setStroke(float,float,float),
setStroke(float,float,float,float)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||