Look in there for answers “How do I get the application from my BaseAppState?” It’s in the javadoc. “How do I get the asset manager from the application?” It’s in the javadoc.
How many applications do you want in your application and will they have applications and will those applications have applications?
Just one SimpleApplication per application.
From any BaseAppState:
getApplication().getAssetManager().loadModel(…)
…but if these are the things you struggle to find you are in for a long road. So keep the javadoc open all the time. Do the tutorials. Look for game examples to learn from. And so on.
As the others said, do the tutorials, all of them, you will learn a bunch from it. Then when you have a problem, write a simple one class application and load there your what ever you want to load and paste that code in the forum and ask why it is not working. for now it’s for all here fishing in the dark as we do not see what you see.
I got a problem when I load my model, I find that I can’t convert the blender file to j3o in my SDK. Could tell me what is happening and any solutions? Or anyone could help me to convert that to be a model that can be solved by AssetManager?
You’re using Blender’s particle system (hair) to create grass. It won’t be imported to jME even on Blender 2.79, which is the last version with jME support. It won’t be exported to glTF either.
You should read the how to model tutorial first. The glTF entry in Blender’s manual is also important.
Now I got a new question. How can I check the collision result (Geometry) is on my “shootable” list (with Spatial)? Since I got to return the spatial that I open/marked by the crosshair when click my mouse button.
I only know the ray casting from the beginner tutorial. They only check geometry with geometry. And in the node tutorial I know that the geometry extends spatial, but what can I do to get it back or just to check the belongings?
Also, when I use geometry.getParent, the method will leads to Rootnode, thus the checking breaks down.
if you want to fetch the children of NodeA, just do nodeA.getChildren() then use foreach to iterate over children one by one, if you want to get one geometry only, just do ((Node)rootNode.getChildByName("NodeA")).getChildByName("GeoA");
Look for Node java docs, you will find it much easier.
But in the collision result, I’ll search for the closest, therefore I got only one geometry. Then I need to check whether the closest result (only one geometry) is on any Spatial in the shootable list (many spatials), so the your node A should be my “shootable”, however the spatials are also in that. So how can I do that?
Loop over the children of the proposed Node using node.getChildren() & an enhanced for-loop.
Check for each subNode or subSpatial if it’s nearest or far from a target site using subNode.getLocalTranslation().distance(cam.getLocalTranslation()) which retruns float.
Are you actually asking how to get the parent of the collision result?
(hint: getParent())
…or?
As for keywords, I don’t know… maybe “CollisionResult” and “pspeed”. I wrote Lemur so people don’t have to deal with this stuff on their own every time. Just add a listener to the spatial that gets called when the user clicks on it.