Skip to content

Commit

Permalink
r91
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 14, 2018
1 parent 935739b commit 28894cc
Show file tree
Hide file tree
Showing 6 changed files with 769 additions and 637 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Please also include a live example if possible. You can start from these templat
##### Three.js version

- [ ] Dev
- [ ] r90
- [ ] r91
- [ ] ...

##### Browser
Expand Down
157 changes: 111 additions & 46 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@

} );

var REVISION = '91dev';
var REVISION = '91';
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
var CullFaceNone = 0;
var CullFaceBack = 1;
Expand Down Expand Up @@ -13749,15 +13749,15 @@

Object.assign( Triangle, {

normal: function () {
getNormal: function () {

var v0 = new Vector3();

return function normal( a, b, c, target ) {
return function getNormal( a, b, c, target ) {

if ( target === undefined ) {

console.warn( 'THREE.Triangle: .normal() target is now required' );
console.warn( 'THREE.Triangle: .getNormal() target is now required' );
target = new Vector3();

}
Expand All @@ -13781,13 +13781,13 @@

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

var v0 = new Vector3();
var v1 = new Vector3();
var v2 = new Vector3();

return function barycoordFromPoint( point, a, b, c, target ) {
return function getBarycoord( point, a, b, c, target ) {

v0.subVectors( c, a );
v1.subVectors( b, a );
Expand All @@ -13803,7 +13803,7 @@

if ( target === undefined ) {

console.warn( 'THREE.Triangle: .barycoordFromPoint() target is now required' );
console.warn( 'THREE.Triangle: .getBarycoord() target is now required' );
target = new Vector3();

}
Expand Down Expand Up @@ -13834,7 +13834,7 @@

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

Triangle.barycoordFromPoint( point, a, b, c, v1 );
Triangle.getBarycoord( point, a, b, c, v1 );

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

Expand Down Expand Up @@ -13882,12 +13882,12 @@

},

area: function () {
getArea: function () {

var v0 = new Vector3();
var v1 = new Vector3();

return function area() {
return function getArea() {

v0.subVectors( this.c, this.b );
v1.subVectors( this.a, this.b );
Expand All @@ -13898,11 +13898,11 @@

}(),

midpoint: function ( target ) {
getMidpoint: function ( target ) {

if ( target === undefined ) {

console.warn( 'THREE.Triangle: .midpoint() target is now required' );
console.warn( 'THREE.Triangle: .getMidpoint() target is now required' );
target = new Vector3();

}
Expand All @@ -13911,17 +13911,17 @@

},

normal: function ( target ) {
getNormal: function ( target ) {

return Triangle.normal( this.a, this.b, this.c, target );
return Triangle.getNormal( this.a, this.b, this.c, target );

},

plane: function ( target ) {
getPlane: function ( target ) {

if ( target === undefined ) {

console.warn( 'THREE.Triangle: .plane() target is now required' );
console.warn( 'THREE.Triangle: .getPlane() target is now required' );
target = new Vector3();

}
Expand All @@ -13930,9 +13930,9 @@

},

barycoordFromPoint: function ( point, target ) {
getBarycoord: function ( point, target ) {

return Triangle.barycoordFromPoint( point, this.a, this.b, this.c, target );
return Triangle.getBarycoord( point, this.a, this.b, this.c, target );

},

Expand Down Expand Up @@ -14156,7 +14156,7 @@

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

Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord );
Triangle.getBarycoord( point, p1, p2, p3, barycoord );

uv1.multiplyScalar( barycoord.x );
uv2.multiplyScalar( barycoord.y );
Expand Down Expand Up @@ -14220,7 +14220,7 @@
}

var face = new Face3( a, b, c );
Triangle.normal( vA, vB, vC, face.normal );
Triangle.getNormal( vA, vB, vC, face.normal );

intersection.face = face;
intersection.faceIndex = a;
Expand Down Expand Up @@ -19644,7 +19644,7 @@

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

var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext ); /* global WebGL2RenderingContext */
var _videoTextures = {};
var _canvas;

Expand All @@ -19654,6 +19654,13 @@

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

if ( 'data' in image ) {

console.warn( 'THREE.WebGLRenderer: image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
return;

}

// Warning: Scaling through the canvas will only work with images that use
// premultiplied alpha.

Expand Down Expand Up @@ -20929,6 +20936,8 @@
}

var matrixWorldInverse = new Matrix4();
var tempQuaternion = new Quaternion();
var tempPosition = new Vector3();

var cameraL = new PerspectiveCamera();
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
Expand Down Expand Up @@ -21007,38 +21016,42 @@

//

var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;
var stageParameters = device.stageParameters;

if ( pose.position !== null ) {
if ( stageParameters ) {

poseObject.position.fromArray( pose.position );
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );

} else {

poseObject.position.set( 0, 0, 0 );
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );

}

if ( pose.orientation !== null ) {

poseObject.quaternion.fromArray( pose.orientation );
var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;

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

var stageParameters = device.stageParameters;
if ( pose.orientation !== null ) {

if ( stageParameters ) {
tempQuaternion.fromArray( pose.orientation );
poseObject.quaternion.multiply( tempQuaternion );

standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
}

} else {
if ( pose.position !== null ) {

standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
tempQuaternion.setFromRotationMatrix( standingMatrix );
tempPosition.fromArray( pose.position );
tempPosition.applyQuaternion( tempQuaternion );
poseObject.position.add( tempPosition );

}

poseObject.position.applyMatrix4( standingMatrix );
poseObject.updateMatrixWorld();

if ( device.isPresenting === false ) return camera;
Expand Down Expand Up @@ -25441,7 +25454,7 @@

// vertex

p0 = func( u, v, p0 );
func( u, v, p0 );
vertices.push( p0.x, p0.y, p0.z );

// normal
Expand All @@ -25450,24 +25463,24 @@

if ( u - EPS >= 0 ) {

p1 = func( u - EPS, v, p1 );
func( u - EPS, v, p1 );
pu.subVectors( p0, p1 );

} else {

p1 = func( u + EPS, v, p1 );
func( u + EPS, v, p1 );
pu.subVectors( p1, p0 );

}

if ( v - EPS >= 0 ) {

p1 = func( u, v - EPS, p1 );
func( u, v - EPS, p1 );
pv.subVectors( p0, p1 );

} else {

p1 = func( u, v + EPS, p1 );
func( u, v + EPS, p1 );
pv.subVectors( p1, p0 );

}
Expand Down Expand Up @@ -28148,7 +28161,7 @@

}

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

}

Expand All @@ -28172,7 +28185,7 @@
}


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


}
Expand Down Expand Up @@ -42123,9 +42136,9 @@

},

intersectObject: function ( object, recursive ) {
intersectObject: function ( object, recursive, optionalTarget ) {

var intersects = [];
var intersects = optionalTarget || [];

intersectObject( object, this, intersects, recursive );

Expand All @@ -42135,9 +42148,9 @@

},

intersectObjects: function ( objects, recursive ) {
intersectObjects: function ( objects, recursive, optionalTarget ) {

var intersects = [];
var intersects = optionalTarget || [];

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

Expand Down Expand Up @@ -44731,6 +44744,58 @@

} );

Object.assign( Triangle.prototype, {

area: function () {

console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
return this.getArea();

},
barycoordFromPoint: function ( point, target ) {

console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return this.getBarycoord( point, target );

},
midpoint: function ( target ) {

console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
return this.getMidpoint( target );

},
normal: function ( target ) {

console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return this.getNormal( target );

},
plane: function ( target ) {

console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
return this.getPlane( target );

}

} );

Object.assign( Triangle, {

barycoordFromPoint: function ( point, a, b, c, target ) {

console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return Triangle.getBarycoord( point, a, b, c, target );

},
normal: function ( a, b, c, target ) {

console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return Triangle.getNormal( a, b, c, target );

}

} );

Object.assign( Shape.prototype, {

extractAllPoints: function ( divisions ) {
Expand Down
Loading

0 comments on commit 28894cc

Please sign in to comment.