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.
|
Classes | |
class | FViewport |
class | LibraryNotInitializedException |
Static Public Member Functions | |
static Vec2 | screenToWorld (Vec2 m_in) |
static Vec2 | screenToWorld (float x, float y) |
static float | screenToWorld (float a) |
static Vec2 | worldToScreen (Vec2 m_in) |
static Vec2 | worldToScreen (float x, float y) |
static float | worldToScreen (float a) |
static PApplet | parent () |
static void | init (PApplet applet) |
static void | setScale (float scale) |
Static Protected Member Functions | |
static boolean | initialized () |
The hAPI_Fisica library maps between the graphic world (pixels) created in in the PApplet object to the simulation world cm. The simulation world is in CGS (centimeter, gram, seconds). Represents the library hAPI_Fisica. It is mainly used to initialize it with the PApplet:
It also allows to modify global properties of the simulation such as the scale of meters to pixels:
hAPI_Fisica.setScale(40);
In the future it may contain helping methods to create the objects.
|
static |
Initialize the library. Must be called before any use of the library. Must be called by passing the PApplet. e.g.
applet | The applet on which to use the library. This library can only be used with one applet |
|
static |
Set the scale from screen units to world units. By setting the scale to 20 we are stating that 20 pixels is equivalent to 1 meter in the simulated world.
scale | the number of pixels that are equivalent to 1 meter in the simulated world. |