|
@@ -20,321 +20,323 @@ THREE.Mesh = function ( geometry, material ) {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-THREE.Mesh.prototype = Object.create( THREE.Object3D.prototype );
|
|
|
|
-THREE.Mesh.prototype.constructor = THREE.Mesh;
|
|
|
|
|
|
+THREE.Mesh.prototype = Object.assign( Object.create( THREE.Object3D.prototype ), {
|
|
|
|
|
|
-THREE.Mesh.prototype.setDrawMode = function ( value ) {
|
|
|
|
|
|
+ constructor: THREE.Mesh,
|
|
|
|
|
|
- this.drawMode = value;
|
|
|
|
|
|
+ setDrawMode: function ( value ) {
|
|
|
|
|
|
-};
|
|
|
|
|
|
+ this.drawMode = value;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ updateMorphTargets: function () {
|
|
|
|
|
|
-THREE.Mesh.prototype.updateMorphTargets = function () {
|
|
|
|
|
|
+ if ( this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0 ) {
|
|
|
|
|
|
- if ( this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0 ) {
|
|
|
|
|
|
+ this.morphTargetBase = - 1;
|
|
|
|
+ this.morphTargetInfluences = [];
|
|
|
|
+ this.morphTargetDictionary = {};
|
|
|
|
|
|
- this.morphTargetBase = - 1;
|
|
|
|
- this.morphTargetInfluences = [];
|
|
|
|
- this.morphTargetDictionary = {};
|
|
|
|
|
|
+ for ( var m = 0, ml = this.geometry.morphTargets.length; m < ml; m ++ ) {
|
|
|
|
|
|
- for ( var m = 0, ml = this.geometry.morphTargets.length; m < ml; m ++ ) {
|
|
|
|
|
|
+ this.morphTargetInfluences.push( 0 );
|
|
|
|
+ this.morphTargetDictionary[ this.geometry.morphTargets[ m ].name ] = m;
|
|
|
|
|
|
- this.morphTargetInfluences.push( 0 );
|
|
|
|
- this.morphTargetDictionary[ this.geometry.morphTargets[ m ].name ] = m;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
|
|
-};
|
|
|
|
|
|
+ getMorphTargetIndexByName: function ( name ) {
|
|
|
|
|
|
-THREE.Mesh.prototype.getMorphTargetIndexByName = function ( name ) {
|
|
|
|
|
|
+ if ( this.morphTargetDictionary[ name ] !== undefined ) {
|
|
|
|
|
|
- if ( this.morphTargetDictionary[ name ] !== undefined ) {
|
|
|
|
|
|
+ return this.morphTargetDictionary[ name ];
|
|
|
|
|
|
- return this.morphTargetDictionary[ name ];
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ console.warn( 'THREE.Mesh.getMorphTargetIndexByName: morph target ' + name + ' does not exist. Returning 0.' );
|
|
|
|
|
|
- console.warn( 'THREE.Mesh.getMorphTargetIndexByName: morph target ' + name + ' does not exist. Returning 0.' );
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ },
|
|
|
|
|
|
-};
|
|
|
|
|
|
+ raycast: ( function () {
|
|
|
|
|
|
|
|
+ var inverseMatrix = new THREE.Matrix4();
|
|
|
|
+ var ray = new THREE.Ray();
|
|
|
|
+ var sphere = new THREE.Sphere();
|
|
|
|
|
|
-THREE.Mesh.prototype.raycast = ( function () {
|
|
|
|
|
|
+ var vA = new THREE.Vector3();
|
|
|
|
+ var vB = new THREE.Vector3();
|
|
|
|
+ var vC = new THREE.Vector3();
|
|
|
|
|
|
- var inverseMatrix = new THREE.Matrix4();
|
|
|
|
- var ray = new THREE.Ray();
|
|
|
|
- var sphere = new THREE.Sphere();
|
|
|
|
|
|
+ var tempA = new THREE.Vector3();
|
|
|
|
+ var tempB = new THREE.Vector3();
|
|
|
|
+ var tempC = new THREE.Vector3();
|
|
|
|
|
|
- var vA = new THREE.Vector3();
|
|
|
|
- var vB = new THREE.Vector3();
|
|
|
|
- var vC = new THREE.Vector3();
|
|
|
|
|
|
+ var uvA = new THREE.Vector2();
|
|
|
|
+ var uvB = new THREE.Vector2();
|
|
|
|
+ var uvC = new THREE.Vector2();
|
|
|
|
|
|
- var tempA = new THREE.Vector3();
|
|
|
|
- var tempB = new THREE.Vector3();
|
|
|
|
- var tempC = new THREE.Vector3();
|
|
|
|
|
|
+ var barycoord = new THREE.Vector3();
|
|
|
|
|
|
- var uvA = new THREE.Vector2();
|
|
|
|
- var uvB = new THREE.Vector2();
|
|
|
|
- var uvC = new THREE.Vector2();
|
|
|
|
|
|
+ var intersectionPoint = new THREE.Vector3();
|
|
|
|
+ var intersectionPointWorld = new THREE.Vector3();
|
|
|
|
|
|
- var barycoord = new THREE.Vector3();
|
|
|
|
|
|
+ function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
|
|
|
|
|
|
- var intersectionPoint = new THREE.Vector3();
|
|
|
|
- var intersectionPointWorld = new THREE.Vector3();
|
|
|
|
|
|
+ THREE.Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord );
|
|
|
|
|
|
- function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
|
|
|
|
|
|
+ uv1.multiplyScalar( barycoord.x );
|
|
|
|
+ uv2.multiplyScalar( barycoord.y );
|
|
|
|
+ uv3.multiplyScalar( barycoord.z );
|
|
|
|
|
|
- THREE.Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord );
|
|
|
|
|
|
+ uv1.add( uv2 ).add( uv3 );
|
|
|
|
|
|
- uv1.multiplyScalar( barycoord.x );
|
|
|
|
- uv2.multiplyScalar( barycoord.y );
|
|
|
|
- uv3.multiplyScalar( barycoord.z );
|
|
|
|
|
|
+ return uv1.clone();
|
|
|
|
|
|
- uv1.add( uv2 ).add( uv3 );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- return uv1.clone();
|
|
|
|
|
|
+ function checkIntersection( object, raycaster, ray, pA, pB, pC, point ) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var intersect;
|
|
|
|
+ var material = object.material;
|
|
|
|
|
|
- function checkIntersection( object, raycaster, ray, pA, pB, pC, point ) {
|
|
|
|
|
|
+ if ( material.side === THREE.BackSide ) {
|
|
|
|
|
|
- var intersect;
|
|
|
|
- var material = object.material;
|
|
|
|
|
|
+ intersect = ray.intersectTriangle( pC, pB, pA, true, point );
|
|
|
|
|
|
- if ( material.side === THREE.BackSide ) {
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
- intersect = ray.intersectTriangle( pC, pB, pA, true, point );
|
|
|
|
|
|
+ intersect = ray.intersectTriangle( pA, pB, pC, material.side !== THREE.DoubleSide, point );
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- intersect = ray.intersectTriangle( pA, pB, pC, material.side !== THREE.DoubleSide, point );
|
|
|
|
|
|
+ if ( intersect === null ) return null;
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ intersectionPointWorld.copy( point );
|
|
|
|
+ intersectionPointWorld.applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
- if ( intersect === null ) return null;
|
|
|
|
|
|
+ var distance = raycaster.ray.origin.distanceTo( intersectionPointWorld );
|
|
|
|
|
|
- intersectionPointWorld.copy( point );
|
|
|
|
- intersectionPointWorld.applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
+ if ( distance < raycaster.near || distance > raycaster.far ) return null;
|
|
|
|
|
|
- var distance = raycaster.ray.origin.distanceTo( intersectionPointWorld );
|
|
|
|
|
|
+ return {
|
|
|
|
+ distance: distance,
|
|
|
|
+ point: intersectionPointWorld.clone(),
|
|
|
|
+ object: object
|
|
|
|
+ };
|
|
|
|
|
|
- if ( distance < raycaster.near || distance > raycaster.far ) return null;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- return {
|
|
|
|
- distance: distance,
|
|
|
|
- point: intersectionPointWorld.clone(),
|
|
|
|
- object: object
|
|
|
|
- };
|
|
|
|
|
|
+ function checkBufferGeometryIntersection( object, raycaster, ray, positions, uvs, a, b, c ) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ vA.fromArray( positions, a * 3 );
|
|
|
|
+ vB.fromArray( positions, b * 3 );
|
|
|
|
+ vC.fromArray( positions, c * 3 );
|
|
|
|
|
|
- function checkBufferGeometryIntersection( object, raycaster, ray, positions, uvs, a, b, c ) {
|
|
|
|
|
|
+ var intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint );
|
|
|
|
|
|
- vA.fromArray( positions, a * 3 );
|
|
|
|
- vB.fromArray( positions, b * 3 );
|
|
|
|
- vC.fromArray( positions, c * 3 );
|
|
|
|
|
|
+ if ( intersection ) {
|
|
|
|
|
|
- var intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint );
|
|
|
|
|
|
+ if ( uvs ) {
|
|
|
|
|
|
- if ( intersection ) {
|
|
|
|
|
|
+ uvA.fromArray( uvs, a * 2 );
|
|
|
|
+ uvB.fromArray( uvs, b * 2 );
|
|
|
|
+ uvC.fromArray( uvs, c * 2 );
|
|
|
|
|
|
- if ( uvs ) {
|
|
|
|
|
|
+ intersection.uv = uvIntersection( intersectionPoint, vA, vB, vC, uvA, uvB, uvC );
|
|
|
|
|
|
- uvA.fromArray( uvs, a * 2 );
|
|
|
|
- uvB.fromArray( uvs, b * 2 );
|
|
|
|
- uvC.fromArray( uvs, c * 2 );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- intersection.uv = uvIntersection( intersectionPoint, vA, vB, vC, uvA, uvB, uvC );
|
|
|
|
|
|
+ intersection.face = new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) );
|
|
|
|
+ intersection.faceIndex = a;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- intersection.face = new THREE.Face3( a, b, c, THREE.Triangle.normal( vA, vB, vC ) );
|
|
|
|
- intersection.faceIndex = a;
|
|
|
|
|
|
+ return intersection;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- return intersection;
|
|
|
|
|
|
+ return function raycast( raycaster, intersects ) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var geometry = this.geometry;
|
|
|
|
+ var material = this.material;
|
|
|
|
+ var matrixWorld = this.matrixWorld;
|
|
|
|
|
|
- return function raycast( raycaster, intersects ) {
|
|
|
|
|
|
+ if ( material === undefined ) return;
|
|
|
|
|
|
- var geometry = this.geometry;
|
|
|
|
- var material = this.material;
|
|
|
|
- var matrixWorld = this.matrixWorld;
|
|
|
|
|
|
+ // Checking boundingSphere distance to ray
|
|
|
|
|
|
- if ( material === undefined ) return;
|
|
|
|
|
|
+ if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
- // Checking boundingSphere distance to ray
|
|
|
|
|
|
+ sphere.copy( geometry.boundingSphere );
|
|
|
|
+ sphere.applyMatrix4( matrixWorld );
|
|
|
|
|
|
- if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
+ if ( raycaster.ray.intersectsSphere( sphere ) === false ) return;
|
|
|
|
|
|
- sphere.copy( geometry.boundingSphere );
|
|
|
|
- sphere.applyMatrix4( matrixWorld );
|
|
|
|
|
|
+ //
|
|
|
|
|
|
- if ( raycaster.ray.intersectsSphere( sphere ) === false ) return;
|
|
|
|
|
|
+ inverseMatrix.getInverse( matrixWorld );
|
|
|
|
+ ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
|
|
|
|
|
|
- //
|
|
|
|
|
|
+ // Check boundingBox before continuing
|
|
|
|
|
|
- inverseMatrix.getInverse( matrixWorld );
|
|
|
|
- ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
|
|
|
|
|
|
+ if ( geometry.boundingBox !== null ) {
|
|
|
|
|
|
- // Check boundingBox before continuing
|
|
|
|
|
|
+ if ( ray.intersectsBox( geometry.boundingBox ) === false ) return;
|
|
|
|
|
|
- if ( geometry.boundingBox !== null ) {
|
|
|
|
-
|
|
|
|
- if ( ray.intersectsBox( geometry.boundingBox ) === false ) return;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var uvs, intersection;
|
|
|
|
|
|
- var uvs, intersection;
|
|
|
|
|
|
+ if ( geometry instanceof THREE.BufferGeometry ) {
|
|
|
|
|
|
- if ( geometry instanceof THREE.BufferGeometry ) {
|
|
|
|
|
|
+ var a, b, c;
|
|
|
|
+ var index = geometry.index;
|
|
|
|
+ var attributes = geometry.attributes;
|
|
|
|
+ var positions = attributes.position.array;
|
|
|
|
|
|
- var a, b, c;
|
|
|
|
- var index = geometry.index;
|
|
|
|
- var attributes = geometry.attributes;
|
|
|
|
- var positions = attributes.position.array;
|
|
|
|
|
|
+ if ( attributes.uv !== undefined ) {
|
|
|
|
|
|
- if ( attributes.uv !== undefined ) {
|
|
|
|
|
|
+ uvs = attributes.uv.array;
|
|
|
|
|
|
- uvs = attributes.uv.array;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ if ( index !== null ) {
|
|
|
|
|
|
- if ( index !== null ) {
|
|
|
|
|
|
+ var indices = index.array;
|
|
|
|
|
|
- var indices = index.array;
|
|
|
|
|
|
+ for ( var i = 0, l = indices.length; i < l; i += 3 ) {
|
|
|
|
|
|
- for ( var i = 0, l = indices.length; i < l; i += 3 ) {
|
|
|
|
|
|
+ a = indices[ i ];
|
|
|
|
+ b = indices[ i + 1 ];
|
|
|
|
+ c = indices[ i + 2 ];
|
|
|
|
|
|
- a = indices[ i ];
|
|
|
|
- b = indices[ i + 1 ];
|
|
|
|
- c = indices[ i + 2 ];
|
|
|
|
|
|
+ intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );
|
|
|
|
|
|
+ if ( intersection ) {
|
|
|
|
|
|
- if ( intersection ) {
|
|
|
|
|
|
+ intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics
|
|
|
|
+ intersects.push( intersection );
|
|
|
|
|
|
- intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics
|
|
|
|
- intersects.push( intersection );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
|
|
|
+ for ( var i = 0, l = positions.length; i < l; i += 9 ) {
|
|
|
|
|
|
- for ( var i = 0, l = positions.length; i < l; i += 9 ) {
|
|
|
|
|
|
+ a = i / 3;
|
|
|
|
+ b = a + 1;
|
|
|
|
+ c = a + 2;
|
|
|
|
|
|
- a = i / 3;
|
|
|
|
- b = a + 1;
|
|
|
|
- c = a + 2;
|
|
|
|
|
|
+ intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );
|
|
|
|
|
|
+ if ( intersection ) {
|
|
|
|
|
|
- if ( intersection ) {
|
|
|
|
|
|
+ intersection.index = a; // triangle number in positions buffer semantics
|
|
|
|
+ intersects.push( intersection );
|
|
|
|
|
|
- intersection.index = a; // triangle number in positions buffer semantics
|
|
|
|
- intersects.push( intersection );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ } else if ( geometry instanceof THREE.Geometry ) {
|
|
|
|
|
|
- } else if ( geometry instanceof THREE.Geometry ) {
|
|
|
|
|
|
+ var fvA, fvB, fvC;
|
|
|
|
+ var isFaceMaterial = material instanceof THREE.MultiMaterial;
|
|
|
|
+ var materials = isFaceMaterial === true ? material.materials : null;
|
|
|
|
|
|
- var fvA, fvB, fvC;
|
|
|
|
- var isFaceMaterial = material instanceof THREE.MultiMaterial;
|
|
|
|
- var materials = isFaceMaterial === true ? material.materials : null;
|
|
|
|
|
|
+ var vertices = geometry.vertices;
|
|
|
|
+ var faces = geometry.faces;
|
|
|
|
+ var faceVertexUvs = geometry.faceVertexUvs[ 0 ];
|
|
|
|
+ if ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs;
|
|
|
|
|
|
- var vertices = geometry.vertices;
|
|
|
|
- var faces = geometry.faces;
|
|
|
|
- var faceVertexUvs = geometry.faceVertexUvs[ 0 ];
|
|
|
|
- if ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs;
|
|
|
|
|
|
+ for ( var f = 0, fl = faces.length; f < fl; f ++ ) {
|
|
|
|
|
|
- for ( var f = 0, fl = faces.length; f < fl; f ++ ) {
|
|
|
|
|
|
+ var face = faces[ f ];
|
|
|
|
+ var faceMaterial = isFaceMaterial === true ? materials[ face.materialIndex ] : material;
|
|
|
|
|
|
- var face = faces[ f ];
|
|
|
|
- var faceMaterial = isFaceMaterial === true ? materials[ face.materialIndex ] : material;
|
|
|
|
|
|
+ if ( faceMaterial === undefined ) continue;
|
|
|
|
|
|
- if ( faceMaterial === undefined ) continue;
|
|
|
|
|
|
+ fvA = vertices[ face.a ];
|
|
|
|
+ fvB = vertices[ face.b ];
|
|
|
|
+ fvC = vertices[ face.c ];
|
|
|
|
|
|
- fvA = vertices[ face.a ];
|
|
|
|
- fvB = vertices[ face.b ];
|
|
|
|
- fvC = vertices[ face.c ];
|
|
|
|
|
|
+ if ( faceMaterial.morphTargets === true ) {
|
|
|
|
|
|
- if ( faceMaterial.morphTargets === true ) {
|
|
|
|
|
|
+ var morphTargets = geometry.morphTargets;
|
|
|
|
+ var morphInfluences = this.morphTargetInfluences;
|
|
|
|
|
|
- var morphTargets = geometry.morphTargets;
|
|
|
|
- var morphInfluences = this.morphTargetInfluences;
|
|
|
|
|
|
+ vA.set( 0, 0, 0 );
|
|
|
|
+ vB.set( 0, 0, 0 );
|
|
|
|
+ vC.set( 0, 0, 0 );
|
|
|
|
|
|
- vA.set( 0, 0, 0 );
|
|
|
|
- vB.set( 0, 0, 0 );
|
|
|
|
- vC.set( 0, 0, 0 );
|
|
|
|
|
|
+ for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {
|
|
|
|
|
|
- for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {
|
|
|
|
|
|
+ var influence = morphInfluences[ t ];
|
|
|
|
|
|
- var influence = morphInfluences[ t ];
|
|
|
|
|
|
+ if ( influence === 0 ) continue;
|
|
|
|
|
|
- if ( influence === 0 ) continue;
|
|
|
|
|
|
+ var targets = morphTargets[ t ].vertices;
|
|
|
|
|
|
- var targets = morphTargets[ t ].vertices;
|
|
|
|
|
|
+ vA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence );
|
|
|
|
+ vB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence );
|
|
|
|
+ vC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence );
|
|
|
|
|
|
- vA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence );
|
|
|
|
- vB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence );
|
|
|
|
- vC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ vA.add( fvA );
|
|
|
|
+ vB.add( fvB );
|
|
|
|
+ vC.add( fvC );
|
|
|
|
|
|
- vA.add( fvA );
|
|
|
|
- vB.add( fvB );
|
|
|
|
- vC.add( fvC );
|
|
|
|
|
|
+ fvA = vA;
|
|
|
|
+ fvB = vB;
|
|
|
|
+ fvC = vC;
|
|
|
|
|
|
- fvA = vA;
|
|
|
|
- fvB = vB;
|
|
|
|
- fvC = vC;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ intersection = checkIntersection( this, raycaster, ray, fvA, fvB, fvC, intersectionPoint );
|
|
|
|
|
|
- intersection = checkIntersection( this, raycaster, ray, fvA, fvB, fvC, intersectionPoint );
|
|
|
|
|
|
+ if ( intersection ) {
|
|
|
|
|
|
- if ( intersection ) {
|
|
|
|
|
|
+ if ( uvs ) {
|
|
|
|
|
|
- if ( uvs ) {
|
|
|
|
|
|
+ var uvs_f = uvs[ f ];
|
|
|
|
+ uvA.copy( uvs_f[ 0 ] );
|
|
|
|
+ uvB.copy( uvs_f[ 1 ] );
|
|
|
|
+ uvC.copy( uvs_f[ 2 ] );
|
|
|
|
|
|
- var uvs_f = uvs[ f ];
|
|
|
|
- uvA.copy( uvs_f[ 0 ] );
|
|
|
|
- uvB.copy( uvs_f[ 1 ] );
|
|
|
|
- uvC.copy( uvs_f[ 2 ] );
|
|
|
|
|
|
+ intersection.uv = uvIntersection( intersectionPoint, fvA, fvB, fvC, uvA, uvB, uvC );
|
|
|
|
|
|
- intersection.uv = uvIntersection( intersectionPoint, fvA, fvB, fvC, uvA, uvB, uvC );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ intersection.face = face;
|
|
|
|
+ intersection.faceIndex = f;
|
|
|
|
+ intersects.push( intersection );
|
|
|
|
|
|
- intersection.face = face;
|
|
|
|
- intersection.faceIndex = f;
|
|
|
|
- intersects.push( intersection );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }() ),
|
|
|
|
|
|
-}() );
|
|
|
|
|
|
+ clone: function () {
|
|
|
|
|
|
-THREE.Mesh.prototype.clone = function () {
|
|
|
|
|
|
+ return new this.constructor( this.geometry, this.material ).copy( this );
|
|
|
|
|
|
- return new this.constructor( this.geometry, this.material ).copy( this );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
-};
|
|
|
|
|
|
+} );
|