The IrSensorRayCastCallback class implements the callback class used by Box2D to report results of raycasting. More...
#include <irsensor.h>
Public Member Functions | |
IrSensorRayCastCallback () | |
float32 | ReportFixture (b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction) |
void | reset () |
reset the fraction and object hit. More... | |
float | fraction () const |
b2Body * | objectHit () const |
Private Attributes | |
float | _fraction |
b2Body * | _object |
The IrSensorRayCastCallback class implements the callback class used by Box2D to report results of raycasting.
This enables the use of the more efficient b2World.RayCast method over the less efficient b2Fixture.RayCast method.
|
inline |
float IrSensorRayCastCallback::fraction | ( | ) | const |
References _fraction.
Referenced by ReportFixture(), and ChirpIrSensor::update().
b2Body * IrSensorRayCastCallback::objectHit | ( | ) | const |
References _object.
Referenced by ChirpIrSensor::objectHit().
float32 IrSensorRayCastCallback::ReportFixture | ( | b2Fixture * | fixture, |
const b2Vec2 & | point, | ||
const b2Vec2 & | normal, | ||
float32 | fraction | ||
) |
void IrSensorRayCastCallback::reset | ( | ) |
reset the fraction and object hit.
References _fraction.
Referenced by ChirpIrSensor::update().
|
private |
Referenced by fraction(), ReportFixture(), and reset().
|
private |
Referenced by objectHit(), and ReportFixture().