private void findTargets(Node node) { for (Spatial child : node.getChildren()) { if (child instanceof Geometry) { findTargets((Geometry) child); } else if (child instanceof Node) { findTargets((Node) child); } } }
/** * Update the lists of animation targets. * * @param spatial the controlled spatial */ private void updateTargetsAndMaterials(Spatial spatial) { targets.clear(); if (spatial instanceof Node) { findTargets((Node) spatial); } else if (spatial instanceof Geometry) { findTargets((Geometry) spatial); } } }