source: GTP/trunk/App/Demos/Vis/CHC_revisited/SceneEntity.h @ 2764

Revision 2764, 1.4 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef __SCENEENTITY_H
2#define __SCENEENTITY_H
3
4#include "common.h"
5#include "AxisAlignedBox3.h"
6#include "Triangle3.h"
7
8
9namespace CHCDemo
10{
11
12class Material;
13class Geometry;
14class RenderState;
15
16/** The current render state.
17*/
18class RenderState
19{
20public:
21        bool mTexturesEnabled;
22};
23
24
25/** Class representing a scene entity.
26    A scene entity basicly consists of geometry, transformation, and a material
27*/
28class SceneEntity
29{
30public:
31int id;
32        /** Creates a scene entity.
33        */
34        SceneEntity(Geometry *geometry, Material *mat, Matrix4x4 *trafo);
35        /** Renders this node.
36        */
37        void Render(RenderState *state);       
38        /** Set pointer to the geometry
39        */
40        void SetGeometry(Geometry *geom);
41        /** See set
42        */
43        Geometry *GetGeometry() const { return mGeometry; }
44        /** Set pointer to the geometry
45        */
46        void SetTransformation(Matrix4x4 *trafo);
47        /** Set pointer to the material
48        */
49        void SetMaterial(Material *mat);
50        /** Returns the transformed bounding box.
51        */
52        AxisAlignedBox3 GetBoundingBox() const;
53        /** set frame where we last rendered this node
54        */
55        void SetLastRendered(int lastRendered);
56        /** returns frame where we last visited this node
57        */
58        int GetLastRendered() const;
59       
60
61protected:
62
63        /// transform matrix
64        Matrix4x4 *mTransform;
65        Geometry *mGeometry;
66        Material *mMaterial;
67
68        //AxisAlignedBox3 mBoundingBox;
69       
70        int mLastRendered;
71};
72
73}
74
75#endif // __SCENEENTITY_H
Note: See TracBrowser for help on using the repository browser.