Line | |
---|
1 | #ifndef __SHAPE_H
|
---|
2 | #define __SHAPE_H
|
---|
3 |
|
---|
4 | #include "glInterface.h"
|
---|
5 | #include <Cg/cg.h>
|
---|
6 | #include <Cg/cgGL.h>
|
---|
7 | #include "common.h"
|
---|
8 |
|
---|
9 |
|
---|
10 | namespace CHCDemoEngine
|
---|
11 | {
|
---|
12 |
|
---|
13 |
|
---|
14 | class Material;
|
---|
15 | class Geometry;
|
---|
16 | class RenderState;
|
---|
17 | class AxisAlignedBox3;
|
---|
18 |
|
---|
19 | struct RenderQueueBucket;
|
---|
20 |
|
---|
21 |
|
---|
22 | /** Class representing a shape.
|
---|
23 | A shape basically consists of geometry and a material
|
---|
24 | */
|
---|
25 | class Shape
|
---|
26 | {
|
---|
27 | friend class RenderQueue;
|
---|
28 |
|
---|
29 | public:
|
---|
30 | /** Creates a scene entity.
|
---|
31 | */
|
---|
32 | Shape(Geometry *geometry, Material *mat, SceneEntity *parent);
|
---|
33 |
|
---|
34 | ~Shape();
|
---|
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 material
|
---|
45 | */
|
---|
46 | void SetMaterial(Material *mat);
|
---|
47 | /** Returns the transformed bounding box.
|
---|
48 | */
|
---|
49 | AxisAlignedBox3 GetBoundingBox() const;
|
---|
50 | /** Returns bounding box transformed with the parent transform.
|
---|
51 | */
|
---|
52 | AxisAlignedBox3 GetTransformedBoundingBox() const;
|
---|
53 |
|
---|
54 | inline Material *GetMaterial() const { return mMaterial; }
|
---|
55 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | Geometry *mGeometry;
|
---|
59 | Material *mMaterial;
|
---|
60 | SceneEntity *mParent;
|
---|
61 |
|
---|
62 | /// pointer to the renderqueue bucket this entity belongs to
|
---|
63 | RenderQueueBucket *mRenderQueueBucket;
|
---|
64 | };
|
---|
65 |
|
---|
66 | }
|
---|
67 |
|
---|
68 | #endif // __SCENEENTITY_H |
---|
Note: See
TracBrowser
for help on using the repository browser.