[1212] | 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 _OgreKdTreeCamera_H_
|
---|
| 11 | #define _OgreKdTreeCamera_H_
|
---|
| 12 |
|
---|
| 13 | #include <OgreCamera.h>
|
---|
| 14 |
|
---|
| 15 | #define KDCAMPTR_CAST(cam) (static_cast<KdTreeCamera *>(cam))
|
---|
| 16 |
|
---|
| 17 | namespace Ogre
|
---|
| 18 | {
|
---|
| 19 |
|
---|
| 20 | class KdTreeCamera : public Camera
|
---|
| 21 | {
|
---|
| 22 | public:
|
---|
| 23 | enum NodeVisibility
|
---|
| 24 | {
|
---|
| 25 | KDNV_NONE,
|
---|
| 26 | KDNV_PART,
|
---|
| 27 | KDNV_FULL
|
---|
| 28 | };
|
---|
| 29 |
|
---|
| 30 | //typedef NodeVisibility (KdTreeCamera::*VisFunction)(const AxisAlignedBox& box) const;
|
---|
| 31 |
|
---|
| 32 | // default constructor
|
---|
| 33 | KdTreeCamera(const String& name, SceneManager *sm);
|
---|
| 34 | // default destructor
|
---|
| 35 | ~KdTreeCamera();
|
---|
| 36 |
|
---|
| 37 | // chage vis mode
|
---|
| 38 | void setEnhancedVisMode(bool enhanced);
|
---|
| 39 | // query vis mode
|
---|
| 40 | bool getEnhancedVisMode(void);
|
---|
| 41 |
|
---|
| 42 | // function pointer to the actual getvis function
|
---|
| 43 | // allows choosing between regular vis (NONE/PART, same es isVisible)
|
---|
| 44 | // and enhaced vis (NONE/PART/FULL) for early traversal abort
|
---|
| 45 | //NodeVisibility (KdTreeCamera::*getVisibility)(const AxisAlignedBox& box) const;
|
---|
| 46 | //VisFunction getVisibility;
|
---|
| 47 | //NodeVisibility getVisibility(const AxisAlignedBox& box ) const;
|
---|
| 48 |
|
---|
| 49 | // regular visibility, like isVisible
|
---|
| 50 | NodeVisibility getVisibilitySimple(const AxisAlignedBox& box ) const;
|
---|
| 51 | // enhanced visibility
|
---|
| 52 | NodeVisibility getVisibilityEnhanced(const AxisAlignedBox& box) const;
|
---|
[1250] | 53 |
|
---|
| 54 | // DEBUG
|
---|
| 55 | //mutable unsigned int mNumVisQueries;
|
---|
[1212] | 56 | protected:
|
---|
| 57 |
|
---|
| 58 | // flag indicating current vis mode, default is on (true)
|
---|
| 59 | bool mEnhancedVisMode;
|
---|
| 60 | };
|
---|
| 61 |
|
---|
| 62 | } // namespace Ogre
|
---|
| 63 |
|
---|
| 64 | #endif // _OgreKdTreeCamera_H_ |
---|