source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Shape.cpp @ 3114

Revision 3114, 816 bytes checked in by mattausch, 16 years ago (diff)

worked on dynamic objects: now ook, but have to work on render queue

Line 
1#include "Shape.h"
2#include "Material.h"
3#include "RenderState.h"
4#include "Geometry.h"
5#include "SceneEntity.h"
6#include "Transform3.h"
7#include "glInterface.h"
8
9
10
11namespace CHCDemoEngine
12{
13
14Shape::Shape(Geometry *geometry, Material *mat):
15mGeometry(geometry),
16mMaterial(mat)
17{
18        mCenter = GetBoundingBox().Center();
19}
20
21
22Shape::~Shape()
23{}
24
25
26void Shape::Render(RenderState *state, SceneEntity *ent)
27{
28        if (mMaterial) mMaterial->Render(state, ent);
29       
30        mGeometry->Render(state);
31}
32
33
34void Shape::SetGeometry(Geometry *geom)
35{
36        mGeometry = geom;
37}
38
39
40void Shape::SetMaterial(Material *mat)
41{
42        mMaterial = mat;
43}
44
45
46
47AxisAlignedBox3 Shape::GetBoundingBox() const
48{
49        return mGeometry->GetBoundingBox();
50}
51
52
53Vector3 Shape::GetCenter() const
54{
55        return mCenter;
56}
57
58
59}
Note: See TracBrowser for help on using the repository browser.