Browse Source

Clear cacheLengths (#9008)

the updateArcLengths in CurvePath must clear the local cache,
cacheLengths
rfm1201 9 years ago
parent
commit
55b9991930
1 changed files with 9 additions and 0 deletions
  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.