ssebi / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

additional search-methods in the scene-graph #175

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago
thanks

Original comment by ShadowIs...@gmail.com on 30 Oct 2010 at 6:57