提交 e49055b3 编写于 作者: M Mr.doob

Merge remote-tracking branch 'eric-wieser/morph-raycast' into dev

......@@ -247,6 +247,8 @@
var precision = raycaster.precision;
var vertices = geometry.vertices;
var morphTargets = geometry.morphTargets;
var morphInfluences = object.morphTargetInfluences;
for ( var f = 0, fl = geometry.faces.length; f < fl; f ++ ) {
......@@ -259,7 +261,49 @@
a = vertices[ face.a ];
b = vertices[ face.b ];
c = vertices[ face.c ];
if ( material.morphTargets === true) {
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 ++ ) {
var targets = morphTargets[t].vertices;
var influence = morphInfluences[t];
vA.x += (targets[ face.a ].x - a.x) * influence;
vA.y += (targets[ face.a ].y - a.y) * influence;
vA.z += (targets[ face.a ].z - a.z) * influence;
vB.x += (targets[ face.b ].x - b.x) * influence;
vB.y += (targets[ face.b ].y - b.y) * influence;
vB.z += (targets[ face.b ].z - b.z) * influence;
vC.x += (targets[ face.c ].x - c.x) * influence;
vC.y += (targets[ face.c ].y - c.y) * influence;
vC.z += (targets[ face.c ].z - c.z) * influence;
}
vA.x += a.x;
vA.y += a.y;
vA.z += a.z;
vB.x += b.x;
vB.y += b.y;
vB.z += b.z;
vC.x += c.x;
vC.y += c.y;
vC.z += c.z;
a = vA;
b = vB;
c = vC;
}
if ( material.side === THREE.BackSide ) {
var intersectionPoint = localRay.intersectTriangle( c, b, a, true );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册