K3dVector3Work.h

Go to the documentation of this file.
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 "../GameData/K3dGameData.h"
00036 #include "../GameData/K3dVector3Data.h"
00037 #include "../../MathCore/K3dVector3Obj.h"
00038 
00039 #include <algorithm>
00040 using namespace std;
00041 
00042 class K3dVector3Work
00043 {
00044                 K3dGameData *m_pGameData;       
00045                 K3dVector3Obj m_kVector;                
00046         public:
00047                 K3dVector3Work ( K3dGameData *_pGameData );
00048                 ~K3dVector3Work ( void );
00049 
00050                 void CheckVector3Array ( TVector3Array &_rvVector );
00051                 K3dVector3Obj &Sqr ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00052                 K3dVector3Obj &Cross ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00053                 K3dVector3Obj &UnitCross ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00054                 K3dVector3Obj &Normal ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1,const K3dVector3Obj &_rkV2 );
00055                 void AddScalar ( K3dVector3Obj &_rkV, const float fScalar, const int i );
00056                 void SubtractScalar ( K3dVector3Obj &_rkV, const float _fScalar, const int _iId );
00057                 K3dVector3Obj& Normalize ( const K3dVector3Obj &_rkV );
00058                 K3dVector3Obj& Reflection ( const K3dVector3Obj &_rkDirection,const K3dVector3Obj &_rkNormal );
00059                 float Length ( const K3dVector3Obj &_rkV );
00060                 K3dVector3Obj &VectorBetween ( const K3dVector3Obj &_rkV1,const K3dVector3Obj &_rkV2 );
00061                 void Angle ( K3dVector3Obj &_rkAngle );
00062                 float SquaredLength ( const K3dVector3Obj &_rkV );
00063                 const float SquaredLength ( const K3dVector3Obj &_rkV ) const;
00064                 float UnitLength ( const K3dVector3Obj &_rkV );
00065                 K3dVector3Obj &AddVector ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00066                 void DivideVector ( K3dVector3Obj &_rkV0 ,const float _fDivider );
00067                 void Translate ( K3dVector3 &_rkV, const K3dVector3 &_rkDir, const float _fDist );
00068                 void Invert ( K3dVector3 &_rkV );
00069                 float Dot ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00070                 float AngleBetweenNormals ( const K3dVector3Obj &_rkNormal0,const K3dVector3Obj &_rkNormal1 );
00071                 float AngleBetweenVectors ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00072                 float AngleBetweenVectors ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1, const K3dVector3Obj &_rkCentre );
00073                 float DotAngleBetweenVectors ( const K3dVector3Obj &_rkV0,const K3dVector3Obj &_rkV1 );
00074                 K3dVector3Obj &Projection ( const K3dVector3Obj &_rkP ,const K3dVector3Obj &_rkQ );
00075                 K3dVector3Obj &Perpendicular ( const K3dVector3Obj &_rkP,const  K3dVector3Obj &_rkQ );
00076                 K3dVector3Obj &Multiply ( const K3dVector3Obj &_rkV0, const  K3dVector3Obj &_rkV1 );
00077                 bool CompareIntScalars ( const K3dVector3Obj &_rkV0,const  K3dVector3Obj &_rkV1 );
00078                 bool EqualRange ( const K3dVector3Obj &_rkV0,const  K3dVector3Obj &_rkV1 , const float _fRange );
00079                 K3dVector3Obj &CalcCentre ( const K3dVector3Obj &_rkV0, const K3dVector3Obj &_rkV1, const K3dVector3Obj &_rkV2 );
00080                 void SwapXY ( K3dVector3Obj &_rkV );
00081                 void SwapXZ ( K3dVector3Obj &_rkV );
00082                 void SwapYZ ( K3dVector3Obj &_rkV );
00083                 void CalcVectorArrayCentre ( K3dVector3Obj &_rkVCentre, const TVector3Array &_rvVector );
00084 };
00085 

Generated on Thu Aug 16 23:53:29 2007 for K3dEngine by  doxygen 1.5.0