Architecture/EntityNaming

Entity Naming Scheme
acts on "entity"s. Every entity has a name. This name is captured by the  class which defines a name as having three parts:
 * header: a protocol control for the entity (usually "http");
 * host: the part of the name that relates to the remote source/repository the entity is from;
 * entity: the part of the name that is the name of the entity in the host

The string form of the entity name is: Host/Entity[/Additions[.Type]]

where "Entity" is the name the entity comes with from it's world. The "Host" is the name of the originator of the "LocalName" and it qualified the name to make it globally unique. "Additions" are added by various systems and they are usually added in such a way that he entity name can be reconstructed from the modified name (see below). "Type" is added by systems and is like "Additions".

For LLLP, "LocalName" is the UUID of the object and "Host" is the name of the simulator it is from. The hostname is qualified to be a domain name: blueland.agni.secondlife.com/12345678-1234-1234-1234-123456789012

The entity names are managed by  and any service specific conversion of the names (from basic entity name to filename and back) are done in service specific conversion classes (like LookingGlass.Renderer.Ogre.EntityNameOgre). This keeps the name specific conversion code in centralized places rather than letting it scatter around the application.

All entity name references are through an instance of. Initially, LookingGlass used strings so there are a few instances of strings being used. If you find one of these, fix it by converting it to the class reference.

It is also presumed that the entity name that is generated from the host is the same across sessions. So, for LLLP for instance, one must use the UUID name of the entity and not the LocalID. This allows caching of entitles across sessions.

Adapting to Ogre
Ogre uses meshes attached to named scene nodes. Each scene node corresponds to a displayed entity from. The entity name is given to the scene node. The mesh is given the entity name plus some Additions. In this way, an arbitrary mesh name can be converted to an entity name to find the prim description of the mesh. Additionally, the mesh used for an entity need not be the mesh that cooresponds to that entity. This happens when meshes are being shared or meshes are being reduced for level-of-detail processing.

Materials are handled like meshes with the material name that is given to Ogre can be converted back into the entity name that holds the material definition.

Textures do not map to an entity but to an asset server. For textures, the name given to Ogre is the name of the AssetContext for the texture plus the entity name for that asset context.

All of these conversions are coded in RendererOgre.EntityNameOgre.

There are several Additions that are created by the Ogre Renderer:
 * /MO : Moveable object that is used to create the mesh. Should never be stored
 * /Entity : The name of the Ogre::Entity that the prim mesh is attached to
 * -N.material : the name of the material on the face N of the entity
 * .mesh : the name of the mesh created from the entity. This is turned into the	filename where the mesh is stored/cached.