Patch for saving the joint anchor

Tested and verified. Sooner or later we'll get it all done, one thing at a time.  8)


Index: Joint.java
===================================================================
RCS file: /cvs/jmephysics/src/com/jmex/physics/Joint.java,v
retrieving revision 1.13
diff -u -r1.13 Joint.java
--- Joint.java   26 Nov 2007 10:28:36 -0000   1.13
+++ Joint.java   23 Feb 2008 02:59:13 -0000
@@ -263,8 +263,9 @@
     public Class getClassTag() {
           return Joint.class;
     }
-   
+
     public static final String ACTIVE_PROPERTY = "active";
+    public static final String ANCHOR_PROPERTY = "anchor";
     public static final String AXES_PROPERTY = "axes";
     public static final String NAME_PROPERTY = "name";
     public static final String NODES_PROPERTY = "nodes";
@@ -290,6 +291,10 @@
             attach( nodes.get( 0 ), nodes.get( 1 ) );
          }
       }
+
+        Vector3f anchor = (Vector3f) capsule.readSavable(ANCHOR_PROPERTY, Vector3f.ZERO );
+        if (!Vector3f.ZERO.equals(anchor))
+           setAnchor(anchor);
    }
 
    public void write(JMEExporter ex) throws IOException {
@@ -298,6 +303,7 @@
         capsule.write( getName(), NAME_PROPERTY, null );
         capsule.writeSavableArrayList( new ArrayList<JointAxis>( axes ), AXES_PROPERTY, null );
         capsule.writeSavableArrayList( new ArrayList<DynamicPhysicsNode>( getNodes() ), NODES_PROPERTY, null );
+        capsule.write(getAnchor( null ), ANCHOR_PROPERTY, Vector3f.ZERO );
    }
 
     /**

thanks nymon! committed to cvs