UwUHax/math.h
2021-08-27 18:58:23 +07:00

29 lines
733 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "vmatrix.h"
#define PI 3.14159265358979323846f
#define DEG2RAD( x ) ( ( float )( x ) * ( float )( ( float )( PI ) / 180.0f ) )
#define RAD2DEG( x ) ( ( float )( x ) * ( float )( 180.0f / ( float )( PI ) ) )
#define square( x ) ( x * x )
namespace Math
{
float sseSqrt(float x);
void vectorAngles(Vector forward, Vector &angles);
float DotProduct(const float *v1, const float *v2);
VOID VectorTransform(const Vector in1, const matrix3x4_t& in2, Vector& out);
float GetFov(Vector vLocalOrigin, Vector vPosition, Vector vForward);
void CalcAngle(Vector &vSource, Vector &vDestination, Vector &qAngle);
void angleVectors(Vector angles, Vector &f);
float AngleNormalize(float angle);
}