00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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