Skip to content

Commit 28894cc

Browse files
committed
r91
1 parent 935739b commit 28894cc

File tree

6 files changed

+769
-637
lines changed

6 files changed

+769
-637
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please also include a live example if possible. You can start from these templat
1919
##### Three.js version
2020

2121
- [ ] Dev
22-
- [ ] r90
22+
- [ ] r91
2323
- [ ] ...
2424

2525
##### Browser

build/three.js

Lines changed: 111 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185

186186
} );
187187

188-
var REVISION = '91dev';
188+
var REVISION = '91';
189189
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
190190
var CullFaceNone = 0;
191191
var CullFaceBack = 1;
@@ -13749,15 +13749,15 @@
1374913749

1375013750
Object.assign( Triangle, {
1375113751

13752-
normal: function () {
13752+
getNormal: function () {
1375313753

1375413754
var v0 = new Vector3();
1375513755

13756-
return function normal( a, b, c, target ) {
13756+
return function getNormal( a, b, c, target ) {
1375713757

1375813758
if ( target === undefined ) {
1375913759

13760-
console.warn( 'THREE.Triangle: .normal() target is now required' );
13760+
console.warn( 'THREE.Triangle: .getNormal() target is now required' );
1376113761
target = new Vector3();
1376213762

1376313763
}
@@ -13781,13 +13781,13 @@
1378113781

1378213782
// static/instance method to calculate barycentric coordinates
1378313783
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
13784-
barycoordFromPoint: function () {
13784+
getBarycoord: function () {
1378513785

1378613786
var v0 = new Vector3();
1378713787
var v1 = new Vector3();
1378813788
var v2 = new Vector3();
1378913789

13790-
return function barycoordFromPoint( point, a, b, c, target ) {
13790+
return function getBarycoord( point, a, b, c, target ) {
1379113791

1379213792
v0.subVectors( c, a );
1379313793
v1.subVectors( b, a );
@@ -13803,7 +13803,7 @@
1380313803

1380413804
if ( target === undefined ) {
1380513805

13806-
console.warn( 'THREE.Triangle: .barycoordFromPoint() target is now required' );
13806+
console.warn( 'THREE.Triangle: .getBarycoord() target is now required' );
1380713807
target = new Vector3();
1380813808

1380913809
}
@@ -13834,7 +13834,7 @@
1383413834

1383513835
return function containsPoint( point, a, b, c ) {
1383613836

13837-
Triangle.barycoordFromPoint( point, a, b, c, v1 );
13837+
Triangle.getBarycoord( point, a, b, c, v1 );
1383813838

1383913839
return ( v1.x >= 0 ) && ( v1.y >= 0 ) && ( ( v1.x + v1.y ) <= 1 );
1384013840

@@ -13882,12 +13882,12 @@
1388213882

1388313883
},
1388413884

13885-
area: function () {
13885+
getArea: function () {
1388613886

1388713887
var v0 = new Vector3();
1388813888
var v1 = new Vector3();
1388913889

13890-
return function area() {
13890+
return function getArea() {
1389113891

1389213892
v0.subVectors( this.c, this.b );
1389313893
v1.subVectors( this.a, this.b );
@@ -13898,11 +13898,11 @@
1389813898

1389913899
}(),
1390013900

13901-
midpoint: function ( target ) {
13901+
getMidpoint: function ( target ) {
1390213902

1390313903
if ( target === undefined ) {
1390413904

13905-
console.warn( 'THREE.Triangle: .midpoint() target is now required' );
13905+
console.warn( 'THREE.Triangle: .getMidpoint() target is now required' );
1390613906
target = new Vector3();
1390713907

1390813908
}
@@ -13911,17 +13911,17 @@
1391113911

1391213912
},
1391313913

13914-
normal: function ( target ) {
13914+
getNormal: function ( target ) {
1391513915

13916-
return Triangle.normal( this.a, this.b, this.c, target );
13916+
return Triangle.getNormal( this.a, this.b, this.c, target );
1391713917

1391813918
},
1391913919

13920-
plane: function ( target ) {
13920+
getPlane: function ( target ) {
1392113921

1392213922
if ( target === undefined ) {
1392313923

13924-
console.warn( 'THREE.Triangle: .plane() target is now required' );
13924+
console.warn( 'THREE.Triangle: .getPlane() target is now required' );
1392513925
target = new Vector3();
1392613926

1392713927
}
@@ -13930,9 +13930,9 @@
1393013930

1393113931
},
1393213932

13933-
barycoordFromPoint: function ( point, target ) {
13933+
getBarycoord: function ( point, target ) {
1393413934

13935-
return Triangle.barycoordFromPoint( point, this.a, this.b, this.c, target );
13935+
return Triangle.getBarycoord( point, this.a, this.b, this.c, target );
1393613936

1393713937
},
1393813938

@@ -14156,7 +14156,7 @@
1415614156

1415714157
function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
1415814158

14159-
Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord );
14159+
Triangle.getBarycoord( point, p1, p2, p3, barycoord );
1416014160

1416114161
uv1.multiplyScalar( barycoord.x );
1416214162
uv2.multiplyScalar( barycoord.y );
@@ -14220,7 +14220,7 @@
1422014220
}
1422114221

1422214222
var face = new Face3( a, b, c );
14223-
Triangle.normal( vA, vB, vC, face.normal );
14223+
Triangle.getNormal( vA, vB, vC, face.normal );
1422414224

1422514225
intersection.face = face;
1422614226
intersection.faceIndex = a;
@@ -19644,7 +19644,7 @@
1964419644

1964519645
function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {
1964619646

19647-
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
19647+
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext ); /* global WebGL2RenderingContext */
1964819648
var _videoTextures = {};
1964919649
var _canvas;
1965019650

@@ -19654,6 +19654,13 @@
1965419654

1965519655
if ( image.width > maxSize || image.height > maxSize ) {
1965619656

19657+
if ( 'data' in image ) {
19658+
19659+
console.warn( 'THREE.WebGLRenderer: image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
19660+
return;
19661+
19662+
}
19663+
1965719664
// Warning: Scaling through the canvas will only work with images that use
1965819665
// premultiplied alpha.
1965919666

@@ -20929,6 +20936,8 @@
2092920936
}
2093020937

2093120938
var matrixWorldInverse = new Matrix4();
20939+
var tempQuaternion = new Quaternion();
20940+
var tempPosition = new Vector3();
2093220941

2093320942
var cameraL = new PerspectiveCamera();
2093420943
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
@@ -21007,38 +21016,42 @@
2100721016

2100821017
//
2100921018

21010-
var pose = frameData.pose;
21011-
var poseObject = poseTarget !== null ? poseTarget : camera;
21019+
var stageParameters = device.stageParameters;
2101221020

21013-
if ( pose.position !== null ) {
21021+
if ( stageParameters ) {
2101421022

21015-
poseObject.position.fromArray( pose.position );
21023+
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
2101621024

2101721025
} else {
2101821026

21019-
poseObject.position.set( 0, 0, 0 );
21027+
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
2102021028

2102121029
}
2102221030

21023-
if ( pose.orientation !== null ) {
2102421031

21025-
poseObject.quaternion.fromArray( pose.orientation );
21032+
var pose = frameData.pose;
21033+
var poseObject = poseTarget !== null ? poseTarget : camera;
2102621034

21027-
}
21035+
// We want to manipulate poseObject by its position and quaternion components since users may rely on them.
21036+
poseObject.matrix.copy( standingMatrix );
21037+
poseObject.matrix.decompose( poseObject.position, poseObject.quaternion, poseObject.scale );
2102821038

21029-
var stageParameters = device.stageParameters;
21039+
if ( pose.orientation !== null ) {
2103021040

21031-
if ( stageParameters ) {
21041+
tempQuaternion.fromArray( pose.orientation );
21042+
poseObject.quaternion.multiply( tempQuaternion );
2103221043

21033-
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
21044+
}
2103421045

21035-
} else {
21046+
if ( pose.position !== null ) {
2103621047

21037-
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
21048+
tempQuaternion.setFromRotationMatrix( standingMatrix );
21049+
tempPosition.fromArray( pose.position );
21050+
tempPosition.applyQuaternion( tempQuaternion );
21051+
poseObject.position.add( tempPosition );
2103821052

2103921053
}
2104021054

21041-
poseObject.position.applyMatrix4( standingMatrix );
2104221055
poseObject.updateMatrixWorld();
2104321056

2104421057
if ( device.isPresenting === false ) return camera;
@@ -25441,7 +25454,7 @@
2544125454

2544225455
// vertex
2544325456

25444-
p0 = func( u, v, p0 );
25457+
func( u, v, p0 );
2544525458
vertices.push( p0.x, p0.y, p0.z );
2544625459

2544725460
// normal
@@ -25450,24 +25463,24 @@
2545025463

2545125464
if ( u - EPS >= 0 ) {
2545225465

25453-
p1 = func( u - EPS, v, p1 );
25466+
func( u - EPS, v, p1 );
2545425467
pu.subVectors( p0, p1 );
2545525468

2545625469
} else {
2545725470

25458-
p1 = func( u + EPS, v, p1 );
25471+
func( u + EPS, v, p1 );
2545925472
pu.subVectors( p1, p0 );
2546025473

2546125474
}
2546225475

2546325476
if ( v - EPS >= 0 ) {
2546425477

25465-
p1 = func( u, v - EPS, p1 );
25478+
func( u, v - EPS, p1 );
2546625479
pv.subVectors( p0, p1 );
2546725480

2546825481
} else {
2546925482

25470-
p1 = func( u, v + EPS, p1 );
25483+
func( u, v + EPS, p1 );
2547125484
pv.subVectors( p1, p0 );
2547225485

2547325486
}
@@ -28148,7 +28161,7 @@
2814828161

2814928162
}
2815028163

28151-
scope.addGroup( start, verticesArray.length / 3 - start, options.material !== undefined ? options.material : 0 );
28164+
scope.addGroup( start, verticesArray.length / 3 - start, 0 );
2815228165

2815328166
}
2815428167

@@ -28172,7 +28185,7 @@
2817228185
}
2817328186

2817428187

28175-
scope.addGroup( start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1 );
28188+
scope.addGroup( start, verticesArray.length / 3 - start, 1 );
2817628189

2817728190

2817828191
}
@@ -42123,9 +42136,9 @@
4212342136

4212442137
},
4212542138

42126-
intersectObject: function ( object, recursive ) {
42139+
intersectObject: function ( object, recursive, optionalTarget ) {
4212742140

42128-
var intersects = [];
42141+
var intersects = optionalTarget || [];
4212942142

4213042143
intersectObject( object, this, intersects, recursive );
4213142144

@@ -42135,9 +42148,9 @@
4213542148

4213642149
},
4213742150

42138-
intersectObjects: function ( objects, recursive ) {
42151+
intersectObjects: function ( objects, recursive, optionalTarget ) {
4213942152

42140-
var intersects = [];
42153+
var intersects = optionalTarget || [];
4214142154

4214242155
if ( Array.isArray( objects ) === false ) {
4214342156

@@ -44731,6 +44744,58 @@
4473144744

4473244745
} );
4473344746

44747+
Object.assign( Triangle.prototype, {
44748+
44749+
area: function () {
44750+
44751+
console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
44752+
return this.getArea();
44753+
44754+
},
44755+
barycoordFromPoint: function ( point, target ) {
44756+
44757+
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
44758+
return this.getBarycoord( point, target );
44759+
44760+
},
44761+
midpoint: function ( target ) {
44762+
44763+
console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
44764+
return this.getMidpoint( target );
44765+
44766+
},
44767+
normal: function ( target ) {
44768+
44769+
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
44770+
return this.getNormal( target );
44771+
44772+
},
44773+
plane: function ( target ) {
44774+
44775+
console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
44776+
return this.getPlane( target );
44777+
44778+
}
44779+
44780+
} );
44781+
44782+
Object.assign( Triangle, {
44783+
44784+
barycoordFromPoint: function ( point, a, b, c, target ) {
44785+
44786+
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
44787+
return Triangle.getBarycoord( point, a, b, c, target );
44788+
44789+
},
44790+
normal: function ( a, b, c, target ) {
44791+
44792+
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
44793+
return Triangle.getNormal( a, b, c, target );
44794+
44795+
}
44796+
44797+
} );
44798+
4473444799
Object.assign( Shape.prototype, {
4473544800

4473644801
extractAllPoints: function ( divisions ) {

0 commit comments

Comments
 (0)