I’ve spent a couple of days debugging and now I suspect that Node.sharedCopy() is buggy.
Here is the suspect code in Node.sharedCopy():
} else if (node instanceof Shape3D) {
Shape3D shape = (Shape3D)node;
Shape3D newShape = new Shape3D();
newShape.setAppearance(shape.getAppearance());
newShape.setGeometry(shape.getGeometry());
newShape.setBoundsAutoCompute(false);
newShape.setBounds(shape.getBounds());
newShape.updateBounds(false);
newShape.setPickable(node.getPickable());
newShape.setPickable(node.getRenderable());
return newShape;
My problems go away when I use something much simpler like this instead:
Shape3D clone = new Shape3D (
shape3D.getGeometry ( ),
shape3D.getAppearance ( ) );
-
Is “newShape.setPickable(node.getRenderable());” supposed to be “newShape.setRenderable(node.getRenderable());”?
-
Why does Node.sharedCopy() turn off bounds updating?
