本文整理汇总了C++中ogre::Camera::getFrustumExtents方法的典型用法代码示例。如果您正苦于以下问题:C++ Camera::getFrustumExtents方法的具体用法?C++ Camera::getFrustumExtents怎么用?C++ Camera::getFrustumExtents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Camera
的用法示例。
在下文中一共展示了Camera::getFrustumExtents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CEntityVisualHelper
// constructor
CCameraVisualHelper::CCameraVisualHelper(CBaseEditor *parent)
: CEntityVisualHelper(parent),
mColour(0.588f, 0.588f, 0.588f),
mNearClipDistance(0.1f),
mFarClipDistance(100.0f),
mQuadNearOffset(1.0f),
mQuadFarOffset(5.0f),
mResourceGroup("General")
{
Ogre::Camera *cam = static_cast<CCameraEditor*>(mParent)->getCamera();
if(cam)
{
cam->getFrustumExtents(mFrustumLeft,mFrustumRight,mFrustumTop,mFrustumBottom);
mNearClipDistance = cam->getNearClipDistance();
mFarClipDistance = cam->getFarClipDistance();
}
SetModel("scbCamera.mesh");
CONNECT_PROPERTY_MEMFN(mParent, "selected", CCameraVisualHelper, OnSelectionChange, mPropConnections[0]);
CONNECT_PROPERTY_MEMFN(mParent, "fov", CCameraVisualHelper, OnFOVChange, mPropConnections[1]);
CONNECT_PROPERTY_MEMFN(mParent, "clipdistance", CCameraVisualHelper, OnClipDistanceChange, mPropConnections[2]);
mSceneManager = parent->getSceneManager();
// create our manual object and set initial values
mVisualHelperObject = mSceneManager->createManualObject("CVH" + parent->getName());
mVisualHelperObject->estimateIndexCount(gCameraEstimateIndexCount);
mVisualHelperObject->estimateVertexCount(gCameraEstimatedVertexCount);
mVisualHelperObject->setDynamic(true);
// create a material for the visual representation
mMaterial = Ogre::MaterialManager::getSingleton().create("CVH" + parent->getName() + "_Material", mResourceGroup);
mMaterial->setReceiveShadows(false);
mMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
mMaterial->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_DIFFUSE);
// create 3 sections, 2 for both quads and 1 for the connecting lines
mVisualHelperObject->begin(mMaterial->getName(), Ogre::RenderOperation::OT_LINE_STRIP);
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->end();
mVisualHelperObject->begin(mMaterial->getName(), Ogre::RenderOperation::OT_LINE_STRIP);
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->end();
mVisualHelperObject->begin(mMaterial->getName(), Ogre::RenderOperation::OT_LINE_LIST);
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->position(0,0,0); // dummy
mVisualHelperObject->colour(1,1,1); // dummy
mVisualHelperObject->end();
mVisualHelperObject->setVisible(false);
mNode->attachObject(mVisualHelperObject);
_createCamera();
}