本文整理汇总了C++中GFXDrawUtil::drawTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ GFXDrawUtil::drawTransform方法的具体用法?C++ GFXDrawUtil::drawTransform怎么用?C++ GFXDrawUtil::drawTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFXDrawUtil
的用法示例。
在下文中一共展示了GFXDrawUtil::drawTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderDebugNodes
void TSShapeInstance::renderDebugNodes()
{
GFXDrawUtil *drawUtil = GFX->getDrawUtil();
ColorI color( 255, 0, 0, 255 );
GFXStateBlockDesc desc;
desc.setBlend( false );
desc.setZReadWrite( false, false );
for ( U32 i = 0; i < mNodeTransforms.size(); i++ )
drawUtil->drawTransform( desc, mNodeTransforms[i], NULL, NULL );
}
示例2: _renderDebug
//.........这里部分代码省略.........
// Render faces centers/colors.
if ( false )
{
GFXStateBlockDesc desc;
desc.setCullMode( GFXCullNone );
Point3F size( 0.1f );
for ( S32 i = 0; i < faceList.size(); i++ )
{
ColorI color = faceColorsx[ i % 4 ];
S32 div = ( i / 4 ) * 4;
if ( div > 0 )
color /= div;
color.alpha = 255;
Point3F pnt;
objToWorld.mulP( faceList[i].centroid, &pnt );
drawer->drawCube( desc, size, pnt, color, NULL );
}
}
// Render winding order.
if ( false )
{
GFXStateBlockDesc desc;
desc.setCullMode( GFXCullNone );
desc.setZReadWrite( true, false );
GFX->setStateBlockByDesc( desc );
U32 pointCount = 0;
for ( S32 i = 0; i < faceList.size(); i++ )
pointCount += faceList[i].winding.size();
PrimBuild::begin( GFXLineList, pointCount * 2 );
for ( S32 i = 0; i < faceList.size(); i++ )
{
for ( S32 j = 0; j < faceList[i].winding.size(); j++ )
{
Point3F p0 = pointList[ faceList[i].points[ faceList[i].winding[j] ] ];
Point3F p1 = p0 + mSurfaces[ faceList[i].id ].getUpVector() * 0.75f * ( Point3F::One / mObjScale );
objToWorld.mulP( p0 );
objToWorld.mulP( p1 );
ColorI color = faceColorsx[ j % 4 ];
S32 div = ( j / 4 ) * 4;
if ( div > 0 )
color /= div;
color.alpha = 255;
PrimBuild::color( color );
PrimBuild::vertex3fv( p0 );
PrimBuild::color( color );
PrimBuild::vertex3fv( p1 );
}
}
PrimBuild::end();
}
// Render Points.
if ( false )
{
/*
GFXTransformSaver saver;
MatrixF xfm( getRenderTransform() );
xfm.scale( getScale() );
GFX->multWorld( xfm );
GFXStateBlockDesc desc;
Point3F size( 0.05f );
*/
}
// Render surface transforms.
if ( false )
{
GFXStateBlockDesc desc;
desc.setBlend( false );
desc.setZReadWrite( true, true );
Point3F scale(mNormalLength);
for ( S32 i = 0; i < mSurfaces.size(); i++ )
{
MatrixF objToWorld( mObjToWorld );
objToWorld.scale( mObjScale );
MatrixF renderMat;
renderMat.mul( objToWorld, mSurfaces[i] );
renderMat.setPosition( renderMat.getPosition() + renderMat.getUpVector() * 0.001f );
drawer->drawTransform( desc, renderMat, &scale, NULL );
}
}
}