未验证 提交 d3f0cca9 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13906 from Mugen87/dev4

Mesh: Make faceIndex consistent for BufferGeometries in raycast()
......@@ -214,7 +214,6 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
Triangle.getNormal( vA, vB, vC, face.normal );
intersection.face = face;
intersection.faceIndex = a;
}
......@@ -276,7 +275,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
if ( intersection ) {
intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics
intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics
intersects.push( intersection );
}
......@@ -295,7 +294,12 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
intersection = checkBufferGeometryIntersection( this, raycaster, ray, position, uv, a, b, c );
if ( intersection ) intersects.push( intersection );
if ( intersection ) {
intersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics
intersects.push( intersection );
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册