I have the following situation:
I'm copying new branch groups to the root of my scenegraph at runtime.
public static void copyAndInvalidateSource(BranchGroup destination, BranchGroup source) {
List<Node> children;
if (source == null || destination == null) {
throw new IllegalArgumentException();
}
destination.removeAllChildren();
children = new ArrayList<Node>();
for (int i = 0; i < source.numChildren(); i++) {
children.add(source.getChild(i));
}
source.removeAllChildren();
for (Node child : children) {
destination.addChild(child);
}
destination.setIsOccluder(source.isOccluder());
// TODO: bad hack!
PrivateAccessor.setPrivateField(destination, "boundsDirty", true);
destination.updateBounds(true);
destination.setPickable(source.isPickable());
destination.setPickable(source.isRenderable());
}
When I have only ONE child to be copied, and it's a transform group, looks like the transform matrix is not being updated...
When I have more than one child to be copied everything runs fine.
Do you know why this may be happening?
Att,