Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Public Member Functions | Friends | List of all members
Engine::RayCastClosestCallback Class Reference

Gets the first entity hit by the ray Callback class used to get collision data from ray queries More...

#include <RaycastCallback.hpp>

Inheritance diagram for Engine::RayCastClosestCallback:

Public Member Functions

 RayCastClosestCallback ()
 
 RayCastClosestCallback (const CollisionLayer detectLayers)
 
float32 ReportFixture (b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float32 fraction) override
 Function used by Box2D to tell the Callback class that the ray has collided with a fixture. Box2D Comments: By returning the current fraction, we instruct the calling code to clip the ray and continue the ray-cast to the next fixture. WARNING: do not assume that fixtures are reported in order. However, by clipping, we can always get the closest fixture. More...
 

Friends

class CollisionSystem
 

Detailed Description

Gets the first entity hit by the ray Callback class used to get collision data from ray queries

Definition at line 16 of file RaycastCallback.hpp.

Constructor & Destructor Documentation

Engine::RayCastClosestCallback::RayCastClosestCallback ( )

Definition at line 6 of file RaycastCallback.cpp.

Engine::RayCastClosestCallback::RayCastClosestCallback ( const CollisionLayer  detectLayers)

Definition at line 10 of file RaycastCallback.cpp.

Member Function Documentation

float32 Engine::RayCastClosestCallback::ReportFixture ( b2Fixture *  fixture,
const b2Vec2 &  point,
const b2Vec2 &  normal,
float32  fraction 
)
override

Function used by Box2D to tell the Callback class that the ray has collided with a fixture. Box2D Comments: By returning the current fraction, we instruct the calling code to clip the ray and continue the ray-cast to the next fixture. WARNING: do not assume that fixtures are reported in order. However, by clipping, we can always get the closest fixture.

Parameters
fixtureThe fixture the ray intersected with
pointThe point the ray intersected with the fixture
normalThe normal of the surface the ray intersected with
fraction???Investigate Box2D for this???
Returns
Number determines the query behaviour of the ray, 1 continue, 0 stop and return fraction parameter to get the closest

Definition at line 14 of file RaycastCallback.cpp.

Friends And Related Function Documentation

friend class CollisionSystem
friend

Definition at line 18 of file RaycastCallback.hpp.


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