"L. Spiro Engine"
|
00001 00017 #ifndef __LSE_SPHERE_H__ 00018 #define __LSE_SPHERE_H__ 00019 00020 #include "../LSMMathLib.h" 00021 #include "../Matrix/LSMMatrix4x4.h" 00022 #include "../Vector/LSMVector3.h" 00023 00024 namespace lsm { 00025 00031 class CSphere { 00032 // All is public. This class has no secrets. 00033 public : 00034 // == Various constructors. 00035 LSE_INLINE LSE_CALLCTOR CSphere(); 00036 LSE_INLINE LSE_CALLCTOR CSphere( const CSphere &_sSphere ); 00037 LSE_INLINE LSE_CALLCTOR CSphere( const CVector3 &_vPos, LSREAL _fRadius ); 00038 00039 00040 // == Functions. 00048 static CSphere LSE_FCALL SphereEnclosingSpheres( const CSphere &_sLeft, const CSphere &_sRight ); 00049 00057 static CSphere LSE_FCALL CreateSphereFromSphereAndMatrix( const CSphere &_sSphere, const CMatrix4x4 &_mMat ); 00058 00059 // == Members. 00060 CVector3 c; 00061 LSREAL r; 00062 00063 }; 00064 00065 00066 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00067 // DEFINITIONS 00068 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00069 // == Various constructors. 00070 LSE_INLINE LSE_CALLCTOR CSphere::CSphere() {} 00071 LSE_INLINE LSE_CALLCTOR CSphere::CSphere( const CSphere &_sSphere ) { 00072 (*this) = _sSphere; 00073 } 00074 LSE_INLINE LSE_CALLCTOR CSphere::CSphere( const CVector3 &_vPos, LSREAL _fRadius ) { 00075 c = _vPos; 00076 r = _fRadius; 00077 } 00078 00079 00080 } // namespace lsm 00081 00082 #endif // __LSE_SPHERE_H__