提交 d5b9bc68 编写于 作者: T Tristan VALCKE

Improve Triangle closure performance

上级 c60105d9
...@@ -193,19 +193,13 @@ Object.assign( Triangle.prototype, { ...@@ -193,19 +193,13 @@ Object.assign( Triangle.prototype, {
closestPointToPoint: function () { closestPointToPoint: function () {
var plane, edgeList, projectedPoint, closestPoint; var plane = new Plane();
var edgeList = [ new Line3(), new Line3(), new Line3() ];
var projectedPoint = new Vector3();
var closestPoint = new Vector3();
return function closestPointToPoint( point, optionalTarget ) { return function closestPointToPoint( point, optionalTarget ) {
if ( plane === undefined ) {
plane = new Plane();
edgeList = [ new Line3(), new Line3(), new Line3() ];
projectedPoint = new Vector3();
closestPoint = new Vector3();
}
var result = optionalTarget || new Vector3(); var result = optionalTarget || new Vector3();
var minDistance = Infinity; var minDistance = Infinity;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册