本文整理汇总了C++中Matrix4::SetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4::SetTranslation方法的具体用法?C++ Matrix4::SetTranslation怎么用?C++ Matrix4::SetTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4
的用法示例。
在下文中一共展示了Matrix4::SetTranslation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToCartesian
void SphericalXZ::ToCartesian( Matrix4* out )
{
Matrix4 roty; // theta
Matrix4 rotz; // rho
Matrix4 trans;
roty.SetYRotation( theta );
rotz.SetZRotation( rho );
trans.SetTranslation( r, 0.f, 0.f );
*out = roty * rotz * trans;
}
示例2: ProcessAC
void ProcessAC( ACObject* ob, lilith3d::StaticResource* meshRes )
{
Matrix4 matrix;
matrix.SetTranslation( ob->loc.x, ob->loc.y, ob->loc.z );
meshRes->PushObject( ob->name, matrix, ob->texture );
for( int i = 0; i < ob->num_surf; ++i )
{
ACSurface *surf = &ob->surfaces[i];
meshRes->PushSurface( surf->num_vertref, surf->normal.x, surf->normal.y, surf->normal.z );
int st = surf->flags & 0xf;
if ( st == SURFACE_TYPE_POLYGON
&& (surf->num_vertref == 3 || surf->num_vertref == 4 ) )
{
for( int j=0; j<surf->num_vertref; ++j )
{
ACVertex *v = &ob->vertices[surf->vertref[j]];
float tx = 0, ty = 0;
if (ob->texture )
{
float tu = surf->uvs[j].u;
float tv = surf->uvs[j].v;
tx = ob->texture_offset_x + tu * ob->texture_repeat_x;
ty = ob->texture_offset_y + tv * ob->texture_repeat_y;
}
meshRes->PushVertex( v->x, v->y, v->z, tx, ty );
}
}
else
{
GLLOG(( "Input polygon or type not supported.\n" ));
GLASSERT( 0 );
}
}
for ( int n = 0; n < ob->num_kids; n++)
ProcessAC(ob->kids[n], meshRes );
meshRes->PopObject();
}
示例3: ImportAC3D
bool ImportAC3D( const std::string& filename,
ModelBuilder* builder,
const grinliz::Vector3F origin,
const std::string& group )
{
ACObject* acObject = ac_load_ac3d( (char*) filename.c_str() );
GLASSERT( acObject );
if ( acObject )
{
// Kind of a wicked recursive thing.
Matrix4 matrix;
matrix.SetTranslation( -origin );
ProcessAC3D( acObject, builder, matrix, group.empty() ? 0 : group.c_str() );
}
builder->Flush();
bool importOk = ( acObject != 0 );
if ( acObject )
ac_object_free( acObject );
return importOk;
}
示例4:
void Matrix4::SetOrientation(const Quaternion &pQuat){
Matrix4 tempMat = pQuat.ToMatrix();
tempMat.SetTranslation(this->GetTranslation());
*this = tempMat;
}
示例5:
//---------------------------------
//
//---------------------------------
void Matrix4::Translate(const Vector3& trans)
{
Matrix4 translation;
translation.SetTranslation( trans );
*this *= translation;
}