本文整理汇总了C++中ogre::Camera::getFocalLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Camera::getFocalLength方法的具体用法?C++ Camera::getFocalLength怎么用?C++ Camera::getFocalLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Camera
的用法示例。
在下文中一共展示了Camera::getFocalLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
lightCopy->setSpecularColour(light->getSpecularColour());
lightCopy->setAttenuation(light->getAttenuationRange(), light->getAttenuationConstant(), light->getAttenuationLinear(), light->getAttenuationQuadric());
lightCopy->setPosition(light->getPosition());
lightCopy->setDirection(light->getDirection());
if (lightCopy->getType() == Ogre::Light::LT_SPOTLIGHT)
lightCopy->setSpotlightRange(light->getSpotlightInnerAngle(), light->getSpotlightOuterAngle(), light->getSpotlightFalloff());
lightCopy->setPowerScale(light->getPowerScale());
lightCopy->setCastShadows(light->getCastShadows());
// create a new container for the cloned light
OgreContainer *lightCopyContainer = new OgreContainer(lightCopy);
lightCopy->setUserAny(Ogre::Any(lightCopyContainer));
if (!light->getUserAny().isEmpty()) {
OgreContainer *lightContainer = Ogre::any_cast<OgreContainer *>(light->getUserAny());
if (lightContainer)
QObject::connect(lightContainer, SIGNAL(sceneNodeUpdated()), lightCopyContainer, SLOT(updateLight()));
}
result = dynamic_cast<Ogre::MovableObject *>(lightCopy);
} else if (typeName == "Camera") {
// clone camera
Ogre::Camera *camera = dynamic_cast<Ogre::Camera *>(movableObject);
Ogre::Camera *cameraCopy = sceneManager->createCamera(name.toStdString());
//cameraCopy->setCustomParameter(0, camera->getCustomParameter(0));
cameraCopy->setAspectRatio(camera->getAspectRatio());
cameraCopy->setAutoAspectRatio(camera->getAutoAspectRatio());
//cameraCopy->setAutoTracking(...);
cameraCopy->setCastShadows(camera->getCastsShadows());
//cameraCopy->setCullingFrustum(camera->getCullingFrustum());
//cameraCopy->setCustomParameter(...);
//cameraCopy->setCustomProjectionMatrix(..);
//cameraCopy->setCustomViewMatrix(..);
//cameraCopy->setDebugDisplayEnabled(...);
//cameraCopy->setDefaultQueryFlags(...);
//cameraCopy->setDefaultVisibilityFlags(...);
cameraCopy->setDirection(camera->getDirection());
//cameraCopy->setFixedYawAxis(...);
cameraCopy->setFocalLength(camera->getFocalLength());
cameraCopy->setFOVy(camera->getFOVy());
//Ogre::Real left;
//Ogre::Real right;
//Ogre::Real top;
//Ogre::Real bottom;
//camera->getFrustumExtents(left, right, top, bottom);
//cameraCopy->setFrustumExtents(left, right, top, bottom);
//cameraCopy->setFrustumOffset(camera->getFrustumOffset());
//cameraCopy->setListener(camera->getListener());
cameraCopy->setLodBias(camera->getLodBias());
//cameraCopy->setLodCamera(camera->getLodCamera());
cameraCopy->setNearClipDistance(camera->getNearClipDistance());
cameraCopy->setFarClipDistance(camera->getFarClipDistance());
cameraCopy->setOrientation(camera->getOrientation());
//cameraCopy->setOrthoWindow(...);
//cameraCopy->setOrthoWindowHeight(...);
//cameraCopy->setOrthoWindowWidth(...);
cameraCopy->setPolygonMode(camera->getPolygonMode());
cameraCopy->setPolygonModeOverrideable(camera->getPolygonModeOverrideable());
cameraCopy->setPosition(camera->getPosition());
cameraCopy->setProjectionType(camera->getProjectionType());
cameraCopy->setQueryFlags(camera->getQueryFlags());
cameraCopy->setRenderingDistance(camera->getRenderingDistance());
cameraCopy->setRenderQueueGroup(camera->getRenderQueueGroup());
//cameraCopy->setRenderSystemData(camera->getRenderSystemData());
cameraCopy->setUseIdentityProjection(camera->getUseIdentityProjection());
cameraCopy->setUseIdentityView(camera->getUseIdentityView());
//cameraCopy->setUserAny(camera->getUserAny());
cameraCopy->setUseRenderingDistance(camera->getUseRenderingDistance());
//cameraCopy->setUserObject(camera->getUserObject());
cameraCopy->setVisibilityFlags(camera->getVisibilityFlags());
cameraCopy->setVisible(camera->getVisible());
//cameraCopy->setWindow(...);
if (!movableObject->getUserAny().isEmpty()) {
CameraInfo *sourceCameraInfo = Ogre::any_cast<CameraInfo *>(movableObject->getUserAny());
if (sourceCameraInfo) {
CameraInfo *targetCameraInfo = new CameraInfo();
targetCameraInfo->width = sourceCameraInfo->width;
targetCameraInfo->height = sourceCameraInfo->height;
dynamic_cast<Ogre::MovableObject *>(cameraCopy)->setUserAny(Ogre::Any(targetCameraInfo));
}
}
//// Setup connections for instances
//SceneNode *targetSceneNode = new SceneNode(cameraCopy);
//((Ogre::MovableObject *)cameraCopy)->setUserAny(Ogre::Any(targetSceneNode));
//if (!((Ogre::MovableObject *)camera)->getUserAny().isEmpty()) {
// SceneNode *sourceSceneNode = Ogre::any_cast<SceneNode *>(((Ogre::MovableObject *)camera)->getUserAny());
// if (sourceSceneNode) {
// QObject::connect(sourceSceneNode, SIGNAL(sceneNodeUpdated()), targetSceneNode, SLOT(updateSceneNode()));
// }
//}
result = dynamic_cast<Ogre::MovableObject *>(cameraCopy);
}
if (!result)
Log::error(QString("Could not clone movable object \"%1\" of type \"%2\".").arg(movableObject->getName().c_str()).arg(typeName.c_str()), "OgreTools::cloneMovableObject");
return result;
}