Rev | Line | |
---|
[2764] | 1 | #ifndef __SCENEENTITY_H
|
---|
| 2 | #define __SCENEENTITY_H
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
| 5 | #include "AxisAlignedBox3.h"
|
---|
| 6 | #include "Triangle3.h"
|
---|
| 7 |
|
---|
| 8 |
|
---|
[2776] | 9 | namespace CHCDemoEngine
|
---|
[2764] | 10 | {
|
---|
| 11 |
|
---|
| 12 | class Material;
|
---|
| 13 | class Geometry;
|
---|
| 14 | class RenderState;
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | /** Class representing a scene entity.
|
---|
| 18 | A scene entity basicly consists of geometry, transformation, and a material
|
---|
| 19 | */
|
---|
| 20 | class SceneEntity
|
---|
| 21 | {
|
---|
| 22 | public:
|
---|
| 23 | int 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 |
|
---|
[2768] | 52 | inline Material *GetMaterial() const { return mMaterial; }
|
---|
[2767] | 53 |
|
---|
[2764] | 54 | protected:
|
---|
| 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.