Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::OpenXrHelper Class Reference

#include <OpenXrHelper.h>

Classes

struct  posef
 A glm based posef struct. More...

Public Types

typedef struct Engine::OpenXrHelper::posef posef
 A glm based posef struct.

Static Public Member Functions

template<typename T>
static void LoadXrFunction (XrInstance xrInstance, const std::string &functionName, T &functionPointer)
 Loads a function from openxr which is not loaded at compile time. Retrieves function pointer.
static XrPosef makeIdentityPose ()
 Makes identity pose.
static glm::mat4 poseToMatrix (const XrPosef &pose)
 Converts an XrPosef to a glm::mat4.
static glm::mat4 poseToMatrix (const OpenXrHelper::posef &pose)
 Pose of glm components to glm::mat4.
static glm::quat xrQuaternionfToGlmQuat (const XrQuaternionf &xrQuaternion)
 Turns the OpenXR quaternion into an OpenXR quaternion.
static XrQuaternionf glmQuatToXrQuaternionf (const glm::quat &glmQuaternion)
 Glm quaternion to xr quaternionf.
static glm::vec3 xrVector3fToGlmVec3 (const XrVector3f &xrVector3)
 Converts an OpenXR vector3 to a glm vector3.
static XrVector3f glmVec3ToXrVector3f (const glm::vec3 &glmVector3)
 Converts a glm::vec3 to a XrVector3f.
static float dot (const glm::quat &a, const glm::quat &b)
 Calculates the dot product between two glm quaternions.
static glm::quat lerpMix (const glm::quat &from, const glm::quat &to, float progress)
 Linearly interpolate between two quaternions.
static glm::vec3 lerpMix (const glm::vec3 &from, const glm::vec3 &to, float progress)
 Linearly interpolate between two glm vector3's.
static float lerpMix (float from, float to, float progress)
 Linearly interpolate between two float values.
static float dot (const glm::vec3 &a, const glm::vec3 &b)
 The dot product between two glm vector3's.
static glm::vec3 crossProductVector3 (const glm::vec3 &vector_a, const glm::vec3 &vector_b)
static float clampf (float num, float left, float right)
static float lengthSquared (const glm::vec3 &vec)
static float length (const glm::vec3 &vec)
static glm::vec3 normalize (const glm::vec3 &vec)
static float distanceSquared (const glm::vec3 &vec1, const glm::vec3 &vec2)
static float distance (const glm::vec3 &vec1, const glm::vec3 &vec2)
static glm::quat slerp (const glm::quat &start, const glm::quat &end, float percent)
static glm::vec3 slerp (const glm::vec3 &start, const glm::vec3 &end, float percent)
static float vectorAngleAroundNormal (const glm::vec3 &vec1, const glm::vec3 &vec2, const glm::vec3 &norm)
static glm::mat4 rotationAroundPoint (glm::vec3 point, glm::mat4 rotationMatrix)
static void quaternionToAngleAxis (const glm::quat &quat, float &angle, glm::vec3 &axis)
static glm::quat quaternionFromAngleAxis (const float &angle, const glm::vec3 &axis)
static posef xrPosefToGlmPosef (const XrPosef &xrPosef)
static glm::mat4 createProjectionMatrix (XrFovf fov, float nearClip, float farClip)
static std::string sessionStateToString (XrSessionState state)
static const char * GetXrStructureTypeName (XrStructureType type)

Detailed Description

Definition at line 10 of file OpenXrHelper.h.

Member Typedef Documentation

◆ posef

typedef struct Engine::OpenXrHelper::posef Engine::OpenXrHelper::posef

A glm based posef struct.

Member Function Documentation

◆ clampf()

float Engine::OpenXrHelper::clampf ( float num,
float left,
float right )
static

◆ createProjectionMatrix()

glm::mat4 Engine::OpenXrHelper::createProjectionMatrix ( XrFovf fov,
float nearClip,
float farClip )
static

◆ crossProductVector3()

glm::vec3 Engine::OpenXrHelper::crossProductVector3 ( const glm::vec3 & vector_a,
const glm::vec3 & vector_b )
static

◆ distance()

float Engine::OpenXrHelper::distance ( const glm::vec3 & vec1,
const glm::vec3 & vec2 )
static

◆ distanceSquared()

float Engine::OpenXrHelper::distanceSquared ( const glm::vec3 & vec1,
const glm::vec3 & vec2 )
static

◆ dot() [1/2]

float Engine::OpenXrHelper::dot ( const glm::quat & a,
const glm::quat & b )
static

Calculates the dot product between two glm quaternions.

Parameters
aA glm::quat to process.
bA glm::quat to process.
Returns
The dot product.
Date
2022-10-22
Author
janhsimon

◆ dot() [2/2]

float Engine::OpenXrHelper::dot ( const glm::vec3 & a,
const glm::vec3 & b )
static

The dot product between two glm vector3's.

Parameters
aA glm::vec3 to process.
bA glm::vec3 to process.
Returns
A float.
Date
2022-10-22
Author
janhsimon

◆ GetXrStructureTypeName()

const char * Engine::OpenXrHelper::GetXrStructureTypeName ( XrStructureType type)
static

◆ glmQuatToXrQuaternionf()

XrQuaternionf Engine::OpenXrHelper::glmQuatToXrQuaternionf ( const glm::quat & glmQuaternion)
static

Glm quaternion to xr quaternionf.

Parameters
glmQuaternionSource for the.
Returns
A XrQuaternionf.

