diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Line.java b/jme3-core/src/main/java/com/jme3/scene/shape/Line.java index 93e667d7c..2aabe0288 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Line.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Line.java @@ -49,8 +49,8 @@ import java.nio.FloatBuffer; */ public class Line extends Mesh { - private Vector3f start; - private Vector3f end; + private Vector3f start = new Vector3f(); + private Vector3f end = new Vector3f(); /** * No-argument constructor needed by SavableClassUtil. @@ -64,8 +64,8 @@ public class Line extends Mesh { } protected void updateGeometry(Vector3f start, Vector3f end) { - this.start = start; - this.end = end; + this.start.set(start); + this.end.set(end); setBuffer(Type.Position, 3, new float[]{start.x, start.y, start.z, end.x, end.y, end.z,}); @@ -126,7 +126,7 @@ public class Line extends Mesh { super.read(im); InputCapsule in = im.getCapsule(this); - start = (Vector3f) in.readSavable("startVertex", null); - end = (Vector3f) in.readSavable("endVertex", null); + start = (Vector3f) in.readSavable("startVertex", start); + end = (Vector3f) in.readSavable("endVertex", end); } }