public class FMouseJoint extends FJoint
setTarget(float, float)
.Constructor and Description |
---|
FMouseJoint(FBody body,
float x,
float y)
Construct a mouse joint between a body and a target.
|
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 point on the body.
|
float |
getAnchorY()
Get the vertical coordinate of the anchor point on the body.
|
FBody |
getGrabbedBody()
Returns the body grabbed by this joint.
|
float |
getTargetX()
Returns the horizontal target position of the joint.
|
float |
getTargetY()
Returns the vertical target position of the joint.
|
void |
releaseGrabbedBody()
Releases the body grabbed by this joint.
|
void |
setAnchor(float x,
float y)
Sets the anchor position at which the joint grabs the body.
|
void |
setDamping(float damping)
Sets the damping of the spring used to maintain the body and the target together.
|
void |
setFrequency(float frequency)
Sets the frequency of the spring used to maintain the body and the target together.
|
void |
setGrabbedBodyAndTarget(FBody body,
float x,
float y)
Sets the body grabbed by this joint and the target position.
|
void |
setTarget(float x,
float y)
Sets the target position of the joint.
|
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 FMouseJoint(FBody body, float x, float y)
body
- the body to be grabbed by the jointx
- horizontal coordinate of the initial target of the jointy
- vertical coordinate of the initial target of the jointpublic void setDamping(float damping)
damping
- the damping of the springpublic void setFrequency(float frequency)
frequency
- the frequency of the springpublic void setTarget(float x, float y)
x
- horizontal coordinate of the target of the jointy
- vertical coordinate of the target of the jointpublic float getTargetX()
public float getTargetY()
public void setGrabbedBodyAndTarget(FBody body, float x, float y)
body
- the body to be grabbed by the jointx
- horizontal coordinate of the target of the jointy
- vertical coordinate of the target of the jointpublic void releaseGrabbedBody()
public FBody getGrabbedBody()
public void setAnchor(float x, float y)
x
- the horizontal coordinate of the anchor relative to the center of the bodyy
- the vertical coordinate of the anchor relative to the center of the bodypublic float getAnchorX()
public float getAnchorY()
public 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