Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Vector3D.h
Go to the documentation of this file.
1#ifndef ULT_MATH_VECTOR3D_H_INCLUDED
2#define ULT_MATH_VECTOR3D_H_INCLUDED
3
4namespace Ult
5{
6
12{
13public:
17 Vector3D();
21 Vector3D(float x, float y, float z);
25 Vector3D(const Vector3D& v);
26
30 void Add(const Vector3D& v1, const Vector3D& v2);
34 void Subtract(const Vector3D& v1, const Vector3D& v2);
38 void Multiply(const Vector3D& v1, const Vector3D& v2);
42 void Divide(const Vector3D& v1, const Vector3D& v2);
43
47 void Add(const Vector3D& v1, const float f);
51 void Subtract(const Vector3D& v1, const float f);
55 void Multiply(const Vector3D& v1, const float f);
59 void Divide(const Vector3D& v1, const float f);
60
64 void operator=(const Vector3D& v);
68 void operator+=(const Vector3D& v);
72 void operator-=(const Vector3D& v);
76 void operator/=(const Vector3D& v);
80 void operator*=(const Vector3D& v);
81
83 Vector3D operator+(const Vector3D& v) const;
85 Vector3D operator-(const Vector3D& v) const;
87 Vector3D operator/(const Vector3D& v) const;
89 Vector3D operator*(const Vector3D& v) const;
90
92 Vector3D operator+(const float& f) const;
94 Vector3D operator-(const float& f) const;
96 Vector3D operator/(const float& f) const;
98 Vector3D operator*(const float& f) const;
99
101 void Negate();
103 float Dot3(const Vector3D& v) const;
105 float Magnitude() const;
106
108 void Normalize();
110 void Normalize(const Vector3D& p1, const Vector3D& p2, const Vector3D& p3);
111
113 Vector3D CrossProduct(const Vector3D& v) const;
114
116 float x,y,z;
117};
118
119} // namespace Ult
120
121#endif // ULT_MATH_VECTOR3D_H_INCLUDED
122
void Normalize()
Definition Vector3D.cpp:157
void Negate()
Definition Vector3D.cpp:142
void operator-=(const Vector3D &v)
Definition Vector3D.cpp:89
float Magnitude() const
Definition Vector3D.cpp:152
void operator*=(const Vector3D &v)
Definition Vector3D.cpp:101
Vector3D()
Definition Vector3D.cpp:8
Vector3D operator-(const Vector3D &v) const
Definition Vector3D.cpp:112
void operator+=(const Vector3D &v)
Definition Vector3D.cpp:83
float y
Definition Vector3D.h:116
void operator=(const Vector3D &v)
Definition Vector3D.cpp:77
Vector3D operator/(const Vector3D &v) const
Definition Vector3D.cpp:116
void Subtract(const Vector3D &v1, const Vector3D &v2)
Definition Vector3D.cpp:33
Vector3D operator+(const Vector3D &v) const
Definition Vector3D.cpp:108
float x
Definition Vector3D.h:116
float z
Definition Vector3D.h:116
void Multiply(const Vector3D &v1, const Vector3D &v2)
Definition Vector3D.cpp:39
Vector3D CrossProduct(const Vector3D &v) const
Definition Vector3D.cpp:180
void Divide(const Vector3D &v1, const Vector3D &v2)
Definition Vector3D.cpp:45
float Dot3(const Vector3D &v) const
Definition Vector3D.cpp:148
void Add(const Vector3D &v1, const Vector3D &v2)
Definition Vector3D.cpp:27
void operator/=(const Vector3D &v)
Definition Vector3D.cpp:95
Vector3D operator*(const Vector3D &v) const
Definition Vector3D.cpp:120
Definition Archive.h:13