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 | Protected Member Functions | Protected Attributes | List of all members
FRaycastResult Class Reference

Public Member Functions

float getLambda ()
 
float getNormalX ()
 
float getNormalY ()
 
float getX ()
 
float getY ()
 

Protected Member Functions

FRaycastResult set (float x1, float y1, float x2, float y2, RaycastResult raycastResult)
 

Protected Attributes

float m_lambda = 0.0f
 
Vec2 m_normal = new Vec2()
 
float m_x1
 

Detailed Description

Represents the result of a casted ray.

FWorld world;
void setup() {
world = new FWorld();
world.setEdges();
// Create and add bodies to the world here
// ...
}
void draw() {
world.step();
world.draw();
FRaycastResult result = null;
FBody b = world.raycastOne(width/2, height/2, mouseX, mouseY, result, true);
}

Contacts

See also
FContact

Member Function Documentation

◆ getLambda()

float FRaycastResult.getLambda ( )

Returns the lambda of the raycast result.

Returns
the lambda of the raycast result

◆ getNormalX()

float FRaycastResult.getNormalX ( )

Returns the horizontal component of the ray cast contact normal.

Returns
the horizontal component of the ray cast contact normal
See also
getNormalY

◆ getNormalY()

float FRaycastResult.getNormalY ( )

Returns the vertical component of the ray cast contact normal.

Returns
the vertical component of the ray cast contact normal
See also
getNormalX

◆ getX()

float FRaycastResult.getX ( )

Returns the horizontal component of the ray cast contact normal.

Returns
the horizontal component of the ray cast contact normal
See also
getY
getNormalX
getNormalY

◆ getY()

float FRaycastResult.getY ( )

Returns the vertical component of the contact ray cast normal.

Returns
the vertical component of the contact ray cast normal
See also
getX
getNormalX
getNormalY

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