Пример #1
0
LightEntity::LightEntity(OgreSystem *scene, const std::tr1::shared_ptr<ProxyLightObject> &plo, const std::string &id)
    : Entity(scene,
             plo,
             id.length()?id:ogreLightName(plo->getObjectReference()),
             scene->getSceneManager()->createLight(id.length()?id:ogreLightName(plo->getObjectReference()))) {
    getProxy().LightProvider::addListener(this);
}
Пример #2
0
CameraEntity::CameraEntity(OgreSystem *scene,
                           const std::tr1::shared_ptr<ProxyCameraObject> &pco,
                           std::string ogreName)
    : Entity(scene,
             pco,
             ogreName.length()?ogreName:ogreName=ogreCameraName(pco->getObjectReference()),
             NULL),
      mRenderTarget(NULL),
      mViewport(NULL) {
    getProxy().CameraProvider::addListener(this);
    String cameraName = ogreName;
    if (scene->getSceneManager()->hasCamera(cameraName)) {
        init(scene->getSceneManager()->getCamera(cameraName));
    } else {
        init(scene->getSceneManager()->createCamera(cameraName));
    }
    getOgreCamera()->setNearClipDistance(scene->getOptions()->referenceOption("nearplane")->as<float32>());
    getOgreCamera()->setFarClipDistance(scene->getOptions()->referenceOption("farplane")->as<float32>());
}