In the process, I've realized that I'm going to need a generic "instance provider" for each type. That is, I need a way, given a particular type, to ask somehow about the names of all of the objects that exist of that type. I also need a way to say "create a sample preview in this scene of that particular type" without knowing what it is exactly I'm constructing. What this means is that, for example, the Entity is constructed very differently than a particle system. I don't want the editor to know about these types so I would like a way for the entity editor to query for the names of entities and the names of particle systems. Then I need some "preview provider" to be able to say, "create an 'entity' with the name 'xx' attached to this parent." and "create a 'particle system' with the name 'xx' attached to this parent". I don't want those to be two different operations. If I get this, it would mean that any object in the future that provides these things will automatically get picked up by the entity editor as potential things to be attached to bones as well as being able to provide an automatic preview of the object itself. That's the ideal goal.
I've already got a decent amount of this working. I already have the list of 'types' that will provide me with the commands and properties I need to accomplish my goals at run-time so now I just need to be able to produce a list of instance names as well as provide an automatic preview for any given type and I'm all set. That's what I'm working on now.
In the following shot, you can see that I've added a wireframe overlay on to the selected objects. This is an automatic thing that happens now on any selected entity which is rather nice. I didn't create this effect, credit goes to someone in the forums (I can't remember where I saw it). It's done at run-time as follows:
- Create an additional pass on each material for the Entity
- Disable lighting on the new pass
- Set the polygon mode as PM_WIREFRAME
- Set a depth bias so that the wireframe doesn't z-fight with the actual object. (I'm using 10.0)
You can also see that I have a sword in the lizard mans hands in the entity editor. That was actually created, placed, rotated, and positioned correctly using nothing but the editor. Each viewport can have their own gizmos which is nice. This came for free from the 'scene' concept. Each scene has its own set of gizmos. There is always the default world scene but anything is able to create additional scenes. The ResourceBrowser creates an additional scene for its preview window and the EntityEditor creates its own.
Each scene has the following unique instances:
- Ogre::SceneManager
- Selection Manager
- Gizmo Manager
- Sceneobject Manager