24 Vec3() : x(0.0f), y(0.0f), z(0.0f) {}
32 Vec3(
float x,
float y,
float z) : x(x), y(y), z(z) {}
40 Vec3(
int x,
int y,
int z) : x((float)x), y((float)y), z((float)z) {}
74 return float(sqrt((x*x) + (y*y) + (z*z)));
84 Vec3 normalised =
Vec3(x / magnitude, y / magnitude, z / magnitude);
112 vecOut.
x = vecInA.
x - vecInB.
x;
113 vecOut.
y = vecInA.
y - vecInB.
y;
114 vecOut.
z = vecInA.
z - vecInB.
z;
127 vecOut.
x = vecInA.
x + vecInB.
x;
128 vecOut.
y = vecInA.
y + vecInB.
y;
129 vecOut.
z = vecInA.
z + vecInB.
z;
142 vecOut.
x = vecInA.
x / scalar;
143 vecOut.
y = vecInA.
y / scalar;
144 vecOut.
z = vecInA.
z / scalar;
157 vecOut.
x = vecInA.
x * scalar;
158 vecOut.
y = vecInA.
y * scalar;
159 vecOut.
z = vecInA.
z * scalar;
172 vecOut.
x = vecInA.
x * vecInB.
x;
173 vecOut.
y = vecInA.
y * vecInB.
y;
174 vecOut.
z = vecInA.
z * vecInB.
z;
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:16
Vec3 getNormalised()
Returns a normalised version of the Vec3.
Definition: Vec3.h:81
Vec3(int x, int y, int z)
Constructs the Vec3 setting the values to the input coordinates.
Definition: Vec3.h:40
Mat4 operator-(Mat4 mInA, float s)
Overloads the - operator allowing a Mat4 to be added to a scalar.
Definition: Mat4.h:216
float y
Definition: Vec3.h:19
Vec3 * operator-=(Vec3 vecIn)
Overloads the -= operator.
Definition: Vec3.h:60
Vec2 operator/(Vec2 vecInA, float scalar)
Overloads the / operator allowing a Vec2 to be divided by a scalar.
Definition: Vec2.h:121
Mat4 operator*(Mat4 mInA, float s)
Overloads the * operator allowing a Mat4 to be multiplied to a scalar.
Definition: Mat4.h:248
Vec3()
Constructs the Vec3 setting the values to 0,0,0.
Definition: Vec3.h:24
Mat4 operator+(Mat4 mIn, float s)
Overloads the + operator allowing a Mat4 to be added to a scalar.
Definition: Mat4.h:184
Vec3 * operator+=(Vec3 vecIn)
Overloads the += operator.
Definition: Vec3.h:47
float getLength()
Returns the length of the Vec3.
Definition: Vec3.h:72
The namespace for all maths code.
Definition: Convert.cpp:5
float z
Definition: Vec3.h:19
Vec3(float x, float y, float z)
Constructs the Vec3 setting the values to the input coordinates.
Definition: Vec3.h:32
float x
Position variables.
Definition: Vec3.h:19