public class FRaycastResult extends Object
FWorld world;
void setup() {
Fisica.init(this);
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);
}
FContact| Modifier and Type | Field and Description |
|---|---|
protected float |
m_lambda |
protected org.jbox2d.common.Vec2 |
m_normal |
protected float |
m_x1 |
protected float |
m_x2 |
protected float |
m_y1 |
protected float |
m_y2 |
| Constructor and Description |
|---|
FRaycastResult() |
| Modifier and Type | Method and Description |
|---|---|
float |
getLambda()
Returns the lambda of the raycast result.
|
float |
getNormalX()
Returns the horizontal component of the ray cast contact normal.
|
float |
getNormalY()
Returns the vertical component of the ray cast contact normal.
|
float |
getX()
Returns the horizontal component of the ray cast contact normal.
|
float |
getY()
Returns the vertical component of the contact ray cast normal.
|
protected FRaycastResult |
set(float x1,
float y1,
float x2,
float y2,
org.jbox2d.common.RaycastResult raycastResult) |
protected float m_lambda
protected org.jbox2d.common.Vec2 m_normal
protected float m_x1
protected float m_x2
protected float m_y1
protected float m_y2
protected FRaycastResult set(float x1, float y1, float x2, float y2, org.jbox2d.common.RaycastResult raycastResult)
public float getLambda()
public float getNormalX()
getNormalY()public float getNormalY()
getNormalX()public float getX()
getY(),
getNormalX(),
getNormalY()public float getY()
getX(),
getNormalX(),
getNormalY()