source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Shape.h @ 2842

Revision 2842, 1.3 KB checked in by mattausch, 16 years ago (diff)
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
10namespace CHCDemoEngine
11{
12
13
14class Material;
15class Geometry;
16class RenderState;
17class AxisAlignedBox3;
18
19struct RenderQueueBucket;
20
21
22/** Class representing a shape.
23    A shape basically consists of geometry and a material
24*/
25class Shape
26{
27        friend class RenderQueue;
28
29public:
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
56protected:
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.