6 Vector2::Vector2(const Vector3 &v)
11 Vector3::Vector3(const Vector4 &v)
12 : x(v.x), y(v.y), z(v.z)
16 Vector3 operator *(const Vector3 &v, const Matrix4x4 &m)
18 float x = v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0] + m[3][0];
19 float y = v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1] + m[3][1];
20 float z = v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2] + m[3][2];
21 return Vector3(x, y, z);
24 Vector3 operator *(const Matrix4x4 &m, const Vector3 &v)
26 float x = m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3];
27 float y = m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3];
28 float z = m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3];
29 return Vector3(x, y, z);
32 Vector4::Vector4(const Vector3 &v)
33 : x(v.x), y(v.y), z(v.z), w(1.0f)