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