public static void deepRotate(Spatial s, int x, int y, int z) { Quaternion q = s.getLocalRotation(); // only transform objects with non-zero rotation if (q.x != 0 || q.y != 0 || q.z != 0 || q.w != 1) { s.setLocalRotation(q.addLocal(Rotator.fromThreeAngles(x, y, z))); } if (s instanceof Node) { if (((Node) s).getChildren() != null) { for (Spatial child : ((Node) s).getChildren()) { deepRotate(child, x, y, z); } } } }