fisica
Class FJoint

java.lang.Object
  extended by fisica.FDrawable
      extended by fisica.FJoint
Direct Known Subclasses:
FConstantVolumeJoint, FDistanceJoint, FGearJoint, FMouseJoint, FPrismaticJoint, FRevoluteJoint

public abstract class FJoint
extends FDrawable

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)
           
 FBody getBody1()
          Returns the first body attached to this joint.
 FBody getBody2()
          Returns the second body attached to this joint.
 org.jbox2d.dynamics.joints.Joint getBox2dJoint()
          WARNING: This method is internal only and may change someday.
 float getReactionForceX()
          Returns the horizontal component of the reaction force on the second body at the joint anchor.
 float getReactionForceY()
          Returns the vertical component of the reaction force on the second body at the joint anchor.
 float getReactionTorque()
          Returns the reaction torque on the second body at the joint anchor.
 void removeFromWorld()
           
 void setCollideConnected(boolean value)
          Sets whether the bodies connected by the joint should collide with each other.
 
Methods inherited from class fisica.FDrawable
attachImage, dettachImage, draw, draw, drawDebug, 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

FJoint

public FJoint()
Method Detail

getBox2dJoint

public org.jbox2d.dynamics.joints.Joint getBox2dJoint()
WARNING: This method is internal only and may change someday. If you are using this method please contact the developer since there should be a better way or we may add something to the library.

Returns:
the internal JBox2D joint

addToWorld

public void addToWorld(FWorld world)

removeFromWorld

public void removeFromWorld()

getBody1

public FBody getBody1()
Returns the first body attached to this joint.

Returns:
first of the bodies connected by this joint

getBody2

public FBody getBody2()
Returns the second body attached to this joint.

Returns:
second of the bodies connected by this joint

setCollideConnected

public void setCollideConnected(boolean value)
Sets whether the bodies connected by the joint should collide with each other.

Parameters:
value - if true the bodies connected by this joint will be allowed to collide with each other

getReactionForceX

public float getReactionForceX()
Returns the horizontal component of the reaction force on the second body at the joint anchor.

Returns:
horizontal component of the reaction force

getReactionForceY

public float getReactionForceY()
Returns the vertical component of the reaction force on the second body at the joint anchor.

Returns:
vertical component of the reaction force

getReactionTorque

public float getReactionTorque()
Returns the reaction torque on the second body at the joint anchor.

Returns:
reaction torque


processing library fisica by Ricard Marxer. (c) 2009-2013