Line | |
---|
1 | #ifndef GEOMETRY_H
|
---|
2 | #define GEOMETRY_H
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 | #include "AxisAlignedBox3.h"
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 | namespace CHCDemo
|
---|
10 | {
|
---|
11 |
|
---|
12 | class Material;
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 | /** Represents drawable geometry consisting of triangles
|
---|
17 | */
|
---|
18 | class Geometry
|
---|
19 | {
|
---|
20 | public:
|
---|
21 | /** Constructor taking a triangle container.
|
---|
22 | */
|
---|
23 | Geometry(const TriangleContainer &triangles);
|
---|
24 |
|
---|
25 | protected:
|
---|
26 |
|
---|
27 | AxisAlignedBox3 mBoundingBox;
|
---|
28 | TriangleContainer mTriangles;
|
---|
29 | };
|
---|
30 |
|
---|
31 |
|
---|
32 | /** Class representing a scene entity.
|
---|
33 | A scene entity basicly consists of geometry, transformation, and a material
|
---|
34 | */
|
---|
35 | class SceneEntity
|
---|
36 | {
|
---|
37 | /** Create scene entity.
|
---|
38 | */
|
---|
39 | SceneEntity(Geometry *geometry, Matrix4x4 *trafo, Material *mat);
|
---|
40 | /** Renders this geometry.
|
---|
41 | */
|
---|
42 | void Render();
|
---|
43 | /** Set pointer to the geometry
|
---|
44 | */
|
---|
45 | void SetGeometry(Geometry *geom);
|
---|
46 | /** Set pointer to the geometry
|
---|
47 | */
|
---|
48 | void SetTransformation(const Matrix4x4 *trafo);
|
---|
49 | /** Set pointer to the material
|
---|
50 | */
|
---|
51 | void SetMaterial(Material *mat);
|
---|
52 | /** Returns the transformed bounding box.
|
---|
53 | */
|
---|
54 | const AxisAlignedBox3& GetBoundingVolume();
|
---|
55 | /** set frame where we last visitied this node
|
---|
56 | */
|
---|
57 | void SetLastVisited(int lastVisited);
|
---|
58 | /** returns frame where we last visited this node
|
---|
59 | */
|
---|
60 | int GetLastVisited() const;
|
---|
61 |
|
---|
62 | protected:
|
---|
63 |
|
---|
64 | /// transform matrix
|
---|
65 | Matrix4x4 *mTransform;
|
---|
66 | Geometry *mGeometry;
|
---|
67 | Material *mMaterial;
|
---|
68 |
|
---|
69 | AxisAlignedBox3 mBoundingBox;
|
---|
70 |
|
---|
71 | int mLastVisited;
|
---|
72 | };
|
---|
73 |
|
---|
74 | }
|
---|
75 |
|
---|
76 | #endif // GEOMETRY_H |
---|
Note: See
TracBrowser
for help on using the repository browser.