浏览代码

Clear cacheLengths (#9008)

the updateArcLengths in CurvePath must clear the local cache,
cacheLengths
rfm1201 9 年之前
父节点
当前提交
55b9991930
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/extras/core/CurvePath.js

+ 9 - 0
src/extras/core/CurvePath.js

@@ -93,6 +93,15 @@ THREE.CurvePath.prototype = Object.assign( Object.create( THREE.Curve.prototype
 
 	},
 
+	// cacheLengths must be recalculated.
+	updateArcLengths: function () {
+
+		this.needsUpdate = true;
+		this.cacheLengths = null;
+		this.getLengths();
+
+	},
+
 	// Compute lengths and cache them
 	// We cannot overwrite getLengths() because UtoT mapping uses it.