fisica
Class FBox

java.lang.Object
  extended by fisica.FDrawable
      extended by fisica.FBody
          extended by fisica.FBox

public class FBox
extends FBody

Represents a rectangular body that can be added to a world.

 FBox myBox = new FBox(40, 20);
 world.add(myBox);
 
 

See Also:
FCircle, FBlob, FPoly, FLine

Constructor Summary
FBox(float width, float height)
          Constructs a rectangular body that can be added to a world.
 
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 getHeight()
          Returns the height of the rectangle.
 float getWidth()
          Returns the width of the rectangle.
 void setHeight(float height)
          Sets the height of the rectangle.
 void setWidth(float width)
          Sets the width of the rectangle.
 
Methods inherited from class fisica.FBody
addForce, addForce, addImpulse, addImpulse, addTorque, addToWorld, adjustAngularVelocity, adjustPosition, adjustRotation, adjustVelocity, getAngularVelocity, getBox2dBody, getCategoryBits, getContacts, getDensity, getFilterBits, getForceX, getForceY, getGroupIndex, getJoints, getMass, getName, getParent, getRotation, getTouching, getVelocityX, getVelocityY, getX, getY, isConnected, isResting, isSensor, isSleeping, isStatic, isTouchingBody, recreateInWorld, removeFromWorld, resetForces, setAllowSleeping, setAngularDamping, setAngularVelocity, setBullet, setCategoryBits, setDamping, setDensity, setFilterBits, setForce, setFriction, setGrabbable, setGroupIndex, setName, setParent, setPosition, setRestitution, setRotatable, setRotation, setSensor, setState, setStateFromWorld, setStatic, setStaticBody, setVelocity, wakeUp
 
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

FBox

public FBox(float width,
            float height)
Constructs a rectangular body that can be added to a world.

Parameters:
width - the width of the rectangle
height - the height of the rectangle
Method Detail

getHeight

public float getHeight()
Returns the height of the rectangle.

Returns:
the height of the rectangle
See Also:
getWidth()

getWidth

public float getWidth()
Returns the width of the rectangle.

Returns:
the width of the rectangle
See Also:
getHeight()

setHeight

public void setHeight(float height)
Sets the height of the rectangle. Under the hood the body is removed and readded to the world.

See Also:
getWidth()

setWidth

public void setWidth(float width)
Sets the width of the rectangle. Under the hood the body is removed and readded to the world.

See Also:
getWidth()

draw

public void draw(processing.core.PGraphics applet)
Description copied from class: FDrawable
This method is called when calling world.draw(). This method may be overriden to allow custom drawing of the object.

Overrides:
draw in class FDrawable
Parameters:
applet - the graphics onto which the object must be drawn.

drawDebug

public void drawDebug(processing.core.PGraphics applet)
Description copied from class: FDrawable
This method is called when calling world.drawDebug(). This method may be overriden to allow custom debug drawing of the object.

Overrides:
drawDebug in class FDrawable
Parameters:
applet - the graphics onto which the object must be drawn.


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