cardboard-vr-display
Advanced tools
Comparing version 1.0.11 to 1.0.12
{ | ||
"name": "cardboard-vr-display", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"homepage": "https://github.com/immersive-web/cardboard-vr-display", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -91,2 +91,31 @@ # cardboard-vr-display | ||
const options = { | ||
// Optionally inject custom Viewer parameters as an option. Each item | ||
// in the array must be an object with the following properties; here is | ||
// an example of the built in CardboardV2 viewer: | ||
// | ||
// { | ||
// id: 'CardboardV2', | ||
// label: 'Cardboard I/O 2015', | ||
// fov: 60, | ||
// interLensDistance: 0.064, | ||
// baselineLensDistance: 0.035, | ||
// screenLensDistance: 0.039, | ||
// distortionCoefficients: [0.34, 0.55], | ||
// inverseCoefficients: [-0.33836704, -0.18162185, 0.862655, -1.2462051, | ||
// 1.0560602, -0.58208317, 0.21609078, -0.05444823, 0.009177956, | ||
// -9.904169E-4, 6.183535E-5, -1.6981803E-6] | ||
// } | ||
// Added in 1.0.12. | ||
ADDITIONAL_VIEWERS: [], | ||
// Select the viewer by ID. If unspecified, defaults to 'CardboardV1'. | ||
// Added in 1.0.12. | ||
DEFAULT_VIEWER: '', | ||
// By default, on mobile, a wakelock is necessary to prevent the device's screen | ||
// from turning off without user input. Disable if you're keeping the screen awake through | ||
// other means on mobile. A wakelock is never used on desktop. | ||
// Added in 1.0.3. | ||
MOBILE_WAKE_LOCK: true, | ||
// Whether or not CardboardVRDisplay is in debug mode. Logs extra | ||
@@ -93,0 +122,0 @@ // messages. Added in 1.0.2. |
@@ -64,5 +64,6 @@ /* | ||
this.dpdb_ = new Dpdb(this.config.DPDB_URL, this.onDeviceParamsUpdated_.bind(this)); | ||
this.deviceInfo_ = new DeviceInfo(this.dpdb_.getDeviceParams()); | ||
this.deviceInfo_ = new DeviceInfo(this.dpdb_.getDeviceParams(), | ||
config.ADDITIONAL_VIEWERS); | ||
this.viewerSelector_ = new ViewerSelector(); | ||
this.viewerSelector_ = new ViewerSelector(config.DEFAULT_VIEWER); | ||
this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)); | ||
@@ -69,0 +70,0 @@ |
@@ -84,6 +84,10 @@ /* | ||
*/ | ||
function DeviceInfo(deviceParams) { | ||
function DeviceInfo(deviceParams, additionalViewers) { | ||
this.viewer = Viewers.CardboardV2; | ||
this.updateDeviceParams(deviceParams); | ||
this.distortion = new Distortion(this.viewer.distortionCoefficients); | ||
for (var i = 0; i < additionalViewers.length; i++) { | ||
var viewer = additionalViewers[i]; | ||
Viewers[viewer.id] = new CardboardViewer(viewer); | ||
} | ||
} | ||
@@ -90,0 +94,0 @@ |
@@ -17,2 +17,26 @@ /* | ||
const config = { | ||
// Optionally inject custom Viewer parameters as an option. Each item | ||
// in the array must be an object with the following properties; here is | ||
// an example of the built in CardboardV2 viewer: | ||
// | ||
// { | ||
// id: 'CardboardV2', | ||
// label: 'Cardboard I/O 2015', | ||
// fov: 60, | ||
// interLensDistance: 0.064, | ||
// baselineLensDistance: 0.035, | ||
// screenLensDistance: 0.039, | ||
// distortionCoefficients: [0.34, 0.55], | ||
// inverseCoefficients: [-0.33836704, -0.18162185, 0.862655, -1.2462051, | ||
// 1.0560602, -0.58208317, 0.21609078, -0.05444823, 0.009177956, | ||
// -9.904169E-4, 6.183535E-5, -1.6981803E-6] | ||
// } | ||
// Added in 1.0.12. | ||
ADDITIONAL_VIEWERS: [], | ||
// Select the viewer by ID. If unspecified, defaults to 'CardboardV1'. | ||
// Added in 1.0.12. | ||
DEFAULT_VIEWER: '', | ||
// By default, on mobile, a wakelock is necessary to prevent the device's screen | ||
@@ -19,0 +43,0 @@ // from turning off without user input. Disable if you're keeping the screen awake through |
@@ -28,3 +28,3 @@ /* | ||
*/ | ||
function ViewerSelector() { | ||
function ViewerSelector(defaultViewer) { | ||
// Try to load the selected key from local storage. | ||
@@ -39,3 +39,3 @@ try { | ||
if (!this.selectedKey) { | ||
this.selectedKey = DEFAULT_VIEWER; | ||
this.selectedKey = defaultViewer || DEFAULT_VIEWER; | ||
} | ||
@@ -42,0 +42,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
421294
7693
218