00001 00012 /*************************************************************************** 00013 * Copyright (C) 2007 by Jan Koci * 00014 * honza.koci@email.cz * 00015 * http://kengine.sourceforge.net/tutorial/ 00016 * * 00017 * This program is free software; you can redistribute it and/or modify * 00018 * it under the terms of the GNU General Public License as published by * 00019 * the Free Software Foundation; either version 2 of the License, or * 00020 * (at your option) any later version. * 00021 * * 00022 * This program is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00025 * GNU General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU General Public License * 00028 * along with this program; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00031 ***************************************************************************/ 00032 00033 #pragma once 00034 00035 #include "../MathCore/K3dVector3Obj.h" 00036 00037 class K3dPlane 00038 { 00039 K3dVector3Obj *m_pPosition; 00040 K3dVector3Obj *m_pNormal; 00041 float m_fDistance; 00042 00043 public: 00044 00045 K3dPlane(); 00046 ~K3dPlane(); 00047 00048 K3dPlane& operator= ( K3dPlane& _rkPlane ); 00049 00051 void Reset() 00052 { 00053 m_fDistance = 0.0f; 00054 m_pNormal->Reset(); 00055 m_pPosition->Reset(); 00056 } 00057 00059 K3dVector3Obj* GetNormal() 00060 { 00061 return m_pNormal; 00062 } 00063 const K3dVector3Obj* GetNormal() const 00064 { 00065 return m_pNormal; 00066 } 00067 00069 void SetNormal ( K3dVector3Obj* _pNormal ) 00070 { 00071 m_pNormal = _pNormal; 00072 } 00073 00075 float& GetDistance() 00076 { 00077 return m_fDistance; 00078 } 00079 const float& GetDistance() const 00080 { 00081 return m_fDistance; 00082 } 00083 00085 K3dVector3Obj* GetPosition() 00086 { 00087 return m_pPosition; 00088 } 00089 const K3dVector3Obj* GetPosition() const 00090 { 00091 return m_pPosition; 00092 } 00093 00095 void SetPosition ( K3dVector3Obj* _pPosition ) 00096 { 00097 m_pPosition = _pPosition; 00098 } 00099 }; 00100 00101