Proud::Vector3T< FloatType > 구조체 템플릿 참조

Public 멤버 함수

 Vector3T (const FloatType *from)
 
 Vector3T (FloatType x, FloatType y, FloatType z)
 
 operator FloatType * ()
 
 operator const FloatType * () const
 
template<typename D3DXVECTOR3 >
__forceinline Vector3T (const D3DXVECTOR3 &from)
 
template<typename D3DXVECTOR3 >
__forceinline operator D3DXVECTOR3 const ()
 
Vector3Toperator+= (const Vector3T &src)
 
Vector3Toperator-= (const Vector3T &src)
 
Vector3Toperator*= (FloatType scale)
 
Vector3Toperator/= (FloatType scale)
 
Vector3T operator+ () const
 
Vector3T operator- () const
 
Vector3T operator+ (const Vector3T &src) const
 
Vector3T operator- (const Vector3T &src) const
 
Vector3T operator* (FloatType scale) const
 
Vector3T operator/ (FloatType scale) const
 
bool operator== (const Vector3T &rhs) const
 
bool operator!= (const Vector3T &rhs) const
 
 __declspec (property(get=GetLengthSq)) FloatType LengthSq
 
 __declspec (property(get=GetLength)) FloatType Length
 
Vector3T GetNormal () const
 
FloatType GetLengthSq () const
 
FloatType GetLength () const
 
FloatType Distance (const Vector3T &a) const
 
FloatType Distance2 (const Vector3T &a) const
 
void SetLength (FloatType length)
 

정적 Public 멤버 함수

static Vector3T Lerp (const Vector3T &a, const Vector3T &b, FloatType ratio)
 
static FloatType Dot (const Vector3T &a, const Vector3T &b)
 

Public 속성

FloatType x
 x
 
FloatType y
 y
 
FloatType z
 z
 

상세한 설명

template<typename FloatType>
struct Proud::Vector3T< FloatType >

Vector 3D 클래스

  • Vector3T 등이 있음에도 불구하고 별도 구현된 이유는, 플랫폼 비 종속을 위함이다.
  • 보다 높은 정확도를 위해(예: 우주공간 배경의 온라인 게임) FloatType을 쓰고 있다. 보다 낮은 용량을 필요로 하는 경우 Vector3T 대신 다른 객체 타입을 쓰는 것을 권장한다.
  • 사칙 연산 연산자를 지원한다. 따라서 아래와 같은 코딩이 가능하다.
    Vector3T a = Vector3T(1,2,3);
    Vector3T b = Vector3T(4,5,6);
    Vector3T c = (a * b) + c - d;

멤버 함수 문서화

template<typename FloatType >
static FloatType Proud::Vector3T< FloatType >::Dot ( const Vector3T< FloatType > &  a,
const Vector3T< FloatType > &  b 
)
inlinestatic

두 vector의 내적을 구합니다

template<typename FloatType >
FloatType Proud::Vector3T< FloatType >::GetLength ( ) const
inline

vector의 길이

template<typename FloatType >
FloatType Proud::Vector3T< FloatType >::GetLengthSq ( ) const
inline

길이의 제곱을 구합니다.

template<typename FloatType >
Vector3T Proud::Vector3T< FloatType >::GetNormal ( ) const
inline

Normal Vector를 구합니다.

template<typename FloatType >
static Vector3T Proud::Vector3T< FloatType >::Lerp ( const Vector3T< FloatType > &  a,
const Vector3T< FloatType > &  b,
FloatType  ratio 
)
inlinestatic

두 vector를 보간합니다.

  • a + (b - a) * ratio
template<typename FloatType >
void Proud::Vector3T< FloatType >::SetLength ( FloatType  length)
inline

벡터의 방향을 유지한 채 길이를 조정합니다.