本文整理汇总了C++中ManualObject::setDebugDisplayEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ManualObject::setDebugDisplayEnabled方法的具体用法?C++ ManualObject::setDebugDisplayEnabled怎么用?C++ ManualObject::setDebugDisplayEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManualObject
的用法示例。
在下文中一共展示了ManualObject::setDebugDisplayEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createTestMap
void createTestMap(SceneManager* mSceneMgr)
{
std::vector<QGears::MapFileSerializer::SBlock> blocks;
createReferenceFileInstance([&](Ogre::DataStreamPtr& stream, QGears::WorldMapFile& file)
{
QGears::MapFileSerializer s;
s.importMapFile( stream, file );
blocks = s.mBlocks;
});
if (blocks.empty())
{
// Load failed
return;
}
/*
// TODO: Get PSX textures working
QGears::TxzFileSerializer s;
createReferenceTextureFileInstance(s);
std::vector<std::vector<TxzFileSerializer::rgba>> data = s.GetWorldMapTexture(19);
test(data);
*/
LoadTextures();
int c = 0;
const auto kSpace = From16BitFixedPoint(8182);
size_t numBlocks = blocks.size();
int mapX = 0;
int mapY = 0;
for ( unsigned int k=0; k<numBlocks; k++ )
{
// 7x9 size
QGears::MapFileSerializer::SBlock& block = blocks[k];
int blockX = 0;
int blockY = 0;
for ( size_t i=0; i<block.mMeshes.size(); i++ )
{
QGears::MapFileSerializer::SBlockPart& part = block.mMeshes[i];
for ( size_t j=0; j<part.mTris.size(); j++)
{
QGears::MapFileSerializer::BlockTriangle& tri = part.mTris.at(j);
ManualObject* manual = nullptr;
auto it = gObjToTextureId.find(tri.TextureInfo);
if (it==gObjToTextureId.end())
{
manual = mSceneMgr->createManualObject(("zzz_manual" + std::to_string(c++)).c_str());
manual->begin(gTextures[tri.TextureInfo].mName, RenderOperation::OT_TRIANGLE_LIST);
manual->setDebugDisplayEnabled(true);
manual->setDynamic(false);
gObjToTextureId[tri.TextureInfo] = manual;
}
else
{
manual = it->second;
}
const float xPos = (blockX * kSpace) + (mapX * kSpace * 4);
const float yPos = (blockY * kSpace) + (mapY * kSpace * 4);
// v1
QGears::MapFileSerializer::Vertex v1 = part.mVertices.at(tri.Vertex2Index);
manual->position(From16BitFixedPoint(v1.X)+xPos, From16BitFixedPoint(v1.Y), From16BitFixedPoint(v1.Z)+yPos);
manual->textureCoord(ToTextureCoordU(tri.uVertex2, tri.TextureInfo), ToTextureCoordV(tri.vVertex2, tri.TextureInfo));
// v2
v1 = part.mVertices.at(tri.Vertex1Index);
manual->position(From16BitFixedPoint(v1.X)+xPos, From16BitFixedPoint(v1.Y), From16BitFixedPoint(v1.Z)+yPos);
manual->textureCoord(ToTextureCoordU(tri.uVertex1, tri.TextureInfo), ToTextureCoordV(tri.vVertex1, tri.TextureInfo));
// v3
v1 = part.mVertices.at(tri.Vertex0Index);
manual->position(From16BitFixedPoint(v1.X)+xPos, From16BitFixedPoint(v1.Y), From16BitFixedPoint(v1.Z)+yPos);
manual->textureCoord(ToTextureCoordU(tri.uVertex0, tri.TextureInfo), ToTextureCoordV(tri.vVertex0, tri.TextureInfo));
}
blockX++;
if (blockX >= 4 )
{
blockX = 0;
blockY++;
}
}
mapX++;
if (mapX >= 9 )
{
mapX = 0;
//.........这里部分代码省略.........