Revision 2768,
1.5 KB
checked in by mattausch, 16 years ago
(diff) |
debug version
|
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 |
|
---|
| 9 | namespace CHCDemo
|
---|
| 10 | {
|
---|
| 11 |
|
---|
| 12 | class Material;
|
---|
| 13 | class Geometry;
|
---|
| 14 | class RenderState;
|
---|
| 15 |
|
---|
| 16 | /** The current render state.
|
---|
| 17 | */
|
---|
| 18 | class RenderState
|
---|
| 19 | {
|
---|
| 20 | public:
|
---|
| 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 | */
|
---|
| 28 | class SceneEntity
|
---|
| 29 | {
|
---|
| 30 | public:
|
---|
| 31 | int 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 |
|
---|
[2768] | 60 | inline Material *GetMaterial() const { return mMaterial; }
|
---|
[2767] | 61 |
|
---|
[2764] | 62 | protected:
|
---|
| 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.