1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of the GameTools Project
|
---|
4 | http://www.gametools.org
|
---|
5 |
|
---|
6 | Author: Martin Szydlowski
|
---|
7 | -----------------------------------------------------------------------------
|
---|
8 | */
|
---|
9 |
|
---|
10 | #ifndef _OgreKdTreeSceneNode_H__
|
---|
11 | #define _OgreKdTreeSceneNode_H__
|
---|
12 |
|
---|
13 | #include <OgreSceneNode.h>
|
---|
14 | #include "OgreKdRenderable.h"
|
---|
15 |
|
---|
16 | namespace Ogre
|
---|
17 | {
|
---|
18 |
|
---|
19 | class KdTreeSceneNode : public SceneNode, public KdRenderable
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | KdTreeSceneNode(SceneManager *creator):
|
---|
23 | SceneNode(creator) {};
|
---|
24 |
|
---|
25 | KdTreeSceneNode(SceneManager *creator, const String& name):
|
---|
26 | SceneNode(creator, name) {};
|
---|
27 |
|
---|
28 | ~KdTreeSceneNode() {};
|
---|
29 |
|
---|
30 | // calculate all-enclosing AABB, similar to _updateBounds()
|
---|
31 | void forceComputeAABB(AxisAlignedBox& aabb); // OBSOLETE !!
|
---|
32 |
|
---|
33 | // gather info for kd-tree creation
|
---|
34 | virtual void computeScene(PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true);
|
---|
35 |
|
---|
36 | // add all contained objects to render queue
|
---|
37 | virtual void queueObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters);
|
---|
38 |
|
---|
39 | // place all entities in geometry queue (for CHC)
|
---|
40 | virtual void getGeometryList(GtpVisibility::GeometryVector *geometryList);
|
---|
41 |
|
---|
42 | // return a bounding box enclosing all objects
|
---|
43 | virtual AxisAlignedBox getBoundingBox() const;
|
---|
44 |
|
---|
45 | // custom render op, show bounding box instead of axes
|
---|
46 | //virtual void getRenderOperation(RenderOperation& op);
|
---|
47 |
|
---|
48 | //virtual void _findVisibleObjects(Camera* cam, RenderQueue* queue,
|
---|
49 | // bool includeChildren = true, bool displayNodes = false, bool onlyShadowCasters = false);
|
---|
50 |
|
---|
51 | // DEBUG
|
---|
52 | String dumpToString();
|
---|
53 | protected:
|
---|
54 | virtual void _updateBounds(void);
|
---|
55 |
|
---|
56 | //AxisAlignedBox mLocalAABB;
|
---|
57 | };
|
---|
58 |
|
---|
59 | } // namespace Ogre
|
---|
60 |
|
---|
61 | #endif // _OgreKdTreeSceneNode_H__ |
---|