◆ glmVec3ToXrVector3f()

XrVector3f Engine::OpenXrHelper::glmVec3ToXrVector3f ( const glm::vec3 & glmVector3)
static

Converts a glm::vec3 to a XrVector3f.

Parameters
glmVector3the glm vector3 to convert.
Returns
A XrVector3f.
Date
2022-10-22
Author
janhsimon

◆ length()

float Engine::OpenXrHelper::length ( const glm::vec3 & vec)
static

◆ lengthSquared()

float Engine::OpenXrHelper::lengthSquared ( const glm::vec3 & vec)
static

◆ lerpMix() [1/3]

glm::quat Engine::OpenXrHelper::lerpMix ( const glm::quat & from,
const glm::quat & to,
float progress )
static

Linearly interpolate between two quaternions.

Parameters
fromThe start quaternion.
tothe target quaternion.
progressA float to process.
Returns
The interpolated quaternion at progress.
Date
2022-10-22
Author
janhsimon

◆ lerpMix() [2/3]

glm::vec3 Engine::OpenXrHelper::lerpMix ( const glm::vec3 & from,
const glm::vec3 & to,
float progress )
static

Linearly interpolate between two glm vector3's.

Parameters
fromThe vector3 to interpolate from.
toThe vector3 to interpolate to.
progressThe factor of how close return is to the target.
Returns
The interpolated vector3 at progress.
Date
2022-10-22
Author
janhsimon

◆ lerpMix() [3/3]

float Engine::OpenXrHelper::lerpMix ( float from,
float to,
float progress )
static

Linearly interpolate between two float values.

Parameters
fromThe float to interpolate from.
toThe float to interpolate to.
progressThe factor of how close return is to the target. 0.0f is from 1.0f is target.
Returns
A float.
Date
2022-10-22
Author
janhsimon

◆ LoadXrFunction()

template<typename T>
void Engine::OpenXrHelper::LoadXrFunction ( XrInstance xrInstance,
const std::string & functionName,
T & functionPointer )
inlinestatic

Loads a function from openxr which is not loaded at compile time. Retrieves function pointer.

Parameters
xrInstanceThe instance.
functionNameName of the function.
[out]functionPointerThe function pointer.
Exceptions
std::runtime_errorRaised when the requested function was not found.
Template Parameters
TThe class of the function pointer.

Definition at line 35 of file OpenXrHelper.h.

◆ makeIdentityPose()

XrPosef Engine::OpenXrHelper::makeIdentityPose ( )
static

Makes identity pose.

Returns
An XrPosef.
Date
2022-10-22
Author
janhsimon

◆ normalize()

glm::vec3 Engine::OpenXrHelper::normalize ( const glm::vec3 & vec)
static

◆ poseToMatrix() [1/2]

glm::mat4 Engine::OpenXrHelper::poseToMatrix ( const OpenXrHelper::posef & pose)
static

Pose of glm components to glm::mat4.

Parameters
poseThe pose.
Returns
A glm::mat4.

◆ poseToMatrix() [2/2]

glm::mat4 Engine::OpenXrHelper::poseToMatrix ( const XrPosef & pose)
static

Converts an XrPosef to a glm::mat4.

Parameters
poseThe pose XrPose.
Returns
A glm::mat4.
Date
2022-10-22
Author
janhsimon

◆ quaternionFromAngleAxis()

glm::quat Engine::OpenXrHelper::quaternionFromAngleAxis ( const float & angle,
const glm::vec3 & axis )
static

◆ quaternionToAngleAxis()

void Engine::OpenXrHelper::quaternionToAngleAxis ( const glm::quat & quat,
float & angle,
glm::vec3 & axis )
static

◆ rotationAroundPoint()

glm::mat4 Engine::OpenXrHelper::rotationAroundPoint ( glm::vec3 point,
glm::mat4 rotationMatrix )
static

◆ sessionStateToString()

std::string Engine::OpenXrHelper::sessionStateToString ( XrSessionState state)
static

◆ slerp() [1/2]

glm::quat Engine::OpenXrHelper::slerp ( const glm::quat & start,
const glm::quat & end,
float percent )
static

◆ slerp() [2/2]

glm::vec3 Engine::OpenXrHelper::slerp ( const glm::vec3 & start,
const glm::vec3 & end,
float percent )
static

◆ vectorAngleAroundNormal()

float Engine::OpenXrHelper::vectorAngleAroundNormal ( const glm::vec3 & vec1,
const glm::vec3 & vec2,
const glm::vec3 & norm )
static

◆ xrPosefToGlmPosef()

posef Engine::OpenXrHelper::xrPosefToGlmPosef ( const XrPosef & xrPosef)
static

◆ xrQuaternionfToGlmQuat()

glm::quat Engine::OpenXrHelper::xrQuaternionfToGlmQuat ( const XrQuaternionf & xrQuaternion)
static

Turns the OpenXR quaternion into an OpenXR quaternion.

Parameters
xrQuaternionSource for the.
Returns
A glm::quat.
Date
2022-10-22
Author
janhsimon

◆ xrVector3fToGlmVec3()

glm::vec3 Engine::OpenXrHelper::xrVector3fToGlmVec3 ( const XrVector3f & xrVector3)
static

Converts an OpenXR vector3 to a glm vector3.

Parameters
xrVector3OpenXR vector3 to convert.
Returns
A glm::vec3.
Date
2022-10-22
Author
janhsimon

The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Core/OpenXrHelper.h