123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef __CC_FRUSTUM_H_
- #define __CC_FRUSTUM_H_
- #include "base/ccMacros.h"
- #include "math/CCMath.h"
- #include "3d/CCAABB.h"
- #include "3d/CCOBB.h"
- #include "3d/CCPlane.h"
- NS_CC_BEGIN
- class Camera;
- class CC_DLL Frustum
- {
- friend class Camera;
- public:
-
- Frustum(): _clipZ(true), _initialized(false) {}
- ~Frustum(){}
-
- bool initFrustum(const Camera* camera);
-
- bool isOutOfFrustum(const AABB& aabb) const;
-
- bool isOutOfFrustum(const OBB& obb) const;
-
- void setClipZ(bool clipZ) { _clipZ = clipZ; }
- bool isClipZ() { return _clipZ; }
-
- protected:
-
- void createPlane(const Camera* camera);
- Plane _plane[6];
- bool _clipZ;
- bool _initialized;
- };
- NS_CC_END
- #endif
|