本文整理汇总了C++中HardwareVertexBufferSharedPtr::getPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ HardwareVertexBufferSharedPtr::getPointer方法的具体用法?C++ HardwareVertexBufferSharedPtr::getPointer怎么用?C++ HardwareVertexBufferSharedPtr::getPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HardwareVertexBufferSharedPtr
的用法示例。
在下文中一共展示了HardwareVertexBufferSharedPtr::getPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bake
//.........这里部分代码省略.........
MeshCombiner::getSingleton().log(
"Baking: adding animations for " + (*it)->getName() );
// insert all animations
for (unsigned short a=0; a < (*it)->getNumAnimations(); ++a )
{
Animation* anim = (*it)->getAnimation( a );
Animation* newanim = sp->createAnimation( anim->getName(), anim->getLength() );
if( anim->getNumNodeTracks() > 0 )
MeshCombiner::getSingleton().log(
"Baking: adding node tracks" );
for( unsigned short na=0; na < anim->getNumNodeTracks(); ++na )
{
if( anim->hasNodeTrack( na ) )
{
NodeAnimationTrack* nat = anim->getNodeTrack( na );
NodeAnimationTrack* newnat = newanim->createNodeTrack( na );
// all key frames
for( unsigned short nf=0; nf < nat->getNumKeyFrames(); ++nf )
{
TransformKeyFrame* tkf = nat->getNodeKeyFrame( nf );
TransformKeyFrame* newtkf = newnat->createNodeKeyFrame( tkf->getTime() );
newtkf->setRotation( tkf->getRotation() );
newtkf->setTranslate( tkf->getTranslate() );
newtkf->setScale( tkf->getScale() );
}
newnat->setAssociatedNode( sp->getBone( nat->getHandle() ) );
}
}
if( anim->getNumNumericTracks() > 0 )
MeshCombiner::getSingleton().log(
"Baking: adding numeric tracks" );
for( unsigned short na=0; na < anim->getNumNumericTracks(); ++na )
{
if( anim->hasNumericTrack( na ) )
{
NumericAnimationTrack* nat = anim->getNumericTrack( na );
NumericAnimationTrack* newnat = newanim->createNumericTrack( na );
// all key frames
for( unsigned short nf=0; nf < nat->getNumKeyFrames(); ++nf )
{
NumericKeyFrame* nkf = nat->getNumericKeyFrame( nf );
NumericKeyFrame* newnkf = newnat->createNumericKeyFrame( nkf->getTime() );
newnkf->setValue( nkf->getValue() );
}
}
}
if( anim->getNumVertexTracks() > 0 )
MeshCombiner::getSingleton().log(
"Baking: adding vertex tracks" );
for( unsigned short va=0; va < anim->getNumVertexTracks(); ++va )
{
if( anim->hasVertexTrack( va ) )
{
VertexAnimationTrack* vat = anim->getVertexTrack( va );
VertexAnimationTrack* newvat = newanim->createVertexTrack( va, vat->getAnimationType() );
// all key frames
for( unsigned short nf=0; nf < vat->getNumKeyFrames(); ++nf )
{
// all morphs
VertexMorphKeyFrame* vmkf = vat->getVertexMorphKeyFrame( nf );
if( vmkf != NULL )
{
VertexMorphKeyFrame* newvmkf = newvat->createVertexMorphKeyFrame( vmkf->getTime() );
// @todo vertex buffer copying correct??
HardwareVertexBufferSharedPtr buf = vmkf->getVertexBuffer();
HardwareVertexBufferSharedPtr newbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
buf->getVertexSize(), buf->getNumVertices(), buf->getUsage(), buf->hasShadowBuffer() );
newbuf->copyData( *buf.getPointer(), 0, 0, buf->getSizeInBytes() );
}
// all poses
VertexPoseKeyFrame* vpkf = vat->getVertexPoseKeyFrame( nf );
if( vpkf != NULL )
{
VertexPoseKeyFrame* newvpkf = newvat->createVertexPoseKeyFrame( vpkf->getTime() );
VertexPoseKeyFrame::PoseRefIterator pit = vpkf->getPoseReferenceIterator();
while( pit.hasMoreElements() )
{
VertexPoseKeyFrame::PoseRef pr = pit.getNext();
newvpkf->addPoseReference( pr.poseIndex, pr.influence );
}
}
}
}
}
}
}
return sp;
}