Skip to content

Commit

Permalink
Update utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleAxeVR committed Mar 13, 2024
1 parent 9c7881f commit fe41841
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/tests/hello_xr/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ const float ROOT_OF_HALF = 0.7071067690849304f;

namespace BVR
{

template<typename T> static inline T clamp(T v, T mn, T mx)
{
return (v < mn) ? mn : (v > mx) ? mx : v;
}

inline float sign(float val)
{
return (val < 0.0f) ? -1.0f : 1.0f;
}

const glm::fquat default_rotation(1.0f, 0.0f, 0.0f, 0.0f);
const glm::fquat rotate_90_CCW_by_x(0.7071067690849304f, 0.7071067690849304f, 0.0f, 0.0f);
Expand Down Expand Up @@ -75,11 +85,6 @@ const glm::fquat down_rotation = CW_90_rotation_about_x;
const glm::fquat up_rotation = CCW_90_rotation_about_x;


template<typename T> static inline T clamp(T v, T mn, T mx)
{
return (v < mn) ? mn : (v > mx) ? mx : v;
}

XrMatrix4x4f convert_to_xr(const glm::mat4& input);
glm::mat4 convert_to_glm(const XrMatrix4x4f& input);

Expand Down Expand Up @@ -117,11 +122,6 @@ GLMPose convert_to_glm(const XrVector3f& position, const XrQuaternionf& rotation
GLMPose convert_to_glm(const XrPosef& xr_pose);
XrPosef convert_to_xr(const GLMPose& glm_pose);

inline float sign(float val)
{
return (val < 0.0f) ? -1.0f : 1.0f;
}

}

#endif
Expand Down

0 comments on commit fe41841

Please sign in to comment.