/// <summary> /// Computes updated 'uvScaleOffsetOut' to be used with a distortion if render target size or /// viewport changes after the fact. This can be used to adjust render size every frame if desired. /// </summary> public Vector2f[] GetRenderScaleAndOffset(FovPort fov, Sizei textureSize, Recti renderViewport) { Vector2f[] uvScaleOffsetOut = new Vector2f[] { new Vector2f(), new Vector2f() }; ovrHmd_GetRenderScaleAndOffset(fov, textureSize, renderViewport, uvScaleOffsetOut); return uvScaleOffsetOut; }
private static extern Matrix4f_Raw ovrMatrix4f_OrthoSubProjection( Matrix4f projection, Vector2f orthoScale, float orthoDistance, float hmdToEyeViewOffsetX);
/// <summary> /// Used for 2D rendering, Y is down /// orthoScale = 1.0f / pixelsPerTanAngleAtCenter /// orthoDistance = distance from camera, such as 0.8m /// </summary> public static Matrix4f GetOrthoSubProjection(Matrix4f projection, Vector2f orthoScale, float orthoDistance, float hmdToEyeViewOffsetX) { return new Matrix4f(ovrMatrix4f_OrthoSubProjection(projection, orthoScale, orthoDistance, hmdToEyeViewOffsetX)); }