2022-08-01 15:11:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <math.h>
|
2024-03-20 11:23:54 +00:00
|
|
|
#include <openxr/openxr.h>
|
2022-08-01 15:11:23 +00:00
|
|
|
|
|
|
|
#ifndef EPSILON
|
|
|
|
#define EPSILON 0.001f
|
|
|
|
#endif
|
|
|
|
|
|
|
|
float ToDegrees(float rad);
|
|
|
|
float ToRadians(float deg);
|
2024-09-17 13:22:37 +00:00
|
|
|
bool IsMatrixIdentity(const float *matrix4x4);
|
2022-08-01 15:11:23 +00:00
|
|
|
|
|
|
|
// XrPosef
|
|
|
|
XrPosef XrPosef_Identity();
|
|
|
|
XrPosef XrPosef_Inverse(const XrPosef a);
|
|
|
|
|
|
|
|
// XrQuaternionf
|
|
|
|
XrQuaternionf XrQuaternionf_CreateFromVectorAngle(const XrVector3f axis, const float angle);
|
|
|
|
XrQuaternionf XrQuaternionf_Inverse(const XrQuaternionf q);
|
|
|
|
XrQuaternionf XrQuaternionf_Multiply(const XrQuaternionf a, const XrQuaternionf b);
|
|
|
|
XrVector3f XrQuaternionf_Rotate(const XrQuaternionf a, const XrVector3f v);
|
|
|
|
XrVector3f XrQuaternionf_ToEulerAngles(const XrQuaternionf q);
|
2022-11-06 19:42:28 +00:00
|
|
|
void XrQuaternionf_ToMatrix4f(const XrQuaternionf* q, float* m);
|
2022-08-01 15:11:23 +00:00
|
|
|
|
|
|
|
// XrVector3f, XrVector4f
|
|
|
|
float XrVector3f_LengthSquared(const XrVector3f v);
|
|
|
|
XrVector3f XrVector3f_GetAnglesFromVectors(const XrVector3f forward, const XrVector3f right, const XrVector3f up);
|
|
|
|
XrVector3f XrVector3f_Normalized(const XrVector3f v);
|
|
|
|
XrVector3f XrVector3f_ScalarMultiply(const XrVector3f v, float scale);
|
2022-11-06 19:42:28 +00:00
|
|
|
XrVector4f XrVector4f_MultiplyMatrix4f(const float* m, const XrVector4f* v);
|