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 "K3dLine.h" 00036 #include "../MathCore/K3dVector3.h" 00037 #include "../MathCore/K3dMatrix.h" 00038 #include "../MathCore/K3dQuaternion.h" 00039 #include "../MathCore/K3dMath.h" 00040 00041 class K3dLineMove: public K3dLine 00042 { 00043 K3dVector3Obj *m_pPosition; 00044 K3dVector3Obj *m_pRotation; 00045 K3dVector3Obj *m_pRelOrigin; 00046 K3dVector3Obj *m_pRelDirection; 00047 K3dMatrix *m_pMatrix; 00048 K3dMatrix *m_pRotMatrix; 00049 00050 void SetRenderMatrix(); 00051 public: 00052 00053 K3dLineMove(); 00054 ~K3dLineMove(); 00055 00056 K3dLineMove& operator= ( K3dLineMove& _rkLineMove ); 00057 void UpdateMatrix(); 00058 void Init(); 00059 00061 K3dVector3Obj *GetPosition() 00062 { 00063 return m_pPosition; 00064 } 00065 00067 const K3dVector3Obj *GetPosition() const 00068 { 00069 return m_pPosition; 00070 } 00071 00073 void SetPosition ( K3dVector3Obj *_pPosition ) 00074 { 00075 m_pPosition = _pPosition; 00076 } 00077 00079 K3dVector3Obj *GetRotation() 00080 { 00081 return m_pRotation; 00082 } 00083 00085 const K3dVector3Obj *GetRotation() const 00086 { 00087 return m_pRotation; 00088 } 00089 00091 void SetRotation ( K3dVector3Obj *_pRotation ) 00092 { 00093 m_pRotation = _pRotation; 00094 } 00095 00097 K3dVector3Obj* GetRelOrigin() 00098 { 00099 return m_pRelOrigin; 00100 } 00101 00103 const K3dVector3Obj* GetRelOrigin() const 00104 { 00105 return m_pRelOrigin; 00106 } 00107 00109 void SetRelOrigin ( K3dVector3Obj *_pRelOrigin ) 00110 { 00111 m_pRelOrigin = _pRelOrigin; 00112 } 00113 00115 K3dVector3Obj* GetRelDirection() 00116 { 00117 return m_pRelDirection; 00118 } 00119 00121 const K3dVector3Obj* GetRelDirection() const 00122 { 00123 return m_pRelDirection; 00124 } 00125 00127 void SetRelDirection ( K3dVector3Obj *_pRelDirection ) 00128 { 00129 m_pRelDirection = _pRelDirection; 00130 } 00131 00133 K3dMatrix *GetMatrix() 00134 { 00135 return m_pMatrix; 00136 } 00137 00139 const K3dMatrix *GetMatrix() const 00140 { 00141 return m_pMatrix; 00142 } 00143 00145 void SetMatrix ( K3dMatrix *_pMatrix ) 00146 { 00147 m_pMatrix = _pMatrix; 00148 } 00149 00151 K3dMatrix *GetRotMatrix() 00152 { 00153 return m_pRotMatrix; 00154 } 00155 00157 const K3dMatrix *GetRotMatrix() const 00158 { 00159 return m_pRotMatrix; 00160 } 00161 00163 void SetRotMatrix ( K3dMatrix *_pMatrix ) 00164 { 00165 m_pRotMatrix = _pMatrix; 00166 } 00167 };