Thanks, that makes it a lot clearer.
You can't really use something like shared objects for a scenegraph because it would send across way too much information.
What would I use a shared object for then?
It is the SynchronizeCreateMessage that defines the information needed to create what is necessary on the scenegraph. There are particular fields to specify additional information, and you can always extend SynchronizeCreateMessage if you need to send more information.
I was being stupid

should have figured that one out myself! I've hit a bit of trouble however, I created my own message which extended SynchronizeCreateMessage but for some reason I keep getting this error when I run my code:
com.captiveimagination.jgn.convert.ConversionException: Error deserializing instance of class: com.virtualplasticity.gaia.jgn.SyncMessage
at com.captiveimagination.jgn.convert.Converter.readClassAndObject(Converter.java:201)
at com.captiveimagination.jgn.NIOMessageServer.readMessage(NIOMessageServer.java:190)
at com.captiveimagination.jgn.TCPMessageServer.read(TCPMessageServer.java:134)
at com.captiveimagination.jgn.NIOMessageServer.updateTraffic(NIOMessageServer.java:143)
at com.captiveimagination.jgn.clientserver.JGNClient.updateTraffic(JGNClient.java:246)
at com.captiveimagination.jgn.clientserver.JGNClient.update(JGNClient.java:235)
at com.captiveimagination.jgn.UpdatableRunnable.run(JGN.java:437)
at java.lang.Thread.run(Thread.java:636)
Caused by: com.captiveimagination.jgn.convert.ConversionException: Error constructing instance of class (check constructors): com.virtualplasticity.gaia.jgn.SyncMessage
at com.captiveimagination.jgn.convert.Converter.newInstance(Converter.java:267)
at com.captiveimagination.jgn.convert.FieldConverter.readObjectData(FieldConverter.java:99)
at com.captiveimagination.jgn.convert.Converter.readClassAndObject(Converter.java:199)
... 7 more
Caused by: java.lang.InstantiationException: com.virtualplasticity.gaia.jgn.SyncMessage
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:325)
at com.captiveimagination.jgn.convert.Converter.newInstance(Converter.java:265)
Here is my extension of SynchronizeCreateMessage:
public class SyncMessage extends SynchronizeCreateMessage {
public String name;
public String modelURL;
public float posX, posY, posZ;
public float angle, rotX, rotY, rotZ;
public float scaleX, scaleY, scaleZ;
public SyncMessage(String name, String modelURL, Vector3f pos, Vector3f scale, Quaternion rot) {
this.name = name;
this.modelURL = modelURL;
posX=pos.x; posY=pos.y; posZ=pos.z;
scaleX=scale.x; scaleY=scale.y; scaleZ=scale.z;
angle=rot.w; rotX=rot.x; rotY=rot.y; rotZ=rot.z;
}
public Node createNode() {
Box box = new Box(name, new Vector3f(posX, posY, posZ), new Vector3f(scaleX, scaleY, scaleZ));
box.setModelBound(new BoundingBox());
box.updateModelBound();
Node boxNode = new Node(name + "Node");
boxNode.attachChild(box);
return boxNode;
}
}