From 6cde81ffcfae8fbc2e4650546bebb9fe6b9d133e Mon Sep 17 00:00:00 2001 From: MiiBond Date: Wed, 28 Dec 2016 11:20:02 -0800 Subject: [PATCH] Adding VRDevice.getFrameData and VRFrameData defs (#13519) * Adding getFrameData and VRFrameData defs * Fixing some spacing * Making VRFrameData a class * Changing type of timestamp to number --- webvr-api/index.d.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/webvr-api/index.d.ts b/webvr-api/index.d.ts index 370941d739..6300d12b78 100644 --- a/webvr-api/index.d.ts +++ b/webvr-api/index.d.ts @@ -32,6 +32,12 @@ declare class VRDisplay extends EventTarget { */ displayName: string; + /** + * Populates the passed VRFrameData with the information required to render + * the current frame. + */ + getFrameData(frameData: VRFrameData): boolean; + /** * Return a VRPose containing the future predicted pose of the VRDisplay * when the current frame will be presented. The value returned will not @@ -40,7 +46,7 @@ declare class VRDisplay extends EventTarget { * The VRPose will contain the position, orientation, velocity, * and acceleration of each of these properties. */ - getPose() : VRPose; + getPose(): VRPose; /** * Return the current instantaneous pose of the VRDisplay, with no @@ -152,6 +158,18 @@ interface VRPose { angularAcceleration: Float32Array; } +declare class VRFrameData { + timestamp: number; // Should be DOMHighResTimeStamp + + leftProjectionMatrix: Float32Array; + leftViewMatrix: Float32Array; + + rightProjectionMatrix: Float32Array; + rightViewMatrix: Float32Array; + + pose: VRPose; +} + interface VREyeParameters { offset: Float32Array;