-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vector.h
46 lines (35 loc) · 924 Bytes
/
Vector.h
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
// Vector.h: interface for the CVector class.
//
//////////////////////////////////////////////////////////////////////
# ifndef _VECTOR_H
# define _VECTOR_H
class CPoint3D;
class CVector
{
public:
// Object Constructors
CVector();
CVector(CPoint3D position);
CVector(float dx, float dy, float dz);
// Object destruction
virtual ~CVector();
// Object interface
void SetVector (float dx, float dy, float dz);
CVector& Normalize ();
float Magnitude () const;
float XComponent () const;
float YComponent () const;
float ZComponent () const;
float DotProduct (CVector vector1);
CVector CrossProduct (CVector that);
CVector GetOrthoAlong (CVector approxDirection);
CVector operator* (float fScale);
CVector operator- (const CVector& that);
CVector operator+ (const CVector& that);
CVector& operator=(const CPoint3D& point);
protected:
float m_fdx;
float m_fdy;
float m_fdz;
};
# endif