00001 // Magic Software, Inc. 00002 // http://www.magic-software.com 00003 // Copyright (c) 2000, All Rights Reserved 00004 // 00005 // Source code from Magic Software is supplied under the terms of a license 00006 // agreement and may not be copied or disclosed except in accordance with the 00007 // terms of that agreement. The various license agreements may be found at 00008 // the Magic Software web site. This file is subject to the license 00009 // 00010 // FREE SOURCE CODE 00011 // http://www.magic-software.com/License.html/free.pdf 00012 00013 #ifndef MGCFRUSTUM_H 00014 #define MGCFRUSTUM_H 00015 00016 #include "MgcRTLib.h" 00017 #include "MgcVector3.h" 00018 00019 00020 class MgcFrustum 00021 { 00022 public: 00023 MgcFrustum (); 00024 00025 MgcVector3& Origin (); 00026 const MgcVector3& Origin () const; 00027 00028 MgcVector3& LVector (); 00029 const MgcVector3& LVector () const; 00030 MgcVector3& UVector (); 00031 const MgcVector3& UVector () const; 00032 MgcVector3& DVector (); 00033 const MgcVector3& DVector () const; 00034 00035 MgcReal& LBound (); 00036 const MgcReal& LBound () const; 00037 MgcReal& UBound (); 00038 const MgcReal& UBound () const; 00039 MgcReal& DMin (); 00040 const MgcReal& DMin () const; 00041 MgcReal& DMax (); 00042 const MgcReal& DMax () const; 00043 00044 void Update (); 00045 MgcReal GetDRatio () const; 00046 MgcReal GetMTwoLF () const; 00047 MgcReal GetMTwoUF () const; 00048 00049 void ComputeVertices (MgcVector3 akVertex[8]) const; 00050 00051 protected: 00052 MgcVector3 m_kOrigin, m_kLVector, m_kUVector, m_kDVector; 00053 MgcReal m_fLBound, m_fUBound, m_fDMin, m_fDMax; 00054 00055 // derived quantities 00056 MgcReal m_fDRatio; 00057 MgcReal m_fMTwoLF, m_fMTwoUF; 00058 }; 00059 00060 #include "MgcFrustum.inl" 00061 00062 #endif