SDC C-Project CF Review 프로그램
LYW
2021-06-23 598cef9de915e5554fc2f7572b24f15d8a4acf41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
 
#include "akSTLLinker.h"
 
 
#define _USE_MATH_DEFINES
#include <math.h>
 
template<typename T>
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<T> vector) throw();
    void set(T X, T Y, T Z) throw();
 
    bool operator==(CakVectorT<T> vector) const throw();
    bool operator!=(CakVectorT<T> vector) const throw();
    void operator+=(CakVectorT<T> vector) throw();
    void operator-=(CakVectorT<T> vector) throw();
 
    // Operators returning CakVector values
    CakVectorT<T> operator-() const throw();
    CakVectorT<T> operator+(CakVectorT<T> vector) const throw();
    CakVectorT<T> operator-(CakVectorT<T> vector) const throw();
 
    CakVectorT<T> operator*(T& a) const throw();
    CakVectorT<T> operator*(CakVectorT<T> &vec) const throw();
    
 
    //³»Àû
    T Dot(CakVectorT<T> 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"