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
This commit is contained in:
MiiBond 2016-12-28 11:20:02 -08:00 committed by Andy
parent ca97700515
commit 6cde81ffcf

20
webvr-api/index.d.ts vendored
View File

@ -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;