LightsprintSDK 2021.08.08
|
#include <RRCollider.h>
Public Member Functions | |
virtual | ~RRCollisionHandler () |
virtual void | init (class RRRay &ray)=0 |
virtual bool | collides (const class RRRay &ray)=0 |
virtual bool | done ()=0 |
Interface for non-trivial handling of collisions in collision test.
You can use it to
It's intentionally not part of RRMesh, so you can easily combine different collision handlers with one geometry.
It's intentionally not part of RRRay, so you can easily combine different collision handlers at runtime.
Thread safe: no, holds state, may be accessed by one thread at moment.
|
inlinevirtual |
|
pure virtual |
Prepares for single intersection test.
Is called at the beginning of RRCollider::intersect(). May set additional flags in ray.
|
pure virtual |
Handles each collision detected by single intersection test.
It is called at each triangle hit inside RRCollider::intersect(). When its result is false, collision is rejected and testing continues. When its result is true, collision is accepted, but it does not necessarily end testing, as collider can find closer itersection after testing more distant one first. In general case, intersections are reported unordered. Intersections are reported in order from the nearest one (and first positive result ends testing) only for IT_BSP techniques.
|
pure virtual |
Cleans up after single intersection test.
Is called at the end of RRCollider::intersect(). Result is returned as result from RRCollider::intersect().