Class XROcclusionFrameExtensions
- Namespace
- Uralstech.UXR.QuestMeshing
Extensions for Unity's XROcclusionFrame.
public static class XROcclusionFrameExtensions
- Inheritance
-
objectXROcclusionFrameExtensions
Methods
GetBaseFrameData(XROcclusionFrame, Matrix4x4[], Matrix4x4[], out Vector4)
Constructs:
- A perspective projection matrix for each eye
- The view matrix for each eye from its Pose
- Parameters used for handling the depth buffer for shaders using "_EnvironmentDepthZBufferParams".
for a given XROcclusionFrame.
public static bool GetBaseFrameData(this XROcclusionFrame frame, Matrix4x4[] projectionMatrices, Matrix4x4[] viewMatrices, out Vector4 zBufferParams)
Parameters
frameXROcclusionFrameprojectionMatricesMatrix4x4[]The array to populate the projection matrices in, must be of length 2.
viewMatricesMatrix4x4[]The array to populate the view matrices in, must be of length 2.
zBufferParamsVector4Resulting depth buffer parameters for "_EnvironmentDepthZBufferParams".
Returns
- bool
A boolean representing the success of the operation.
GetZBufferParams(XRNearFarPlanes)
Calculates parameters used for handling the depth buffer for shaders using "_EnvironmentDepthZBufferParams".
public static Vector4 GetZBufferParams(this XRNearFarPlanes planes)
Parameters
planesXRNearFarPlanes
Returns
- Vector4
The depth buffer parameters.
TryGetReprojectionMatrices(XROcclusionFrame, Matrix4x4, Matrix4x4[], Matrix4x4[], Matrix4x4[], out Vector4)
Uses data from GetBaseFrameData(XROcclusionFrame, Matrix4x4[], Matrix4x4[], out Vector4) to construct reprojection matrices which can be used to convert world space points to points in the depth texture.
public static bool TryGetReprojectionMatrices(this XROcclusionFrame frame, Matrix4x4 worldToLocalMatrix, Matrix4x4[] reprojectionMatrices, Matrix4x4[] projectionMatrices, Matrix4x4[] viewMatrices, out Vector4 zBufferParams)
Parameters
frameXROcclusionFrameworldToLocalMatrixMatrix4x4A matrix used to convert world space points into the local space of the XR session.
reprojectionMatricesMatrix4x4[]The array to populate the reprojection matrices in, must be of length 2.
projectionMatricesMatrix4x4[]viewMatricesMatrix4x4[]zBufferParamsVector4
Returns
- bool