#pragma once #include "akSTLLinker.h" #define _USE_MATH_DEFINES #include template class CakVectorT { public: CakVectorT(void){}; CakVectorT(const T& X, const T& Y, const T& Z):x(X),y(Y),z(Z) {}; //~CakVectorT(void){}; // Operations // translate the point void Offset(T xOffset, T yOffset, T zOffset) throw(); void Offset(CakVectorT vector) throw(); void set(T X, T Y, T Z) throw(); bool operator==(CakVectorT vector) const throw(); bool operator!=(CakVectorT vector) const throw(); void operator+=(CakVectorT vector) throw(); void operator-=(CakVectorT vector) throw(); // Operators returning CakVector values CakVectorT operator-() const throw(); CakVectorT operator+(CakVectorT vector) const throw(); CakVectorT operator-(CakVectorT vector) const throw(); CakVectorT operator*(T& a) const throw(); CakVectorT operator*(CakVectorT &vec) const throw(); //³»Àû T Dot(CakVectorT vec){ return (vec.x * x + vec.y * y + vec.z * z); }; T Mag() { return sqrt(x*x+y*y); }; T getLength() { return sqrt(x*x+y*y+z*z); }; void Normalize(); public: T x,y,z; }; #include "inl/akVectorT.inl"