本文整理汇总了C++中ogre::Camera::getAspectRatio方法的典型用法代码示例。如果您正苦于以下问题:C++ Camera::getAspectRatio方法的具体用法?C++ Camera::getAspectRatio怎么用?C++ Camera::getAspectRatio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Camera
的用法示例。
在下文中一共展示了Camera::getAspectRatio方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
QObject::connect(entityContainer, SIGNAL(boneTransformUpdated(const QString &, double, double, double, double, double, double)), entityCopyContainer, SLOT(updateBoneTransform(const QString &, double, double, double, double, double, double)));
}
}
result = dynamic_cast<Ogre::MovableObject *>(entityCopy);
} else if (typeName == "Light") {
// clone light
Ogre::Light *light = dynamic_cast<Ogre::Light *>(movableObject);
Ogre::Light *lightCopy = sceneManager->createLight(name.toStdString());
lightCopy->setType(light->getType());
lightCopy->setDiffuseColour(light->getDiffuseColour());
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());
示例2: camera_get_aspect_ratio
//Ogre::Frustum::getAspectRatio() const
float camera_get_aspect_ratio(CameraHandle handle)
{
Ogre::Camera* camera = static_cast<Ogre::Camera*>(handle);
return camera->getAspectRatio();
}