for example... i load a tiger.3ds and insert them in gameNode..
i have a class Tiger.java... that will carry infos about this object... like name, age, strength, and other things...
i dont know how to create a path between my class tiger (that extends a Spatial) and the model in the screen...
cause i want to click in the Tiger model with ID 1... and load the info about the Tiger 1... and so on...
make sure you are setting names on ALL the models you import…
Spatial model = [ load model....]
model.setName( "modelName" );
Also, those names should be unique for each model loaded otherwise picking may result object 'collisions' (ex. tiger1 and tiger2 (vs) tiger and tiger).
What I do in my app is use setUserData() to store some data object, when I receive the geometry from the pick callback, I loop through the ancestors of said geometry until I find one with the user data set.
What I do in my app is use setUserData() to store some data object, when I receive the geometry from the pick callback, I loop through the ancestors of said geometry until I find one with the user data set.
Also have a search on the forum for entity and entity node - simple framework that extends Node and implements Entity - that way you just test instanceof Entity on the picks