当前位置: 首页>>代码示例>>C++>>正文


C++ AxisAlignedBox::setMaximum方法代码示例

本文整理汇总了C++中ogre::AxisAlignedBox::setMaximum方法的典型用法代码示例。如果您正苦于以下问题:C++ AxisAlignedBox::setMaximum方法的具体用法?C++ AxisAlignedBox::setMaximum怎么用?C++ AxisAlignedBox::setMaximum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ogre::AxisAlignedBox的用法示例。


在下文中一共展示了AxisAlignedBox::setMaximum方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getWorldSpaceBounds

Ogre::AxisAlignedBox OgreDetourTileCache::getWorldSpaceBounds()
{
    Ogre::AxisAlignedBox result;
    result.setMinimum(m_cfg.bmin[0], m_cfg.bmin[1], m_cfg.bmin[2]);
    result.setMaximum(m_cfg.bmax[0], m_cfg.bmax[1], m_cfg.bmax[2]);

    return result;
}
开发者ID:Unix4ever,项目名称:engine,代码行数:8,代码来源:OgreDetourTileCache.cpp

示例2: buildTiles

void OgreDetourTileCache::buildTiles(InputGeom *inputGeom, const Ogre::AxisAlignedBox *areaToUpdate)
{
    // Use bounding box from inputgeom if no area was explicitly specified
    Ogre::AxisAlignedBox updateArea;
    if(!areaToUpdate)
        updateArea = inputGeom->getBoundingBox();
    else
        updateArea = *areaToUpdate;

    // Reduce bounding area a little with one cell in size, to be sure that if it was already tile-aligned, we don't select an extra tile
    updateArea.setMinimum( updateArea.getMinimum() + Ogre::Vector3(m_cellSize, 0, m_cellSize) );
    updateArea.setMaximum( updateArea.getMaximum() - Ogre::Vector3(m_cellSize, 0, m_cellSize) );

    // Select tiles to build or rebuild (builds a tile-aligned BB)
    TileSelection selection = getTileSelection(updateArea);


    // Debug drawing of bounding area that is updated
    // Remove previous debug drawn bounding box of rebuilt area
    if(mDebugRebuiltBB) {
        mDebugRebuiltBB->detachFromParent();
        m_recast->m_pSceneMgr->destroyManualObject(mDebugRebuiltBB);
        mDebugRebuiltBB = NULL;
    }
    if(DEBUG_DRAW_REBUILT_BB)
        mDebugRebuiltBB = InputGeom::drawBoundingBox(selection.bounds, m_recast->m_pSceneMgr);


    int tilesToBuildX = (selection.maxTx - selection.minTx)+1;  // Tile ranges are inclusive
    int tilesToBuildY = (selection.maxTy - selection.minTy)+1;
    if(tilesToBuildX * tilesToBuildY > 5)
        Ogre::LogManager::getSingletonPtr()->logMessage("Building "+Ogre::StringConverter::toString(tilesToBuildX)+" x "+Ogre::StringConverter::toString(tilesToBuildY)+" navmesh tiles.");

    // Build tiles
    for (int ty = selection.minTy; ty <= selection.maxTy; ty++) {
        for (int tx = selection.minTx; tx <= selection.maxTx; tx++) {
            buildTile(tx, ty, inputGeom);
        }
    }
}
开发者ID:Unix4ever,项目名称:engine,代码行数:40,代码来源:OgreDetourTileCache.cpp

示例3: getTileBounds

Ogre::AxisAlignedBox OgreDetourTileCache::getTileBounds(int tx, int ty)
{
    const float* bmin = m_recast->m_cfg.bmin;
    const float ts = getTileSize();


    Ogre::AxisAlignedBox result;


    result.setMinimum(
                bmin[0] + tx * ts,
                bmin[1],
                bmin[2] + ty * ts
                );

    result.setMaximum(
                bmin[0] + (tx+1) * ts,
                m_recast->m_cfg.bmax[1],
                bmin[2] + (ty+1) * ts
                );

    return result;
}
开发者ID:Unix4ever,项目名称:engine,代码行数:23,代码来源:OgreDetourTileCache.cpp

示例4: processNode


//.........这里部分代码省略.........
                                    }
    					            else
                                    {
                                        GeometryType geom = GT_NONE;
                                        if (type == "sphere")
                                        {
                                            geom = GT_SPHERE;
                                        }
                                        else if (type == "box")
                                        {
                                            geom = GT_BOX;
                                        }
                                        else if (type == "ellipsoid")
                                        {
                                            geom = GT_ELLIPSOID;
                                        }
                                        else if (type == "pyramid")
                                        {
                                            geom = GT_PYRAMID;
                                        }
                                        else if (type == "capsule")
                                        {
                                            geom = GT_CAPSULE;
                                        }
                                        else
                                        {
                                            LOG_ERROR(Logger::SCRIPT, "Unknown area type '" + type + "' !");
                                        }
                                        
                                        if ( geom != GT_NONE)
                                        {
                                            Ogre::AxisAlignedBox aabb;
                                            aabb.setMinimum( - scale / 2.0f);
                                            aabb.setMaximum( + scale / 2.0f);

                                            if (subtract)
                                                ZoneManager::getSingleton().subtractAreaFromZone(name,
                                                    aabb, geom, position, offset, rotation, transitionDistance, QUERYFLAG_PLAYER);
                                            else
                                                ZoneManager::getSingleton().addAreaToZone(name,
                                                    aabb, geom, position, offset, rotation, transitionDistance, QUERYFLAG_PLAYER);
                                        }
                                    }
                                }
                                else
                                {
                                    LOG_ERROR(Logger::SCRIPT, "<area> elemt must have attribute 'type'");
                                }
                            }
                        }
                    }

					if (zone)
					{
						for (const TiXmlNode* cur = curZoneElem->FirstChild(); cur != NULL; cur = cur->NextSibling())
						{
							if (cur->Type() == TiXmlNode::ELEMENT)
							{
								const TiXmlElement* curElem = cur->ToElement();
								if (hasNodeName(curElem, "light"))
								{
									Ogre::String name = getAttributeValueAsStdString(curElem, "name");
									zone->addLight(ActorManager::getSingleton().getActor(name));
								}
								else if (hasNodeName(curElem, "sound"))
								{
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:67,代码来源:ZoneProcessor.cpp


注:本文中的ogre::AxisAlignedBox::setMaximum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。