本文整理汇总了C++中Atomic::setGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ Atomic::setGeometry方法的具体用法?C++ Atomic::setGeometry怎么用?C++ Atomic::setGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Atomic
的用法示例。
在下文中一共展示了Atomic::setGeometry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void XAsset::createD3HierarchyClasses(Clump* clump, D3DXFRAME* frame)
{
Frame* f = static_cast<Frame*>( frame );
while( f->pMeshContainer )
{
Mesh* mesh = static_cast<Mesh*>( f->pMeshContainer );
const char* geometryName = mesh->Name;
if( !geometryName ) geometryName = "NamelessGeometry";
Geometry* geometry = new Geometry( mesh, geometryName );
Atomic* atomic = new Atomic;
atomic->setGeometry( geometry );
atomic->setFrame( f );
clump->add( atomic );
f->pMeshContainer = f->pMeshContainer->pNextMeshContainer;
}
if( f->pFrameFirstChild )
{
static_cast<Frame*>( f->pFrameFirstChild )->pParentFrame = f;
createD3HierarchyClasses( clump, f->pFrameFirstChild );
}
if( f->pFrameSibling )
{
static_cast<Frame*>( f->pFrameSibling )->pParentFrame = f->pParentFrame;
createD3HierarchyClasses( clump, f->pFrameSibling );
}
}
示例2: if
//.........这里部分代码省略.........
importData->triangles[i].vertexId[0],
importData->triangles[i].vertexId[2],
importData->triangles[i].vertexId[1],
importData->triangles[i].materialId
);
*/
geometry->getTriangles()[i].set(
importData->triangles[i].vertexId[0],
importData->triangles[i].vertexId[1],
importData->triangles[i].vertexId[2],
importData->triangles[i].materialId
);
}
for( i=0; i<importData->numMaterials; i++ )
{
ShaderI shaderI = _shaders.find( importData->materials[i] );
assert( shaderI != _shaders.end() );
geometry->setShader( i, shaderI->second );
}
geometry->instance();
_geometries.insert( GeometryT( importData->id, geometry ) );
iImport->release( importData );
}
break;
case import::itAtomic:
{
import::ImportAtomic* importData = iImportStream->importAtomic();
Atomic* atomic = new Atomic;
FrameI frameI = _frames.find( importData->frameId );
assert( frameI != _frames.end() );
atomic->setFrame( frameI->second );
GeometryI geometryI = _geometries.find( importData->geometryId );
assert( geometryI != _geometries.end() );
atomic->setGeometry( geometryI->second );
TextureI textureI = _textures.find( importData->lightmapId );
if( textureI != _textures.end() )
{
atomic->setLightMap( textureI->second );
}
_atomics.insert( AtomicT( importData->id, atomic ) );
iImport->release( importData );
}
break;
case import::itClump:
{
import::ImportClump* importData = iImportStream->importClump();
Clump* clump = new Clump( importData->name );
FrameI frameI = _frames.find( importData->frameId );
assert( frameI != _frames.end() );
clump->setFrame( frameI->second );
frameI->second->dirty();
for( int i=0; i<importData->numAtomics; i++ )
{
AtomicI atomicI = _atomics.find( importData->atomics[i] );
assert( atomicI != _atomics.end() );
clump->add( atomicI->second );
}
for( i=0; i<importData->numLights; i++ )
{
LightI lightI = _lights.find( importData->lights[i] );
assert( lightI != _lights.end() );
clump->add( lightI->second );
}
iImport->release( importData );
/*
rh2lh( clump->frame() );