Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
getVRStatus feels slightly subjective, suggesting we use inVR instead…
Browse files Browse the repository at this point in the history
… to query if we're in VR

Summary: Suggested function name change for discussion

Reviewed By: mikearmstrong001

Differential Revision: D5103570

fbshipit-source-id: f368271
  • Loading branch information
lustyj authored and facebook-github-bot committed May 26, 2017
1 parent 9268f69 commit 3dfbbc8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Libraries/Utilities/VrHeadModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ class VrHeadModelImpl {
constructor() {
this.headMatrix = MatrixMath.createIdentityMatrix();
this.viewMatrix = MatrixMath.createIdentityMatrix();
this.inVR = false;
this._inVR = false;
this.fov = 0;
this.aspect = 1;
this._headMatrixListener = RCTDeviceEventEmitter.addListener(
'onReceivedHeadMatrix',
this._onReceivedHeadMatrix.bind(this)
);
RCTDeviceEventEmitter.addListener('onEnterVR', () => {
this.inVR = true;
this._inVR = true;
});
RCTDeviceEventEmitter.addListener('onExitVR', () => {
this.inVR = false;
this._inVR = false;
});
}

Expand Down Expand Up @@ -165,7 +165,15 @@ class VrHeadModelImpl {
* Return true if the headset is currently used
*/
getVRStatus() {
return this.inVR;
console.warn('getVRStatus is deprecated. Please use inVR instead');
return this._inVR;
}

/**
* Return true if using a VR headset, false if viewing outside of VR
*/
inVR() {
return this._inVR;
}
}

Expand Down

0 comments on commit 3dfbbc8

Please sign in to comment.