#include <Raycast.h>
Public Member Functions | |
PrimitiveTestCache () | |
PrimitiveTestCache (const std::vector< DrawableGeo > &objects) | |
PrimitiveTestCache (const GeometryList &objects) | |
std::vector< unsigned int > & | operator[] (unsigned int i) |
CollisionResult * | getCollisionResult () const |
void | setCollisionResult (CollisionResult *res) |
void | setCurrGeoId (int id) |
int | getCurrGeoId () const |
bool | isInit () const |
void | init (const std::vector< GeoInfo * > &objects) |
void | init (const std::vector< DrawableGeo > &objects) |
void | clear () |
An object of this class needs to be created before calling a ray cast. It is used to mark information about which polygon a given ray has already been collision tested with. In the case where multiple ray casts are being performed, this class should only be created once before all of the ray casts, eg.
PrimitiveTestCache testCache(drawables); for ( i = 0; i < numRays; i++) { // Create and initialise a ray, and then call: sceneGrid.testRayIntersection( param1, param2, testCache); }
Note that no part of the PrimitiveTestCache needs to be reset before the next ray cast. The only requirement is that one PrimitiveTestCache needs to be created per thread.
PrimitiveTestCache::PrimitiveTestCache | ( | ) |
RegularGrid
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |