Spline now clones the control points to not keep a reference on the given vector.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9272 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent a4c1fd7670
commit f156b31ce1
  1. 4
      engine/src/core/com/jme3/math/Spline.java

@ -154,9 +154,9 @@ public class Spline implements Savable {
if (controlPoints.size() > 2 && this.cycle) {
controlPoints.remove(controlPoints.size() - 1);
}
controlPoints.add(controlPoint);
controlPoints.add(controlPoint.clone());
if (controlPoints.size() >= 2 && this.cycle) {
controlPoints.add(controlPoints.get(0));
controlPoints.add(controlPoints.get(0).clone());
}
if (controlPoints.size() > 1) {
this.computeTotalLentgh();

Loading…
Cancel
Save