Files
SlimeVR-Tracker-ESP/lib/math/helper_3dmath.cpp
2021-03-05 05:52:43 +03:00

14 lines
254 B
C++

#include "helper_3dmath.h"
float vector_dot(float a[3], float b[3])
{
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
void vector_normalize(float a[3])
{
float mag = sqrt(vector_dot(a, a));
a[0] /= mag;
a[1] /= mag;
a[2] /= mag;
}