fixed cam distance
This commit is contained in:
@@ -35,9 +35,14 @@ Vec3<T> operator- (const Vec3<T>& vect, const Vec3<T>& other) {
|
||||
return vect + (-other);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T Length(const Vec3<T>& vect) {
|
||||
return std::sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Vec3<T> Normalize(const Vec3<T>& vect) {
|
||||
T length = std::sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z);
|
||||
T length = Length(vect);
|
||||
|
||||
return { vect.x / length, vect.y / length, vect.z / length };
|
||||
}
|
||||
@@ -68,6 +73,11 @@ T Dot(const Vec4<T>& vect, const Vec4<T>& other) {
|
||||
return vect.x * other.x + vect.y * other.y + vect.z * other.z + vect.w * other.w;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T Distance(const Vec3<T>& vect, const Vec3<T>& other) {
|
||||
return Length(vect - other);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Matricies //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user