Revision 3114,
1.2 KB
checked in by mattausch, 16 years ago
(diff) |
worked on dynamic objects: now ook, but have to work on render queue
|
Line | |
---|
1 | #ifndef __SHAPE_H
|
---|
2 | #define __SHAPE_H
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 | #include "Vector3.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace CHCDemoEngine
|
---|
9 | {
|
---|
10 |
|
---|
11 |
|
---|
12 | class Material;
|
---|
13 | class Geometry;
|
---|
14 | class RenderState;
|
---|
15 | class AxisAlignedBox3;
|
---|
16 | class Vector3;
|
---|
17 |
|
---|
18 | struct RenderQueueBucket;
|
---|
19 |
|
---|
20 |
|
---|
21 | /** Class representing a 3D shape consisting
|
---|
22 | of geometry (with texture coordinates, normals) and a material
|
---|
23 | */
|
---|
24 | class Shape
|
---|
25 | {
|
---|
26 | friend class RenderQueue;
|
---|
27 |
|
---|
28 | public:
|
---|
29 | /** Creates a scene entity.
|
---|
30 | */
|
---|
31 | Shape(Geometry *geometry, Material *mat);
|
---|
32 |
|
---|
33 | ~Shape();
|
---|
34 | /** Renders this node.
|
---|
35 | */
|
---|
36 | void Render(RenderState *state, SceneEntity *ent = NULL);
|
---|
37 | /** Set pointer to the geometry
|
---|
38 | */
|
---|
39 | void SetGeometry(Geometry *geom);
|
---|
40 | /** See set
|
---|
41 | */
|
---|
42 | inline Geometry *GetGeometry() const { return mGeometry; }
|
---|
43 | /** Set pointer to the material
|
---|
44 | */
|
---|
45 | void SetMaterial(Material *mat);
|
---|
46 | /** Returns the transformed bounding box.
|
---|
47 | */
|
---|
48 | AxisAlignedBox3 GetBoundingBox() const;
|
---|
49 | /** Returns material of this shape.
|
---|
50 | */
|
---|
51 | inline Material *GetMaterial() const { return mMaterial; }
|
---|
52 | /** Returns center point of this shape.
|
---|
53 | */
|
---|
54 | Vector3 GetCenter() const;
|
---|
55 |
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | Vector3 mCenter;
|
---|
60 |
|
---|
61 | Geometry *mGeometry;
|
---|
62 | Material *mMaterial;
|
---|
63 | };
|
---|
64 |
|
---|
65 | }
|
---|
66 |
|
---|
67 | #endif // __SCENEENTITY_H |
---|
Note: See
TracBrowser
for help on using the repository browser.