One issue with ChaseCamera is that it claims to implement Savable, yet its read() method hasn’t worked for some time, if ever.
Short of a complete rewrite, I think the best solution for now is to raise exceptions in read() and write(). Here is my proposed patch to /trunk/engine/src/core/com/jme3/input/ChaseCamera.java and /branches/gradle-restructure/jme3-core/src/main/java/com/jme3/input/ChaseCamera.java :
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -31,10 +31,8 @@
*/
package com.jme3.input;
-import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
-import com.jme3.export.OutputCapsule;
import com.jme3.input.controls.*;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
@@ -581,9 +579,8 @@
* @throws IOException
*/
public void write(JmeExporter ex) throws IOException {
- OutputCapsule capsule = ex.getCapsule(this);
- capsule.write(maxDistance, "maxDistance", 40);
- capsule.write(minDistance, "minDistance", 1);
+ throw new UnsupportedOperationException(
+ "remove ChaseCamera before saving");
}
/**
@@ -592,9 +589,7 @@
* @throws IOException
*/
public void read(JmeImporter im) throws IOException {
- InputCapsule ic = im.getCapsule(this);
- maxDistance = ic.readFloat("maxDistance", 40);
- minDistance = ic.readFloat("minDistance", 1);
+ throw new UnsupportedOperationException("can't read ChaseCamera");
}
/**