瀏覽代碼

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 年之前
父節點
當前提交
7c4f085174
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 4 0
      engine/src/core/com/jme3/cinematic/MotionPath.java
  2. 5 0
      engine/src/core/com/jme3/math/Spline.java

+ 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
      * Sets the path to be a cycle
      * @param cycle
      * @param cycle

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

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