"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSPhysicsLib/Src/BoundingBoxes/LSPCappedKDop.h

00001 
00018 #ifndef __LSP_CAPPEDKDOP_H__
00019 #define __LSP_CAPPEDKDOP_H__
00020 
00021 #include "../LSPPhysicsLib.h"
00022 #include "Plane/LSMPlane3.h"
00023 #include <cassert>
00024 
00025 namespace lsp {
00026 
00035         template <unsigned _uMax>
00036         class CCappedKDop {
00037         public :
00038                 // == Various constructors.
00039                 LSE_INLINE LSE_CALLCTOR                                 CCappedKDop() :
00040                         m_ui32Total( 0UL ) {
00041                 }
00042 
00043 
00044                 // == Operators.
00051                 LSE_INLINE CPlane3 & LSE_CALL                   operator [] ( LSUINT32 _ui32I ) {
00052                         assert( _ui32I < m_ui32Total );
00053                         return m_pPlanes[_ui32I];
00054                 }
00055 
00062                 LSE_INLINE const CPlane3 & LSE_CALL             operator [] ( LSUINT32 _ui32I ) const {
00063                         assert( _ui32I < m_ui32Total );
00064                         return m_pPlanes[_ui32I];
00065                 }
00066 
00067 
00068                 // == Functions.
00074                 LSE_INLINE LSUINT32 LSE_CALL                    TotalPlanes() const {
00075                         return m_ui32Total;
00076                 }
00077 
00084                 LSE_INLINE LSBOOL LSE_CALL                              AddPlane( const CPlane3 &_pPlane ) {
00085                         if ( m_ui32Total < _uMax ) {
00086                                 m_pPlanes[m_ui32Total++] = _pPlane;
00087                                 return true;
00088                         }
00089                         return false;
00090                 }
00091 
00095                 LSE_INLINE LSVOID LSE_CALL                              Reset() {
00096                         m_ui32Total = 0UL;
00097                 }
00098 
00099 
00100         protected :
00101                 // == Members.
00105                 CPlane3                                                                 m_pPlanes[_uMax];
00106 
00110                 LSUINT32                                                                m_ui32Total;
00111         };
00112 
00113 }       // namespace lsp
00114 
00115 #endif  // __LSP_CAPPEDKDOP_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator