From LookingGlass

Jump to: navigation, search
Home < Architecture < EntityNaming

Entity Naming Scheme

LookingGlass acts on "entity"s. Every entity has a name. This name is captured by the World.EntityName 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:


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:

The entity names are managed by LookingGlass.World.EntityName 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 World.EntityName. 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 LookingGlass. 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:

Moveable object that is used to create the mesh. Should never be stored
The name of the Ogre::Entity that the prim mesh is attached to
the name of the material on the face N of the entity
the name of the mesh created from the entity. This is turned into the filename where the mesh is stored/cached.
Personal tools