hAPI Fisica
0.1
The hAPI Fisica physics engine expands Richard Marxer's fisica for Processing. The engine wraps the jbox2d physics engine for use with the Haply Development kit and the Hapkit.
|
Public Member Functions | |
void | draw (PGraphics graphics) |
void | draw (PApplet applet) |
void | drawDebug (PGraphics graphics) |
void | drawDebug (PApplet applet) |
void | attachImage (PImage img) |
void | dettachImage () |
float | getImageAlpha () |
void | setImageAlpha (float alpha) |
void | setDrawable (boolean drawable) |
boolean | isDrawable () |
int | getFillColor () |
void | setFillColor (int col) |
void | setNoFill () |
void | setFill (float g) |
void | setFill (float g, float a) |
void | setFill (float r, float g, float b) |
void | setFill (float r, float g, float b, float a) |
void | setStrokeColor (int col) |
void | setNoStroke () |
void | setStroke (float g) |
void | setStroke (float g, float a) |
void | setStroke (float r, float g, float b) |
void | setStroke (float r, float g, float b, float a) |
void | setStrokeWeight (float weight) |
Protected Member Functions | |
void | updateStyle (FDrawable other) |
void | appletStroke (PGraphics applet, int argb) |
void | appletFill (PGraphics applet, int argb) |
void | appletFillStroke (PGraphics applet) |
void | drawImage (PGraphics applet) |
This is a class from which all drawable objects of a world inherit.
It contains most helping methods that handles stroke and fill colors and styles, as well as image attachments, etc.
void FDrawable.attachImage | ( | PImage | img | ) |
Attach an image to the object. This method allows to draw an image onto the screen instead of calling the draw(PApplet) method.
img | the PImage to attach to the object. |
void FDrawable.dettachImage | ( | ) |
Dettach any image that has been attached to the object.
void FDrawable.draw | ( | PGraphics | graphics | ) |
This method is called when calling
. This method may be overriden to allow custom drawing of the object.
graphics | the graphics onto which the object must be drawn. |
void FDrawable.draw | ( | PApplet | applet | ) |
This method is called when calling
. This method may be overriden to allow custom drawing of the object.
applet | the applet onto which the object must be drawn. |
void FDrawable.drawDebug | ( | PGraphics | graphics | ) |
This method is called when calling
. This method may be overriden to allow custom debug drawing of the object.
graphics | the graphics onto which the object must be drawn. |
void FDrawable.drawDebug | ( | PApplet | applet | ) |
This method is called when calling
. This method may be overriden to allow custom debug drawing of the object.
applet | the applet onto which the object must be drawn. |
int FDrawable.getFillColor | ( | ) |
Returns the fill color of the object.
float FDrawable.getImageAlpha | ( | ) |
Get the opacity with which to draw the attached image.
boolean FDrawable.isDrawable | ( | ) |
Get whether the object must be drawn or not.
void FDrawable.setDrawable | ( | boolean | drawable | ) |
Set whether the object must be drawn or not.
drawable | if true |
void FDrawable.setFill | ( | float | g | ) |
Set the fill color of the object.
g | gray value |
void FDrawable.setFill | ( | float | g, |
float | a | ||
) |
Set the fill color of the object.
g | gray value |
a | alpha (opacity) value |
void FDrawable.setFill | ( | float | r, |
float | g, | ||
float | b | ||
) |
Set the fill color of the object.
r | red value |
g | green value |
b | blue value |
void FDrawable.setFill | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Set the fill color of the object.
r | red value |
g | green value |
b | blue value |
a | alpha (opacity) value |
void FDrawable.setFillColor | ( | int | col | ) |
Set the fill color of the object. This method must be used in conjunction with Processing's color(). In most cases users will find it more convenient to use the versions of 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)); |
void FDrawable.setImageAlpha | ( | float | alpha | ) |
Set the opacity with which to draw the attached image.
alpha | the opacity, a value from 0.0 to 1.0 with which to draw the attached image |
void FDrawable.setNoFill | ( | ) |
Set that the object must be drawn without fill.
void FDrawable.setNoStroke | ( | ) |
Set that the object must be drawn without stroke.
void FDrawable.setStroke | ( | float | g | ) |
Set the stroke color of the object.
g | gray value |
void FDrawable.setStroke | ( | float | g, |
float | a | ||
) |
Set the stroke color of the object.
g | gray value |
a | alpha (opacity) value |
void FDrawable.setStroke | ( | float | r, |
float | g, | ||
float | b | ||
) |
Set the stroke color of the object.
r | red value |
g | green value |
b | blue value |
void FDrawable.setStroke | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Set the stroke color of the object.
r | red value |
g | green value |
b | blue value |
a | alpha (opacity) value |
void FDrawable.setStrokeColor | ( | int | col | ) |
Set the stroke color of the object. This method must be used in conjunction with Processing's color(). In most cases users will find it more convenient to use the versions of 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)); |
void FDrawable.setStrokeWeight | ( | float | weight | ) |
Set the stroke weight of the object.
weight | weight value in simulation world units |