本文整理汇总了C++中Matrix3::PreTranslate方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3::PreTranslate方法的具体用法?C++ Matrix3::PreTranslate怎么用?C++ Matrix3::PreTranslate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3
的用法示例。
在下文中一共展示了Matrix3::PreTranslate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetValue
void SlavePosControl::GetValue(
TimeValue t, void *val, Interval &valid, GetSetMethod method)
{
if ( (sub == NULL) || (!masterPresent) || (blockID.Count()==0))
{
if (method == CTRL_ABSOLUTE)
{
Point3 *v = ((Point3*)val);
*v = Point3(0.0f,0.0f,0.0f);
}
else
{
Point3 f(0.0f,0.0f,0.0f);
Matrix3 *v = ((Matrix3*)val);
v->PreTranslate(f);
}
return;
}
//copy keys into scratch control
if (scratchControl == NULL)
{
UpdateSlave();
}
if (master)
master->GetValue3(scratchControl,t,val,valid,blockID,subID,range,method);
}
示例2: GetSubObjectCenters
void FExtrudeMod::GetSubObjectCenters (SubObjAxisCallback *cb,
TimeValue t, INode *node,ModContext *mc) {
Matrix3 tm = CompMatrix(t,node,mc);
Point3 p;
mp_base->GetValue(t,&p,FOREVER,CTRL_ABSOLUTE);
tm.PreTranslate(p);
cb->Center(tm.GetTrans(),0);
}
示例3: GetSubObjectCenters
void AFRMod::GetSubObjectCenters(
SubObjAxisCallback *cb,TimeValue t,
INode *node,ModContext *mc)
{
Matrix3 tm = CompMatrix(t,node,mc);
Point3 pt(0,0,0), p;
int c=0;
if (sel[0]) {
p1->GetValue(t,&p,FOREVER,CTRL_ABSOLUTE);
pt += p;
c++;
}
if (sel[1]) {
p2->GetValue(t,&p,FOREVER,CTRL_ABSOLUTE);
pt += p;
c++;
}
if (c) pt /= float(c);
tm.PreTranslate(pt);
cb->Center(tm.GetTrans(),0);
}
示例4: GetCOREInterface
void plStaticEnvLayer::RenderCubicMap( INode *node )
{
int res, size;
BOOL success = 0;
TSTR fname, fullname;
Bitmap *bm = NULL;
TSTR path, filename, ext, thisFilename;
BitmapInfo biOutFile;
static TCHAR suffixes[ 6 ][ 4 ] = { "_FR", "_BK", "_LF", "_RT", "_UP", "_DN" };
Interface *ip = GetCOREInterface();
size = fBitmapPB->GetInt( kBmpTextureSize, ip->GetTime() );
if( size <= 0 )
{
return;
}
thisFilename = fBitmapPB->GetStr( kBmpBaseFilename, ip->GetTime() );
if( thisFilename.isNull() )
{
return;
}
SplitFilename( thisFilename, &path, &filename, &ext );
BOOL wasHid = node->IsNodeHidden();
node->Hide( TRUE );
// Create a blank bitmap
biOutFile.SetWidth( size );
biOutFile.SetHeight( size );
biOutFile.SetType( BMM_TRUE_64 );
biOutFile.SetAspect( 1.0f );
biOutFile.SetCurrentFrame( 0 );
bm = TheManager->Create( &biOutFile );
Matrix3 nodeTM = node->GetNodeTM( ip->GetTime() );
Matrix3 tm;
INode *root = ip->GetRootNode();
bm->Display( GetString( IDS_CUBIC_RENDER_TITLE ) );
/// Set up rendering contexts
ViewParams vp;
vp.projType = PROJ_PERSPECTIVE;
vp.hither = .001f;
vp.yon = 1.0e30f;
vp.fov = M_PI/2.0f;
if( fBitmapPB->GetInt( kBmpUseMAXAtmosphere ) )
{
vp.nearRange = 0;
vp.farRange = fBitmapPB->GetFloat( kBmpFarDistance );
}
else
{
vp.nearRange = vp.farRange = 1.0e30f;
}
BOOL saveUseEnvMap = ip->GetUseEnvironmentMap();
ip->SetUseEnvironmentMap( false );
res = ip->OpenCurRenderer( &vp );
for( int i = 0; i < 6; i++ )
{
tm = IGetViewTM( i );
tm.PreTranslate( -nodeTM.GetTrans() );
vp.affineTM = tm;
// Construct filename
thisFilename.printf( _T( "%s\\%s%s%s" ), path, filename, suffixes[ i ], ext );
res = ip->CurRendererRenderFrame( ip->GetTime(), bm, NULL, 1.0f, &vp );
if( !res )
goto fail;
if( !IWriteBM( &biOutFile, bm, thisFilename ) )
goto fail;
}
success = 1;
fail:
ip->CloseCurRenderer();
ip->SetUseEnvironmentMap( saveUseEnvMap );
bm->DeleteThis();
node->Hide( wasHid );
if( success )
{
for(int i = 0; i < 6; i++ )
{
BitmapInfo bi;
thisFilename.printf( _T( "%s\\%s%s%s" ), path, filename, suffixes[ i ], ext );
bi.SetName( thisFilename );
PBBitmap pbBitmap( bi );
fBitmapPB->SetValue( kBmpFrontBitmap + i, ip->GetTime(), &pbBitmap );
}
fBitmapPB->GetMap()->UpdateUI( ip->GetTime() );
}
}