Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | List of all members
box2d::RayCastFixtureReporter Class Referenceabstract

Callback class for ray casts. See World::RayCast. More...

#include <WorldCallbacks.hpp>

Public Member Functions

virtual ~RayCastFixtureReporter ()
 
virtual RealNum ReportFixture (Fixture *fixture, const Length2D &point, const UnitVec2 &normal, RealNum fraction)=0
 Reports fixture. More...
 

Detailed Description

Callback class for ray casts. See World::RayCast.

Constructor & Destructor Documentation

◆ ~RayCastFixtureReporter()

virtual box2d::RayCastFixtureReporter::~RayCastFixtureReporter ( )
inlinevirtual

Member Function Documentation

◆ ReportFixture()

virtual RealNum box2d::RayCastFixtureReporter::ReportFixture ( Fixture fixture,
const Length2D point,
const UnitVec2 normal,
RealNum  fraction 
)
pure virtual

Reports fixture.

Called for each fixture found in the query. You control how the ray cast proceeds by the return value: 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.
fractionFraction.
Returns
-1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue.

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