|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Conversion and math helpers used by the OpenXR integration. More...
#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) |
| Computes the cross product of two vectors. | |
| static float | clampf (float num, float left, float right) |
| Clamps a float to an inclusive range. | |
| static float | lengthSquared (const glm::vec3 &vec) |
| Computes squared vector length. | |
| static float | length (const glm::vec3 &vec) |
| Computes vector length. | |
| static glm::vec3 | normalize (const glm::vec3 &vec) |
| Normalizes a vector. | |
| static float | distanceSquared (const glm::vec3 &vec1, const glm::vec3 &vec2) |
| Computes squared distance between two vectors. | |
| static float | distance (const glm::vec3 &vec1, const glm::vec3 &vec2) |
| Computes distance between two vectors. | |
| static glm::quat | slerp (const glm::quat &start, const glm::quat &end, float percent) |
| Spherically interpolates between two quaternions. | |
| static glm::vec3 | slerp (const glm::vec3 &start, const glm::vec3 &end, float percent) |
| Spherically interpolates between two direction vectors. | |
| static float | vectorAngleAroundNormal (const glm::vec3 &vec1, const glm::vec3 &vec2, const glm::vec3 &norm) |
| Computes the signed angle between two vectors around a normal. | |
| static glm::mat4 | rotationAroundPoint (glm::vec3 point, glm::mat4 rotationMatrix) |
| Builds a transform that applies a rotation around a point. | |
| static void | quaternionToAngleAxis (const glm::quat &quat, float &angle, glm::vec3 &axis) |
| Converts a quaternion to angle-axis form. | |
| static glm::quat | quaternionFromAngleAxis (const float &angle, const glm::vec3 &axis) |
| Creates a quaternion from angle-axis form. | |
| static posef | xrPosefToGlmPosef (const XrPosef &xrPosef) |
| Converts an OpenXR pose to a GLM-backed pose. | |
| static glm::mat4 | createProjectionMatrix (XrFovf fov, float nearClip, float farClip) |
| Creates a reverse-Z projection matrix from OpenXR field-of-view angles. | |
| static std::string | sessionStateToString (XrSessionState state) |
| Converts an OpenXR session state to its symbolic name. | |
| static const char * | GetXrStructureTypeName (XrStructureType type) |
| Converts an OpenXR structure type to its symbolic name. | |
Conversion and math helpers used by the OpenXR integration.
Definition at line 13 of file OpenXrHelper.h.
| typedef struct Engine::OpenXrHelper::posef Engine::OpenXrHelper::posef |
A glm based posef struct.
|
static |
Clamps a float to an inclusive range.
| num | Value to clamp. |
| left | Lower bound. |
| right | Upper bound. |
|
static |
Creates a reverse-Z projection matrix from OpenXR field-of-view angles.
| fov | OpenXR field of view. |
| nearClip | Near clip plane distance. |
| farClip | Far clip plane distance. |
|
static |
Computes the cross product of two vectors.
| vector_a | First vector. |
| vector_b | Second vector. |
|
static |
Computes distance between two vectors.
| vec1 | First point. |
| vec2 | Second point. |
|
static |
Computes squared distance between two vectors.
| vec1 | First point. |
| vec2 | Second point. |
|
static |
Calculates the dot product between two glm quaternions.
| a | A glm::quat to process. |
| b | A glm::quat to process. |
|
static |
The dot product between two glm vector3's.
| a | A glm::vec3 to process. |
| b | A glm::vec3 to process. |
|
static |
Converts an OpenXR structure type to its symbolic name.
| type | Structure type to convert. |
|
static |
Glm quaternion to xr quaternionf.
| glmQuaternion | Source for the. |
|
static |
Converts a glm::vec3 to a XrVector3f.
| glmVector3 | the glm vector3 to convert. |
|
static |
Computes vector length.
| vec | Vector to measure. |
|
static |
Computes squared vector length.
| vec | Vector to measure. |
vec with itself.
|
static |
Linearly interpolate between two quaternions.
| from | The start quaternion. |
| to | the target quaternion. |
| progress | A float to process. |
|
static |
Linearly interpolate between two glm vector3's.
| from | The vector3 to interpolate from. |
| to | The vector3 to interpolate to. |
| progress | The factor of how close return is to the target. |
|
static |
Linearly interpolate between two float values.
| from | The float to interpolate from. |
| to | The float to interpolate to. |
| progress | The factor of how close return is to the target. 0.0f is from 1.0f is target. |
|
inlinestatic |
Loads a function from openxr which is not loaded at compile time. Retrieves function pointer.
| xrInstance | The instance. | |
| functionName | Name of the function. | |
| [out] | functionPointer | The function pointer. |
| std::runtime_error | Raised when the requested function was not found. |
| T | The class of the function pointer. |
Definition at line 38 of file OpenXrHelper.h.
|
static |
Makes identity pose.
|
static |
Normalizes a vector.
| vec | Vector to normalize. |
|
static |
Pose of glm components to glm::mat4.
| pose | The pose. |
|
static |
Converts an XrPosef to a glm::mat4.
| pose | The pose XrPose. |
|
static |
Creates a quaternion from angle-axis form.
| angle | Rotation angle in radians. |
| axis | Rotation axis. |
|
static |
Converts a quaternion to angle-axis form.
| quat | Quaternion to convert. |
| angle | Receives the angle in radians. |
| axis | Receives the rotation axis. |
|
static |
Builds a transform that applies a rotation around a point.
| point | Pivot point. |
| rotationMatrix | Rotation matrix to apply around the pivot. |
|
static |
Converts an OpenXR session state to its symbolic name.
| state | Session state to convert. |
|
static |
Spherically interpolates between two quaternions.
| start | Start quaternion. |
| end | Target quaternion. |
| percent | Interpolation factor. |
|
static |
Spherically interpolates between two direction vectors.
| start | Start direction. |
| end | Target direction. |
| percent | Interpolation factor. |
|
static |
Computes the signed angle between two vectors around a normal.
| vec1 | First normalized vector. |
| vec2 | Second normalized vector. |
| norm | Normal that defines the positive rotation direction. |
|
static |
Converts an OpenXR pose to a GLM-backed pose.
| xrPosef | OpenXR pose to convert. |
|
static |
Turns the OpenXR quaternion into an OpenXR quaternion.
| xrQuaternion | Source for the. |
|
static |
Converts an OpenXR vector3 to a glm vector3.
| xrVector3 | OpenXR vector3 to convert. |