Files
SlimeVR-Tracker-ESP/include/util.cpp
2021-01-03 14:10:31 +03:00

15 lines
263 B
C++

#include "util.h"
#include <math.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;
}