Rev | Line | |
---|
[2764] | 1 | #ifndef _SCENEQUERY_H__
|
---|
| 2 | #define _SCENEQUERY_H__
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
| 5 | #include "AxisAlignedBox3.h"
|
---|
| 6 |
|
---|
[2800] | 7 |
|
---|
[2776] | 8 | namespace CHCDemoEngine
|
---|
[2764] | 9 | {
|
---|
| 10 |
|
---|
[2778] | 11 | class RenderTraverser;
|
---|
| 12 |
|
---|
[2764] | 13 | /** A simple class that computes the first intersection of a horizontal ray with
|
---|
| 14 | the scene. Can be used to "drop" objects in the scene.
|
---|
| 15 | */
|
---|
| 16 | class SceneQuery
|
---|
| 17 | {
|
---|
| 18 | public:
|
---|
| 19 |
|
---|
[2778] | 20 | SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *traverser);
|
---|
[2843] | 21 |
|
---|
[2796] | 22 | ~SceneQuery() { DEL_ARRAY_PTR(mDepth); }
|
---|
[2806] | 23 | /** Calculates intersection of vertical ray at position pt.x, pt.y and
|
---|
| 24 | stores the intersection point if valid. returns true if the intersection
|
---|
| 25 | is valid.
|
---|
| 26 | */
|
---|
[2764] | 27 | bool CalcIntersection(Vector3 &pt);
|
---|
| 28 |
|
---|
[2806] | 29 |
|
---|
[2764] | 30 | protected:
|
---|
| 31 |
|
---|
[2778] | 32 | void Prepare(RenderTraverser *traverser);
|
---|
[2764] | 33 |
|
---|
| 34 | ///////////
|
---|
| 35 |
|
---|
| 36 | AxisAlignedBox3 mSceneBox;
|
---|
[2796] | 37 |
|
---|
[2808] | 38 | //unsigned char *mDepth;
|
---|
| 39 | float *mDepth;
|
---|
[2764] | 40 | };
|
---|
| 41 |
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.