So, I've got another question (I know--big surprise, right?).
I've got a TransformGroup node with several Shape3Ds attached to it. Sometimes I wish to update both the attached shapes, and the transform. So, what I've done so far is something like:
TransformGroup tg = (TransformGroup) tgOrig.cloneNode(false);
// setup Shape3Ds and add to group tg
// ...snip...
// add the operation to get this replaced in the correct thread context
getOperationScheduler().scheduleOperation(new replaceTransformGroupSO(toReplace,tg));
// down in the replace group scheduled operation
public void update(long gameTime, long frameTime, TimingMode timingMode)
{
if (this.original != null && this.replacement != null)
{
this.original.getParent().addChild(this.replacement);
this.original.detach();
}
}
Now, this seems to work, except that the cloneNode() function just seems to create a new instance of a TransformGroup, instead of copying over relevant data (such as transforms). Any suggestions on how to do an in-place swap like this?
-Chris
EDIT: The reason I'd like to do a swap instead of directly changing the node's children from a scheduled operation is that I'm accumulating a lot of Scheduled Operations... is this normal, or am I doing something silly and writing (effectively) thread-safe wrappers into my Xith interface?