47 return std::sqrt(_v[0] * _v[0] + _v[1] * _v[1] + _v[2] * _v[2]);
53 if (std::abs(len) <= 0.000000000001)
63 return v1._v[0] * v2._v[0] + v1._v[1] * v2._v[1] + v1._v[2] * v2._v[2];
69 v1._v[1] * v2._v[2] - v1._v[2] * v2._v[1],
70 v1._v[2] * v2._v[0] - v1._v[0] * v2._v[2],
71 v1._v[0] * v2._v[1] - v1._v[1] * v2._v[0]);
The Vector3 class represents a vector or vertex in 3D space.
static double DotProduct(const Vector3 &v1, const Vector3 &v2)
Returns the dot product of v1 and v2.
Vector3()=default
Constructs a null vector, i.e.
double Length() const
Returns the length of the vector from the origin.
static Vector3 CrossProduct(const Vector3 &v1, const Vector3 &v2)
Returns the cross-product of vectors v1 and v2, which corresponds to the normal vector of a plane def...
void Normalize()
Normalizes the currect vector in place.