ChirpSim
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Private Attributes | List of all members
IrSensorRayCastCallback Class Reference

The IrSensorRayCastCallback class implements the callback class used by Box2D to report results of raycasting. More...

#include <irsensor.h>

Inheritance diagram for IrSensorRayCastCallback:
Inheritance graph

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
 

Detailed Description

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.

Constructor & Destructor Documentation

IrSensorRayCastCallback::IrSensorRayCastCallback ( )
inline

Member Function Documentation

float IrSensorRayCastCallback::fraction ( ) const
Returns
fraction of max distance to the closest object in the ray of the sensor.

References _fraction.

Referenced by ReportFixture(), and ChirpIrSensor::update().

Here is the caller graph for this function:

b2Body * IrSensorRayCastCallback::objectHit ( ) const
Returns
the physical model of the closest object hit by the ray of the sensor.

References _object.

Referenced by ChirpIrSensor::objectHit().

Here is the caller graph for this function:

float32 IrSensorRayCastCallback::ReportFixture ( b2Fixture *  fixture,
const b2Vec2 &  point,
const b2Vec2 &  normal,
float32  fraction 
)

References _fraction, _object, and fraction().

Here is the call graph for this function:

void IrSensorRayCastCallback::reset ( )

reset the fraction and object hit.

References _fraction.

Referenced by ChirpIrSensor::update().

Here is the caller graph for this function:

Member Data Documentation

float IrSensorRayCastCallback::_fraction
private

Referenced by fraction(), ReportFixture(), and reset().

b2Body* IrSensorRayCastCallback::_object
private

Referenced by objectHit(), and ReportFixture().


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