How do I share spatials with attached controllers? I have searched the forum and found vague references to CloneCreator and the Clone-render queue, but in the sources (0.10) there is no such thing. And SharedNode doesn't clone the controllers…
Please give me some guidance in this matter.
protected static Node clone(Node m) {
Node result = null;
//Spatial m = null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
BinaryExporter.getInstance().save(m, out);
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
result = (Node)BinaryImporter.getInstance().load(in);
} catch (IOException e) {
e.printStackTrace();
}
return(result);
}
Pass in the original copy of your model, this should provide a complete copy that you can animat independant of the original.
I have the same issue, when i use sharedNodes and a md5 model there are no controllers.
does the cloning the same as sharedNode ? or has sharedNode some benefits ? (like uses display lists on hardware or something like that)
thanks
Sebastian