Browse Source

Added a way to clear all waypoitns at once on a motion path

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8365 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 14 years ago
parent
commit
7c4f085174

+ 4 - 0
engine/src/core/com/jme3/cinematic/MotionPath.java

@@ -337,6 +337,10 @@ public class MotionPath implements Savable {
         }
     }
 
+    public void clearWayPoints(){
+        spline.clearControlPoints();
+    }
+    
     /**
      * Sets the path to be a cycle
      * @param cycle

+ 5 - 0
engine/src/core/com/jme3/math/Spline.java

@@ -178,6 +178,11 @@ public class Spline implements Savable {
             this.computeTotalLentgh();
         }
     }
+    
+    public void clearControlPoints(){
+        controlPoints.clear();
+        totalLength = 0;
+    }
 
     /**
      * This method computes the total length of the curve.