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

Revision 2782, 1.4 KB checked in by mattausch, 16 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 CHCDemoEngine
10{
11
12class Material;
13class Geometry;
14class RenderState;
15
16
17/** Class representing a scene entity.
18    A scene entity basicly consists of geometry, transformation, and a material
19*/
20class SceneEntity
21{
22public:
23int id;
24        /** Creates a scene entity.
25        */
26        SceneEntity(Geometry *geometry, Material *mat, Matrix4x4 *trafo);
27        /** Renders this node.
28        */
29        void Render(RenderState *state);       
30        /** Set pointer to the geometry
31        */
32        void SetGeometry(Geometry *geom);
33        /** See set
34        */
35        Geometry *GetGeometry() const { return mGeometry; }
36        /** Set pointer to the geometry
37        */
38        void SetTransformation(Matrix4x4 *trafo);
39        /** Set pointer to the material
40        */
41        void SetMaterial(Material *mat);
42        /** Returns the transformed bounding box.
43        */
44        AxisAlignedBox3 GetBoundingBox() const;
45        /** set frame where we last rendered this node
46        */
47        void SetLastRendered(int lastRendered);
48        /** returns frame where we last visited this node
49        */
50        int GetLastRendered() const;
51
52        inline Material *GetMaterial() const  { return mMaterial; }
53
54protected:
55
56        /// transform matrix
57        Matrix4x4 *mTransform;
58        Geometry *mGeometry;
59        Material *mMaterial;
60
61        //AxisAlignedBox3 mBoundingBox;
62       
63        int mLastRendered;
64};
65
66}
67
68#endif // __SCENEENTITY_H
Note: See TracBrowser for help on using the repository browser.