Time for action – finding stuff in the scene graph
When you create effects in the SDK, you can add several spatials to one .j3o
file. For a campfire, you would add one fire emitter, one smoke emitter, and some wooden logs geometries. After loading the scene, you may want to change the effect properties inside the loaded scene, but how do you access, say, the fire emitter, without a variable?
Use the following approach to find any spatial anywhere in your scene graph:
- Make a copy of
Main.java
and name the classLoadEffectFromJ3o.java
. Remember to also refactor the first line of themain()
method toLoadEffectFromJ3o app = new LoadEffectFromJ3o();
. - Load the
.j3o
file containing your effect in thesimpleInitApp()
method, usingassetManager
, and attach ...
Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.