Exemplo n.º 1
0
SharedResourcePtr GraphicsResourceManager::getResourceEntity(const SpaceObjectReference &id, GraphicsEntity *graphicsEntity)
{
  WeakResourcePtr curWeakPtr = getResource(id.toString());
  SharedResourcePtr curSharedPtr = curWeakPtr.lock();
  if (curSharedPtr)
    return curSharedPtr;
  else {
    curSharedPtr = GraphicsResource::construct<GraphicsResourceEntity>(id, graphicsEntity);
    mIDResourceMap[id.toString()] = curSharedPtr;
    mEntities.insert(curSharedPtr.get());

    return curSharedPtr;
  }
}
Exemplo n.º 2
0
std::string CameraEntity::ogreCameraName(const SpaceObjectReference&ref) {
    return "Camera:"+ref.toString();
}
Exemplo n.º 3
0
void ObjectHost::registerHostedObject(const SpaceObjectReference &sporef_uuid, const HostedObjectPtr& obj)
{
    HostedObjectMap::iterator iter = mHostedObjects.find(sporef_uuid);
    if (iter != mHostedObjects.end()) {
        SILOG(oh,error,"Two objects having the same internal name in the mHostedObjects map on connect"<<sporef_uuid.toString());
    }
    mHostedObjects[sporef_uuid]=obj;
}
Exemplo n.º 4
0
void ObjectHost::unregisterHostedObject(const SpaceObjectReference& sporef_uuid, HostedObject* key_obj)
{
    HostedObjectMap::iterator iter = mHostedObjects.find(sporef_uuid);
    if (iter != mHostedObjects.end()) {
        HostedObjectPtr obj (iter->second);
        // The NULL case covers the possibility that the connection finishes
        // after the HostedObject requests destruction and stops paying
        // attention to connection events
        if (key_obj == NULL || obj.get()==key_obj)
            mHostedObjects.erase(iter);
        else
            SILOG(oh,error,"Two objects having the same internal name in the mHostedObjects map on disconnect "<<sporef_uuid.toString());
    }
}
Exemplo n.º 5
0
std::string LightEntity::ogreLightName(const SpaceObjectReference&ref) {
    return "Light:"+ref.toString();
}