From f156b31ce175c87dfa872a2d2c4d858b1260b5e6 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sun, 1 Apr 2012 08:23:45 +0000 Subject: [PATCH] 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 --- engine/src/core/com/jme3/math/Spline.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/math/Spline.java b/engine/src/core/com/jme3/math/Spline.java index b28a79720..4712978c0 100644 --- a/engine/src/core/com/jme3/math/Spline.java +++ b/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();