本文整理汇总了C++中ogre::AxisAlignedBox::setMinimum方法的典型用法代码示例。如果您正苦于以下问题:C++ AxisAlignedBox::setMinimum方法的具体用法?C++ AxisAlignedBox::setMinimum怎么用?C++ AxisAlignedBox::setMinimum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::AxisAlignedBox
的用法示例。
在下文中一共展示了AxisAlignedBox::setMinimum方法的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;
}
示例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);
}
}
}
示例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;
}
示例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"))