1 | #ifndef __VISUALIZATION_H
|
---|
2 | #define __VISUALIZATION_H
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 |
|
---|
6 |
|
---|
7 | namespace CHCDemoEngine
|
---|
8 | {
|
---|
9 |
|
---|
10 | class Bvh;
|
---|
11 | class PerspectiveCamera;
|
---|
12 | class Camera;
|
---|
13 | class RenderState;
|
---|
14 | class AxisAlignedBox3;
|
---|
15 | class GLUquadric;
|
---|
16 |
|
---|
17 |
|
---|
18 | /** Abstract class implementing a scene traversal for rendering.
|
---|
19 | */
|
---|
20 | class Visualization
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | /** Main constructor taking a bvh, a camera, a visualization camera and the current render state
|
---|
24 | as parameters
|
---|
25 | */
|
---|
26 | Visualization(Bvh *bvh, PerspectiveCamera *camera, Camera *vizCamera, RenderState *state);
|
---|
27 |
|
---|
28 | ~Visualization();
|
---|
29 | /** Renders the visualizatioin
|
---|
30 | */
|
---|
31 | void Render(bool showShadowFrustra);
|
---|
32 | /** Sets the scene hierarchy.
|
---|
33 | */
|
---|
34 | void SetHierarchy(Bvh *bvh);
|
---|
35 | /** Sets the visualization camera.
|
---|
36 | */
|
---|
37 | void SetVizCamera(Camera *cam) { mVizCamera = cam; }
|
---|
38 | /** Sets the currently used scene camera.
|
---|
39 | */
|
---|
40 | void SetCamera(PerspectiveCamera *cam) {mCamera = cam; }
|
---|
41 | /** Sets the current render state
|
---|
42 | */
|
---|
43 | void SetRenderState(RenderState *state);
|
---|
44 | /** Sets the currentframe id
|
---|
45 | */
|
---|
46 | void SetFrameId(int frameId);
|
---|
47 | /** Renders a camera frustum.
|
---|
48 | */
|
---|
49 | void RenderFrustum();
|
---|
50 |
|
---|
51 |
|
---|
52 | protected:
|
---|
53 |
|
---|
54 | ////////////
|
---|
55 | //-- members
|
---|
56 |
|
---|
57 | /// the current camera
|
---|
58 | PerspectiveCamera *mCamera;
|
---|
59 | /// the visualization camera
|
---|
60 | Camera *mVizCamera;
|
---|
61 | /// the root of the scene hierarchy
|
---|
62 | Bvh *mBvh;
|
---|
63 | /// the current render state
|
---|
64 | RenderState *mRenderState;
|
---|
65 | /// the current frame id
|
---|
66 | int mFrameId;
|
---|
67 | };
|
---|
68 |
|
---|
69 | }
|
---|
70 |
|
---|
71 |
|
---|
72 |
|
---|
73 | #endif // VISUALIZATION_H |
---|