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

Revision 2768, 1.5 KB checked in by mattausch, 16 years ago (diff)

debug version

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        inline Material *GetMaterial() const  { return mMaterial; }
61
62protected:
63
64        /// transform matrix
65        Matrix4x4 *mTransform;
66        Geometry *mGeometry;
67        Material *mMaterial;
68
69        //AxisAlignedBox3 mBoundingBox;
70       
71        int mLastRendered;
72};
73
74}
75
76#endif // __SCENEENTITY_H
Note: See TracBrowser for help on using the repository browser.