Skip to content

Commit 929f258

Browse files
committed
WebVRManager/WebXRManager: Clean up.
1 parent 3cda93f commit 929f258

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/renderers/webvr/WebVRManager.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,13 @@ function WebVRManager( renderer ) {
200200

201201
};
202202

203-
this.setDevice = function ( _device, _options ) {
203+
this.setDevice = function ( value ) {
204204

205-
if ( _device !== undefined ) device = _device;
206-
if ( _options !== undefined ) options = _options;
205+
if ( value !== undefined ) device = value;
207206

208-
animation.setContext( _device );
207+
animation.setContext( value );
208+
209+
};
209210

210211
this.setFrameOfReferenceType = function ( value ) {
211212

src/renderers/webvr/WebXRManager.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function WebXRManager( renderer ) {
1515
var device = null;
1616
var session = null;
1717

18-
var frameOfRef = null;
18+
var frameOfReference = null;
1919
var frameOfReferenceType = 'stage';
2020

2121
var pose = null;
@@ -25,8 +25,7 @@ function WebXRManager( renderer ) {
2525

2626
function isPresenting() {
2727

28-
return session !== null && frameOfRef !== null;
29-
28+
return session !== null && frameOfReference !== null;
3029

3130
}
3231

@@ -72,10 +71,10 @@ function WebXRManager( renderer ) {
7271

7372
};
7473

75-
this.setDevice = function ( _device ) {
74+
this.setDevice = function ( value ) {
7675

77-
if ( _device !== undefined ) device = _device;
78-
if ( _device instanceof XRDevice ) gl.setCompatibleXRDevice( _device );
76+
if ( value !== undefined ) device = value;
77+
if ( value instanceof XRDevice ) gl.setCompatibleXRDevice( value );
7978

8079
};
8180

@@ -101,9 +100,9 @@ function WebXRManager( renderer ) {
101100

102101
};
103102

104-
this.setSession = function ( _session ) {
103+
this.setSession = function ( value ) {
105104

106-
session = _session;
105+
session = value;
107106

108107
if ( session !== null ) {
109108

@@ -113,9 +112,9 @@ function WebXRManager( renderer ) {
113112
session.addEventListener( 'end', onSessionEnd );
114113

115114
session.baseLayer = new XRWebGLLayer( session, gl );
116-
session.requestFrameOfReference( frameOfReferenceType ).then( function ( _frameOfRef ) {
115+
session.requestFrameOfReference( frameOfReferenceType ).then( function ( value ) {
117116

118-
frameOfRef = _frameOfRef;
117+
frameOfReference = value;
119118

120119
renderer.setFramebuffer( session.baseLayer.framebuffer );
121120

@@ -200,7 +199,7 @@ function WebXRManager( renderer ) {
200199

201200
function onAnimationFrame( time, frame ) {
202201

203-
pose = frame.getDevicePose( frameOfRef );
202+
pose = frame.getDevicePose( frameOfReference );
204203

205204
if ( pose !== null ) {
206205

@@ -243,7 +242,7 @@ function WebXRManager( renderer ) {
243242

244243
if ( inputSource ) {
245244

246-
var inputPose = frame.getInputPose( inputSource, frameOfRef );
245+
var inputPose = frame.getInputPose( inputSource, frameOfReference );
247246

248247
if ( inputPose !== null ) {
249248

0 commit comments

Comments
 (0)