Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
b2RayCastCallback Class Referenceabstract

`#include <b2WorldCallbacks.h>`

Inheritance diagram for b2RayCastCallback:

## Public Member Functions
virtual | ~b2RayCastCallback ()
virtual float32 | ReportFixture (b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction)=0

## Detailed Description

Callback class for ray casts. See b2World::RayCast

## Constructor & Destructor Documentation

virtual ~b2RayCastCallback | ( |  | ) |
| inline virtual

## Member Function Documentation

virtual float32 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

  fixture | the fixture hit by the ray
  point | the point of initial intersection
  normal | the 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

Implemented in WorldQuery, and SpriteBatchQuery.

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

- Box2D/Dynamics/b2WorldCallbacks.h