Skip to content

Commit 3148b9e

Browse files
committed
Updated builds.
1 parent 78d002f commit 3148b9e

File tree

3 files changed

+501
-475
lines changed

3 files changed

+501
-475
lines changed

build/three.js

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21246,7 +21246,7 @@
2124621246
var standingMatrix = new Matrix4();
2124721247
var standingMatrixInverse = new Matrix4();
2124821248

21249-
var options = { frameOfReferenceType: 'stage' };
21249+
var frameOfReferenceType = 'stage';
2125021250

2125121251
if ( typeof window !== 'undefined' && 'VRFrameData' in window ) {
2125221252

@@ -21422,12 +21422,17 @@
2142221422

2142321423
};
2142421424

21425-
this.setDevice = function ( _device, _options ) {
21425+
this.setDevice = function ( value ) {
2142621426

21427-
if ( _device !== undefined ) device = _device;
21428-
if ( _options !== undefined ) options = _options;
21427+
if ( value !== undefined ) device = value;
2142921428

21430-
animation.setContext( _device );
21429+
animation.setContext( value );
21430+
21431+
};
21432+
21433+
this.setFrameOfReferenceType = function ( value ) {
21434+
21435+
frameOfReferenceType = value;
2143121436

2143221437
};
2143321438

@@ -21439,9 +21444,11 @@
2143921444

2144021445
this.getCamera = function ( camera ) {
2144121446

21447+
var userHeight = frameOfReferenceType === 'stage' ? 1.6 : 0;
21448+
2144221449
if ( device === null ) {
2144321450

21444-
camera.position.set( 0, 1.6, 0 );
21451+
camera.position.set( 0, userHeight, 0 );
2144521452
return camera;
2144621453

2144721454
}
@@ -21453,7 +21460,7 @@
2145321460

2145421461
//
2145521462

21456-
if ( options.frameOfReferenceType === 'stage' ) {
21463+
if ( frameOfReferenceType === 'stage' ) {
2145721464

2145821465
var stageParameters = device.stageParameters;
2145921466

@@ -21463,7 +21470,7 @@
2146321470

2146421471
} else {
2146521472

21466-
standingMatrix.makeTranslation( 0, 1.6, 0 );
21473+
standingMatrix.makeTranslation( 0, userHeight, 0 );
2146721474

2146821475
}
2146921476

@@ -21515,7 +21522,7 @@
2151521522

2151621523
standingMatrixInverse.getInverse( standingMatrix );
2151721524

21518-
if ( options.frameOfReferenceType === 'stage' ) {
21525+
if ( frameOfReferenceType === 'stage' ) {
2151921526

2152021527
cameraL.matrixWorldInverse.multiply( standingMatrixInverse );
2152121528
cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
@@ -21621,7 +21628,8 @@
2162121628
var device = null;
2162221629
var session = null;
2162321630

21624-
var frameOfRef = null;
21631+
var frameOfReference = null;
21632+
var frameOfReferenceType = 'stage';
2162521633

2162621634
var pose = null;
2162721635

@@ -21630,8 +21638,7 @@
2163021638

2163121639
function isPresenting() {
2163221640

21633-
return session !== null && frameOfRef !== null;
21634-
21641+
return session !== null && frameOfReference !== null;
2163521642

2163621643
}
2163721644

@@ -21677,10 +21684,10 @@
2167721684

2167821685
};
2167921686

21680-
this.setDevice = function ( _device ) {
21687+
this.setDevice = function ( value ) {
2168121688

21682-
if ( _device !== undefined ) device = _device;
21683-
if ( _device instanceof XRDevice ) gl.setCompatibleXRDevice( _device );
21689+
if ( value !== undefined ) device = value;
21690+
if ( value instanceof XRDevice ) gl.setCompatibleXRDevice( value );
2168421691

2168521692
};
2168621693

@@ -21700,9 +21707,15 @@
2170021707

2170121708
}
2170221709

21703-
this.setSession = function ( _session, _options ) {
21710+
this.setFrameOfReferenceType = function ( value ) {
21711+
21712+
frameOfReferenceType = value;
21713+
21714+
};
21715+
21716+
this.setSession = function ( value ) {
2170421717

21705-
session = _session;
21718+
session = value;
2170621719

2170721720
if ( session !== null ) {
2170821721

@@ -21712,9 +21725,9 @@
2171221725
session.addEventListener( 'end', onSessionEnd );
2171321726

2171421727
session.baseLayer = new XRWebGLLayer( session, gl );
21715-
session.requestFrameOfReference( _options.frameOfReferenceType ).then( function ( _frameOfRef ) {
21728+
session.requestFrameOfReference( frameOfReferenceType ).then( function ( value ) {
2171621729

21717-
frameOfRef = _frameOfRef;
21730+
frameOfReference = value;
2171821731

2171921732
renderer.setFramebuffer( session.baseLayer.framebuffer );
2172021733

@@ -21799,7 +21812,7 @@
2179921812

2180021813
function onAnimationFrame( time, frame ) {
2180121814

21802-
pose = frame.getDevicePose( frameOfRef );
21815+
pose = frame.getDevicePose( frameOfReference );
2180321816

2180421817
if ( pose !== null ) {
2180521818

@@ -21842,7 +21855,7 @@
2184221855

2184321856
if ( inputSource ) {
2184421857

21845-
var inputPose = frame.getInputPose( inputSource, frameOfRef );
21858+
var inputPose = frame.getInputPose( inputSource, frameOfReference );
2184621859

2184721860
if ( inputPose !== null ) {
2184821861

0 commit comments

Comments
 (0)