本文整理汇总了C++中ogre::Image::flipAroundY方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::flipAroundY方法的具体用法?C++ Image::flipAroundY怎么用?C++ Image::flipAroundY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Image
的用法示例。
在下文中一共展示了Image::flipAroundY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTerrainImage
void getTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
if(flipX)
img.flipAroundY();
if(flipY)
img.flipAroundX();
}
示例2: getTerrainImage
void getTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
img.load("terrain1.bmp", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
if (flipX)
img.flipAroundY();
if (flipY)
img.flipAroundX();
}
示例3: GetTerrainImage
void TerrainManager::GetTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
img.load(mHeightMapFileName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
if (flipX)
img.flipAroundY();
if (flipY)
img.flipAroundX();
}
示例4: getTerrainImage
/// FIXME
void getTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
img.load("height_map.png", Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
if (flipX)
img.flipAroundY();
if (flipY)
img.flipAroundX();
}
示例5: getTerrainImage
void OgreWidget::getTerrainImage(bool flipX, bool flipY, Ogre::Image& img)
{
img.load("terrain.png", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
qDebug() << "OgreWidget::getTerrainImage(): loaded terrain heightmap, width is" << img.getWidth();
if(flipX)
img.flipAroundY();
if(flipY)
img.flipAroundX();
}
示例6: terrainInit
void TerrainManager::terrainInit(Ogre::String file, OgreManager* o)
{
_OgreManager = o;
initialiseResources();
createLight();
setGlobalOptions();
_TerrainGroup = OGRE_NEW Ogre::TerrainGroup(_OgreManager->getSceneManager(), Ogre::Terrain::ALIGN_X_Z, 513, 12000.0f);
_TerrainGroup->setFilenameConvention(Ogre::String("GameTerrain"), Ogre::String("dat"));
_TerrainGroup->setOrigin(Ogre::Vector3::ZERO);
setDefaultImportSettings();
bool lTerrainsImported = false;
for (long x = 0; x <= 0; ++x)
{
for (long y = 0; y <= 0; ++y)
{
//Define terrain function
Ogre::String filename = _TerrainGroup->generateFilename(x, y);
if (Ogre::ResourceGroupManager::getSingleton().resourceExists(_TerrainGroup->getResourceGroup(), filename))
{
_TerrainGroup->defineTerrain(x, y);
}
else
{
Ogre::Image img;
//Get terrain image
Ogre::String tempFile = Ogre::StringConverter::toString(x * 10 + y);
tempFile.append(".bmp");
img.load("terrain.bmp", Ogre::String("TerrainResources"));
if (x % 2 != 0)
img.flipAroundY();
if (y % 2 != 0)
img.flipAroundX();
//Get terrain image end
_TerrainGroup->defineTerrain(x, y, &img);
lTerrainsImported = true;
}
//Define terrain function end
}
}
_TerrainGroup->loadAllTerrains(true);
if (lTerrainsImported)
{
Ogre::TerrainGroup::TerrainIterator ti = _TerrainGroup->getTerrainIterator();
while(ti.hasMoreElements())
{
Ogre::Terrain* t = ti.getNext()->instance;
//Init blend maps function start
Ogre::TerrainLayerBlendMap* blendMap0 = t->getLayerBlendMap(1);
Ogre::TerrainLayerBlendMap* blendMap1 = t->getLayerBlendMap(2);
Ogre::Real minHeight0 = -10;
Ogre::Real fadeDist0 = 0;//40;
Ogre::Real minHeight1 = -10;
Ogre::Real fadeDist1 = 0;//15;
float* pBlend0 = blendMap0->getBlendPointer();
float* pBlend1 = blendMap1->getBlendPointer();
for (Ogre::uint16 y = 0; y < t->getLayerBlendMapSize(); ++y)
{
for (Ogre::uint16 x = 0; x < t->getLayerBlendMapSize(); ++x)
{
Ogre::Real tx, ty;
blendMap0->convertImageToTerrainSpace(x, y, &tx, &ty);
Ogre::Real height = t->getHeightAtTerrainPosition(tx, ty);
Ogre::Real val = (height - minHeight0) / fadeDist0;
val = Ogre::Math::Clamp(val, (Ogre::Real)0, (Ogre::Real)1);
*pBlend0++ = val;
val = (height - minHeight1) / fadeDist1;
val = Ogre::Math::Clamp(val, (Ogre::Real)0, (Ogre::Real)1);
*pBlend1++ = val;
}
}
blendMap0->dirty();
blendMap1->dirty();
blendMap0->update();
blendMap1->update();
//Init blend maps end
}
}
_TerrainGroup->freeTemporaryResources();
_OgreManager->getSceneManager()->setSkyBox(true, "Examples/EarlyMorningSkyBox", 5000, true, Ogre::Quaternion::IDENTITY, "GameResources");
}