protected Node clone(final Node original) { Node copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; } }
protected Node clone(final Node original) { Node copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; } }
protected void createJointAttachment(final JointNode jointChildNode, final Node node, final Node subNode) { final AttachmentPoint attach = new AttachmentPoint("attach-" + node.getName(), (short) 0, subNode, new Transform(subNode.getTransform())); _dataCache.addAttachmentPoint(jointChildNode.getJoint(), attach); // we will attach to scene instead. subNode.removeFromParent(); }