LiquidFun
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
b2RayCastCallback Class Referenceabstract

#include <b2WorldCallbacks.h>

Public Member Functions

virtual float32 ReportFixture (b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction)=0
 
virtual float32 ReportParticle (const b2ParticleSystem *particleSystem, int32 index, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction)
 
virtual bool ShouldQueryParticleSystem (const b2ParticleSystem *particleSystem)
 

Detailed Description

Callback class for ray casts. See b2World::RayCast

Member Function Documentation

virtual float32 b2RayCastCallback::ReportFixture ( b2Fixture fixture,
const b2Vec2 point,
const b2Vec2 normal,
float32  fraction 
)
pure virtual

Called for each fixture found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue

Parameters
fixturethe fixture hit by the ray
pointthe point of initial intersection
normalthe normal vector at the point of intersection
Returns
-1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue
virtual float32 b2RayCastCallback::ReportParticle ( const b2ParticleSystem particleSystem,
int32  index,
const b2Vec2 point,
const b2Vec2 normal,
float32  fraction 
)
inlinevirtual

Called for each particle found in the query. You control how the ray cast proceeds by returning a float: return <=0: ignore the remaining particles in this particle system return fraction: ignore particles that are 'fraction' percent farther along the line from 'point1' to 'point2'. Note that 'point1' and 'point2' are parameters to b2World::RayCast.

Parameters
particleSystemthe particle system containing the particle
indexthe index of the particle in particleSystem
pointthe point of intersection bt the ray and the particle
normalthe normal vector at the point of intersection
fractionpercent (0.0~1.0) from 'point0' to 'point1' along the ray. Note that 'point1' and 'point2' are parameters to b2World::RayCast.
Returns
<=0 to ignore rest of particle system, fraction to ignore particles that are farther away.
virtual bool b2RayCastCallback::ShouldQueryParticleSystem ( const b2ParticleSystem particleSystem)
inlinevirtual

Cull an entire particle system from b2World::RayCast. Ignored in b2ParticleSystem::RayCast.

Returns
true if you want to include particleSystem in the RayCast, or false to cull particleSystem from the RayCast.

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