October 18, 2021, 10:22pm
I need to be able to mark specific points on my j3o scene for future reference. For instance, marking an enemy spawn point or where a road is.
Is there some way to do this
without manually defining each point in the code (preferably using SceneComposer)?
Edit: I accidentally closed the SceneExplorer window and can’t get it back.
How do I open that back up…?
October 18, 2021, 10:45pm
I think creating blank nodes along the scene, you can use sdk scene composer to do so.
October 19, 2021, 12:22am
Also I think it’s common enough to place some kind of marker geometry and then tag them with user data so that they can be cleaned up on load (and turned into whatever game structure is necessary).
Especially common for entity-component-system (ECS) based games to have some kind of entity placement scheme like this.
October 19, 2021, 3:28am
In my case, I have developed my ECS-based scene editor, I use it to place entities on the scene, and on export, it generates a JSON file that includes the object type, spawn-position, and an optional tag name.
October 19, 2021, 7:16pm
How do I tag the data, and how will the code get that data from the j3o file?
October 19, 2021, 7:18pm
October 19, 2021, 7:40pm
How do I use getUserData() on my scene to get specific geometries contained in the scene as well as their locations?
I’m not exactly sure how getUserData() works, since there isn’t documentation for it. You’d have to explain the finer points for me (like which keys I should use to get what).
UserData is just that, it is your data. Just a HashMap (probably, didn’t check, but at least works as such) on a spatial. So you make your own keys.
October 19, 2021, 8:32pm
In the scene editor. Set user data on your geometry or whatever.
When you load your j3o, traverse the scene… with a scene traverser (don’t have time to google the javadoc for you at the moment). Find the geometry with your user data. Do stuff with it.
What it is is up to you.