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 | Static Public Member Functions | Static Protected Member Functions | List of all members
hAPI_Fisica Class Reference
Inheritance diagram for hAPI_Fisica:

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 ()
 

Detailed Description

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:

 
 

In the future it may contain helping methods to create the objects.

Member Function Documentation

◆ init()

static void hAPI_Fisica.init ( PApplet  applet)
static

Initialize the library. Must be called before any use of the library. Must be called by passing the PApplet. e.g.

Parameters
appletThe applet on which to use the library. This library can only be used with one applet

◆ setScale()

static void hAPI_Fisica.setScale ( float  scale)
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.

Parameters
scalethe number of pixels that are equivalent to 1 meter in the simulated world.

The documentation for this class was generated from the following file: