source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.h @ 2843

Revision 2843, 844 bytes checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef _SCENEQUERY_H__
2#define _SCENEQUERY_H__
3
4#include "common.h"
5#include "AxisAlignedBox3.h"
6
7
8namespace CHCDemoEngine
9{
10
11class RenderTraverser;
12
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*/
16class SceneQuery
17{
18public:
19
20        SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *traverser);
21
22        ~SceneQuery() { DEL_ARRAY_PTR(mDepth); }
23
24        /** Calculates intersection of vertical ray at position pt.x, pt.y and
25            stores the intersection point if valid. returns true if the intersection
26                is valid.
27        */
28        bool CalcIntersection(Vector3 &pt);
29
30
31protected:
32
33        void Prepare(RenderTraverser *traverser);
34
35        ///////////
36
37        AxisAlignedBox3 mSceneBox;
38
39        //unsigned char *mDepth;
40        float *mDepth;
41};
42
43}
44
45#endif
Note: See TracBrowser for help on using the repository browser.