|
@@ -168,7 +168,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, a, b, c ) {
|
|
|
+ function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c ) {
|
|
|
|
|
|
vA.fromBufferAttribute( position, a );
|
|
|
vB.fromBufferAttribute( position, b );
|
|
@@ -219,6 +219,16 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if ( uv2 ) {
|
|
|
+
|
|
|
+ uvA.fromBufferAttribute( uv2, a );
|
|
|
+ uvB.fromBufferAttribute( uv2, b );
|
|
|
+ uvC.fromBufferAttribute( uv2, c );
|
|
|
+
|
|
|
+ intersection.uv2 = Triangle.getUV( intersectionPoint, vA, vB, vC, uvA, uvB, uvC, new Vector2() );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
var face = new Face3( a, b, c );
|
|
|
Triangle.getNormal( vA, vB, vC, face.normal );
|
|
|
|
|
@@ -269,6 +279,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
var position = geometry.attributes.position;
|
|
|
var morphPosition = geometry.morphAttributes.position;
|
|
|
var uv = geometry.attributes.uv;
|
|
|
+ var uv2 = geometry.attributes.uv2;
|
|
|
var groups = geometry.groups;
|
|
|
var drawRange = geometry.drawRange;
|
|
|
var i, j, il, jl;
|
|
@@ -295,7 +306,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = index.getX( j + 1 );
|
|
|
c = index.getX( j + 2 );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -320,7 +331,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = index.getX( i + 1 );
|
|
|
c = index.getX( i + 2 );
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -353,7 +364,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = j + 1;
|
|
|
c = j + 2;
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|
|
@@ -378,7 +389,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
b = i + 1;
|
|
|
c = i + 2;
|
|
|
|
|
|
- intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c );
|
|
|
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c );
|
|
|
|
|
|
if ( intersection ) {
|
|
|
|