16 Vec4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f) {}
25 Vec4(
float x,
float y,
float z,
float w) : x(x), y(y), z(z), w(w) {}
34 Vec4(
int x,
int y,
int z,
int w) : x((float)x), y((float)y), z((float)z), w((float)w) {}
70 return float(sqrt((w*w) + (x*x) + (y*y) + (z*z)));
98 vecOut.
x = vecInA.
x - vecInB.
x;
99 vecOut.
y = vecInA.
y - vecInB.
y;
100 vecOut.
z = vecInA.
z - vecInB.
z;
101 vecOut.
w = vecInA.
w - vecInB.
w;
114 vecOut.
x = vecInA.
x + vecInB.
x;
115 vecOut.
y = vecInA.
y + vecInB.
y;
116 vecOut.
z = vecInA.
z + vecInB.
z;
117 vecOut.
w = vecInA.
w + vecInB.
w;
130 vecOut.
x = vecInA.
x / scalar;
131 vecOut.
y = vecInA.
y / scalar;
132 vecOut.
z = vecInA.
z / scalar;
133 vecOut.
w = vecInA.
w / scalar;
146 vecOut.
x = vecInA.
x * scalar;
147 vecOut.
y = vecInA.
y * scalar;
148 vecOut.
z = vecInA.
z * scalar;
149 vecOut.
w = vecInA.
w * scalar;
162 vecOut.
x = vecInA.
x * vecInB.
x;
163 vecOut.
y = vecInA.
y * vecInB.
y;
164 vecOut.
z = vecInA.
z * vecInB.
z;
165 vecOut.
w = vecInA.
w * vecInB.
w;
float y
Definition: Vec4.h:11
Vec4 operator*(Vec4 vecInA, float scalar)
Overloads the * operator allowing a Vec4 to be multiplied by a scalar.
Definition: Vec4.h:143
Vec4(float x, float y, float z, float w)
Constructs the Vec4 setting the values to the input coordinates.
Definition: Vec4.h:25
Contains the Vec4 structure with functions and overloaded operators.
Definition: Vec4.h:8
Vec4(int x, int y, int z, int w)
Constructs the Vec4 setting the values to the input coordinates.
Definition: Vec4.h:34
Vec4 operator/(Vec4 vecInA, float scalar)
Overloads the / operator allowing a Vec4 to be divided by a scalar.
Definition: Vec4.h:127
Vec4 * operator+=(Vec4 vecIn)
Overloads the += operator.
Definition: Vec4.h:41
float getLength()
Returns the length of the Vec4.
Definition: Vec4.h:68
float x
Position variables.
Definition: Vec4.h:11
Vec4()
Constructs the Vec4 setting the values to 0,0,0,0.
Definition: Vec4.h:16
float w
Definition: Vec4.h:11
float z
Definition: Vec4.h:11
Vec4 operator+(Vec4 vecInA, Vec4 vecInB)
Overloads the + operator.
Definition: Vec4.h:111
Vec4 operator-(Vec4 vecIn)
Overloads the - operator allowing a Vec4 to be inverted.
Definition: Vec4.h:79
Vec4 * operator-=(Vec4 vecIn)
Overloads the -= operator.
Definition: Vec4.h:55