While working with jME2 the descendantMatches-Methods were such a great option
to search the scenegraph for different kinds of children.
e.g. you could search for all Geometries like this:
List<Geometry> geos = level.descendantMatches(Geometry.class);
especially as ogre-splits the geometries up you can never be sure about the
exact name. Let's say you modelled a level that included an object with the
meshname 'hill'. If you want all geos from the hill:
List<Geometry> geos = level.descendantMatches(Geometry.class,"hill.*");
You can search for everything that extends Spatial.
A textbased search is also possible:
List<Geometry> geos = level.descendantMatches("hill.*");
Here you have to see that also Nodes would fit the query.
And the best, you could take it one to one from jME2
This patch adds a matches(regex)-method to spatial and
descendantMatches(..)-methods to node
Original issue reported on code.google.com by thomas.t...@googlemail.com on 24 Jul 2010 at 2:14
Original issue reported on code.google.com by
thomas.t...@googlemail.com
on 24 Jul 2010 at 2:14Attachments: