mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
c7e761255a
MozReview-Commit-ID: HTHqehkUMwC --HG-- extra : rebase_source : dee4245fcdee8f054703287fc5c321bd55ffc8f1
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
|
|
var VRServiceTest;
|
|
var vrMockDisplay;
|
|
|
|
var VRSimulationDriver = (function() {
|
|
"use strict";
|
|
|
|
var AttachWebVRDisplay = function() {
|
|
var promise = VRServiceTest.attachVRDisplay("VRDisplayTest");
|
|
promise.then(function (display) {
|
|
assert_true(display != null, "AttachWebVRDisplay should success.");
|
|
vrMockDisplay = display;
|
|
});
|
|
|
|
return promise;
|
|
};
|
|
|
|
var SetVRDisplayPose = function(position,
|
|
linearVelocity, linearAcceleration,
|
|
orientation, angularVelocity,
|
|
angularAcceleration) {
|
|
vrMockDisplay.setPose(position, linearVelocity, linearAcceleration,
|
|
orientation, angularVelocity, angularAcceleration);
|
|
};
|
|
|
|
var SetEyeResolution = function(width, height) {
|
|
vrMockDisplay.setEyeResolution(width, height);
|
|
}
|
|
|
|
var SetEyeParameter = function(eye, offsetX, offsetY, offsetZ,
|
|
upDegree, rightDegree, downDegree, leftDegree) {
|
|
vrMockDisplay.setEyeParameter(eye, offsetX, offsetY, offsetZ, upDegree, rightDegree,
|
|
downDegree, leftDegree);
|
|
}
|
|
|
|
var UpdateVRDisplay = function() {
|
|
vrMockDisplay.update();
|
|
}
|
|
|
|
var API = {
|
|
AttachWebVRDisplay: AttachWebVRDisplay,
|
|
SetVRDisplayPose: SetVRDisplayPose,
|
|
SetEyeResolution: SetEyeResolution,
|
|
SetEyeParameter: SetEyeParameter,
|
|
UpdateVRDisplay: UpdateVRDisplay,
|
|
|
|
none: false
|
|
};
|
|
|
|
return API;
|
|
|
|
}()); |