本文整理汇总了C++中ogre::MovableObject::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::setVisible方法的具体用法?C++ MovableObject::setVisible怎么用?C++ MovableObject::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MovableObject
的用法示例。
在下文中一共展示了MovableObject::setVisible方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mLightning
MapCameraLightningInstance::MapCameraLightningInstance(MapCameraLightning& lightning)
: mLightning(lightning)
{
Ogre::SceneManager::MovableObjectIterator iterator = lightning.getSceneManager().getMovableObjectIterator(Ogre::LightFactory::FACTORY_TYPE_NAME);
while (iterator.hasMoreElements()) {
Ogre::MovableObject* light = iterator.getNext();
if (light && light != mLightning.getLight()) {
if (light->getVisible()) {
mVisibleLights.push_back(light);
light->setVisible(false);
}
}
}
mLightning.getLight()->setVisible(true);
mAmbientColour = mLightning.getSceneManager().getAmbientLight();
mLightning.getSceneManager().setAmbientLight(mLightning.getLight()->getDiffuseColour());
}
示例2: _markDbvt
bool gkPhysicsController::_markDbvt(bool v)
{
if (m_suspend)
return false;
bool result = false;
if (m_dbvtMark != v)
{
m_dbvtMark = v;
if ( m_object->getType() == GK_ENTITY && !m_object->getProperties().isInvisible())
{
Ogre::MovableObject* mov = m_object->getMovable();
if (mov)
{
result = mov->isVisible() != m_dbvtMark;
mov->setVisible(m_dbvtMark);
}
}
}
return result;
}
示例3: preRenderTargetUpdate
void ReflectionTextureListener::preRenderTargetUpdate(const RenderTargetEvent& evt)
{
// Hide plane and objects below the water
mWater->setVisible(false);
/*list<Ogre::Entity*> entList = Level::getSingleton()->getEntityList();
list<Ogre::Entity*>::iterator it;
for (it = entList.begin();it != entList.end();it++){
if ((*it)->isVisible()){
Ogre::AxisAlignedBox box = (*it)->getWorldBoundingBox();
if (box.getMinimum().y < mWater->getSceneNode()->_getDerivedPosition().y){
(*it)->setVisible(false);
belowWaterEnts.push_back((*it));
}
}
}*/
/*std::vector<Entity*>::iterator i, iend;
iend = belowWaterEnts.end();
for (i = belowWaterEnts.begin(); i != iend; ++i)
{
(*i)->setVisible(false);
}*/
Ogre::SceneManager::MovableObjectIterator it = Level::getSingleton()->getSceneManager()->getMovableObjectIterator("Entity");
while(it.hasMoreElements()){
Ogre::MovableObject *m = it.getNext();
if (m->isVisible() && m->getParentSceneNode()->_getDerivedPosition().y < mWater->getSceneNode()->_getDerivedPosition().y){
m->setVisible(false);
belowWaterEnts.push_back(m);
}
}
Ogre::Camera* cam = Level::getSingleton()->getCurrentSegment()->getActiveCamera()->getCamera();
cam->enableReflection(mWater->getReflectionPlane());
}
示例4: renderTextures
void ImpostorTexture::renderTextures(bool force)
{
#ifdef IMPOSTOR_FILE_SAVE
TexturePtr renderTexture;
#else
TexturePtr renderTexture(texture);
//if we're not using a file image we need to set up a resource loader, so that the texture is regenerated if it's ever unloaded (such as switching between fullscreen and the desktop in win32)
loader = std::auto_ptr<ImpostorTextureResourceLoader>(new ImpostorTextureResourceLoader(*this));
#endif
RenderTexture *renderTarget;
Camera *renderCamera;
Viewport *renderViewport;
SceneNode *camNode;
//Set up RTT texture
uint32 textureSize = ImpostorPage::impostorResolution;
if (renderTexture.isNull()) {
renderTexture = TextureManager::getSingleton().createManual(getUniqueID("ImpostorTexture"), "Impostors",
TEX_TYPE_2D, textureSize * IMPOSTOR_YAW_ANGLES, textureSize * IMPOSTOR_PITCH_ANGLES, 0, PF_A8R8G8B8, TU_RENDERTARGET, loader.get());
}
renderTexture->setNumMipmaps(MIP_UNLIMITED);
//Set up render target
renderTarget = renderTexture->getBuffer()->getRenderTarget();
renderTarget->setAutoUpdated(false);
//Set up camera
camNode = sceneMgr->getSceneNode("ImpostorPage::cameraNode");
renderCamera = sceneMgr->createCamera(getUniqueID("ImpostorCam"));
camNode->attachObject(renderCamera);
renderCamera->setLodBias(1000.0f);
renderViewport = renderTarget->addViewport(renderCamera);
renderViewport->setOverlaysEnabled(false);
renderViewport->setClearEveryFrame(true);
renderViewport->setShadowsEnabled(false);
renderViewport->setBackgroundColour(ImpostorPage::impostorBackgroundColor);
//Set up scene node
SceneNode* node = sceneMgr->getSceneNode("ImpostorPage::renderNode");
Ogre::SceneNode* oldSceneNode = entity->getParentSceneNode();
if (oldSceneNode) {
oldSceneNode->detachObject(entity);
}
node->attachObject(entity);
node->setPosition(-entityCenter);
//Set up camera FOV
const Real objDist = entityRadius * 100;
const Real nearDist = objDist - (entityRadius + 1);
const Real farDist = objDist + (entityRadius + 1);
renderCamera->setAspectRatio(1.0f);
renderCamera->setFOVy(Math::ATan(entityDiameter / objDist));
renderCamera->setNearClipDistance(nearDist);
renderCamera->setFarClipDistance(farDist);
//Disable mipmapping (without this, masked textures look bad)
MaterialManager *mm = MaterialManager::getSingletonPtr();
FilterOptions oldMinFilter = mm->getDefaultTextureFiltering(FT_MIN);
FilterOptions oldMagFilter = mm->getDefaultTextureFiltering(FT_MAG);
FilterOptions oldMipFilter = mm->getDefaultTextureFiltering(FT_MIP);
mm->setDefaultTextureFiltering(FO_POINT, FO_LINEAR, FO_NONE);
//Disable fog
FogMode oldFogMode = sceneMgr->getFogMode();
ColourValue oldFogColor = sceneMgr->getFogColour();
Real oldFogDensity = sceneMgr->getFogDensity();
Real oldFogStart = sceneMgr->getFogStart();
Real oldFogEnd = sceneMgr->getFogEnd();
sceneMgr->setFog(Ogre::FOG_EXP2, Ogre::ColourValue(0,0,0,0), 0.0f, 0.0f, 0.0f); //Ember change
//We need to disable all lightning and render it full bright
Ogre::ColourValue oldAmbientColour = sceneMgr->getAmbientLight();
sceneMgr->setAmbientLight(ColourValue::White);
std::vector<Ogre::MovableObject*> lightStore;
Ogre::SceneManager::MovableObjectIterator lightIterator = sceneMgr->getMovableObjectIterator(Ogre::LightFactory::FACTORY_TYPE_NAME);
while (lightIterator.hasMoreElements()) {
Ogre::MovableObject* light = lightIterator.getNext();
if (light) {
if (light->getVisible()) {
lightStore.push_back(light);
light->setVisible(false);
}
}
}
// Get current status of the queue mode
Ogre::SceneManager::SpecialCaseRenderQueueMode OldSpecialCaseRenderQueueMode = sceneMgr->getSpecialCaseRenderQueueMode();
//Only render the entity
sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_INCLUDE);
sceneMgr->addSpecialCaseRenderQueue(group->geom->getRenderQueue() + 1);
uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();
entity->setRenderQueueGroup(group->geom->getRenderQueue() + 1);
bool oldVisible = entity->getVisible();
entity->setVisible(true);
float oldMaxDistance = entity->getRenderingDistance();
entity->setRenderingDistance(0);
//.........这里部分代码省略.........
示例5: movableobject_set_visible
///void _updateRenderQueue(RenderQueue* queue) = 0;
//TODO:DLL void movableobject__update_render_queue(MovableObjectHandle handle, RenderQueueHandle queue);
///void setVisible(bool visible);
void movableobject_set_visible(MovableObjectHandle handle, int visible)
{
Ogre::MovableObject* obj = static_cast<Ogre::MovableObject*>(handle);
obj->setVisible(visible);
}
示例6: setVisible
void setVisible(bool visible) { if (mOgreObject) mOgreObject->setVisible(visible); }
示例7: Load
void Map::Load(std::string sceneFile)
{
this->mLoader = new Utilities::DotSceneLoader();
this->mLoader->parseDotScene(sceneFile, "General", GameFramework::getSingletonPtr()->sceneManager);
std::vector<Ogre::Entity*> mNavmeshEnts;
/*Ogre::Entity* mapE = GameFramework::getSingletonPtr()->sceneManager->createEntity("Map", "dungeon.mesh");
Ogre::SceneNode* mapNode = GameFramework::getSingletonPtr()->sceneManager->getRootSceneNode()->createChildSceneNode("MapNode");
mapNode->scale(Vector3(2,2,2));
mapNode->attachObject(mapE);
mNavmeshEnts.push_back(mapE);*/
mRecast = new OgreRecast(GameFramework::getSingletonPtr()->sceneManager);
mDetourTileCache = new OgreDetourTileCache(mRecast);
if (this->mLoader != 0)
{
if (this->mLoader->entityList->size() > 0)
{
ConfigFile cf;
std::vector<Ogre::Entity*> srcMeshes;// = std::vector<Ogre::Entity*>(this->mLoader->entityList->begin(), this->mLoader->entityList->end());
bool could_find_plane = false;
for (int i = 0; i < this->mLoader->entityList->size(); i++ )
{
Ogre::Entity* ent = this->mLoader->entityList->at(i);
if (ent->getName() == "Plane#0")
{
//ent->setMaterialName("MyMaterial");
ent->setMaterialName("PlaneMaterial");
ent->setCastShadows(false);
//ent->setVisible(false);
//ent->getParentSceneNode()->setPosition(Vector3(0,0,0));
srcMeshes.clear();
srcMeshes.push_back(ent);
could_find_plane = true;
}
}
if (could_find_plane)
{
inputGeom = new InputGeom(srcMeshes);
}
else
{
//srcMeshes = std::vector<Ogre::Entity*>(this->mLoader->entityList->begin(), this->mLoader->entityList->end());
if (this->mLoader->getTerrainGroup() != 0)
{
inputGeom = new InputGeom(this->mLoader->getTerrainGroup(), srcMeshes);
}
else
{
inputGeom = new InputGeom(srcMeshes);
}
}
if(mDetourTileCache->TileCacheBuild(inputGeom))
{
mDetourTileCache->drawNavMesh();
}
else
{
Ogre::LogManager::getSingletonPtr()->logMessage("ERROR: could not generate useable navmesh from mesh using detourTileCache.");
return;
}
}
}
Ogre::SceneNode* mNavMeshNode = (Ogre::SceneNode*)GameFramework::getSingletonPtr()->sceneManager->getRootSceneNode()->getChild("RecastSN");
int ttt = mNavMeshNode->numAttachedObjects();
//mNavMeshNode->setVisible(true);
for (int i = 0; i < mNavMeshNode->numAttachedObjects(); i++)
{
Ogre::MovableObject *obj = mNavMeshNode->getAttachedObject(i);
obj->setVisible(false);
obj->setQueryFlags(QueryFlags::NAVMESH_MASK);
}
this->isLoaded = true;
}