本文整理汇总了C++中Matrix::ClearData方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::ClearData方法的具体用法?C++ Matrix::ClearData怎么用?C++ Matrix::ClearData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix::ClearData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderWaterSprite
// draw a water-hugging sprite; rotate the texture first
//
Bucket * RenderWaterSprite( const Vector & origin, F32 radius, const Vector &front, const Bitmap *texture, Color color, U32 blend, UVPair uv0, UVPair uv1, UVPair uv2, U16 sorting) // UVPair(0.0f,1.0f), UVPair(1.0f,1.0f), UVPair(1.0f,0.0f)
{
Vector f = front;
f.y =0.0f;
f.Normalize();
Matrix m;
m.ClearData();
m.SetFromFront( f);
F32 du = (F32) fabs(uv2.u + uv0.u) * 0.5f;
F32 dv = (F32) fabs(uv2.v + uv0.v) * 0.5f;
uv0.u -= du;
uv0.v -= dv;
uv1.u -= du;
uv1.v -= dv;
uv2.u -= du;
uv2.v -= dv;
m.Rotate( uv0);
m.Rotate( uv1);
m.Rotate( uv2);
uv0.u += du;
uv0.v += dv;
uv1.u += du;
uv1.v += dv;
uv2.u += du;
uv2.v += dv;
return RenderWaterSprite( origin, radius, texture, color, blend, uv0, uv1, uv2, sorting);
}
示例2: Handler
//.........这里部分代码省略.........
Vid::Light::SetupShadow();
break;
// utility
//
case 0x0C39A9C1: // "mesh.envmap"
if (Console::GetArgString( 1, s1))
{
Bitmap * map = Bitmap::Manager::Find( s1);
if (map)
{
Mesh::Manager::envMap = map;
}
}
else
{
CON_DIAG(("envmap = %s", Mesh::Manager::envMap ? Mesh::Manager::envMap->GetName() : "null"));
}
break;
case 0x46BDAA81: // "mesh.color.alpha"
case 0x05D592EA: // "mesh.color.base"
if (Mesh::Manager::curEnt)
{
Color color = Var::baseColor;
color.a = (U8)Var::alphaColor;
Mesh::Manager::curParent->SetBaseColor( color);
Mesh::Manager::curParent->SetFogTarget( 255, color.a, TRUE);
}
break;
case 0x7AF1FC7D: // "mesh.diffuse"
{
F32 f1;
if (Console::GetArgFloat(1, f1))
{
if (f1 < 0.1f)
{
f1 = 0.1f;
}
else if (f1 > 1.0f)
{
f1 = 1.0f;
}
Material::Manager::SetDiffuse( f1);
}
else
{
CON_DIAG(("diffuse = %.2f", Material::Manager::diffuseVal))
}
break;
}
case 0xD3BE61C1: // "mesh.report"
Console::GetArgString(1, s1);
Mesh::Manager::ReportList( s1);
break;
case 0xAA7BD58D: // "mesh.dump.heirarchy"
if (Mesh::Manager::curEnt)
{
Mesh::Manager::curEnt->LogHierarchy();
}
break;
case 0xEC368032: // "mesh.dump.offsetall"
if (Mesh::Manager::curEnt)
{
Mesh::Manager::curEnt->DumpHierarchy();
}
break;
case 0x9AC2B5EA: // "mesh.dump.offset"
if (Mesh::Manager::curEnt && Console::GetArgString( 1, s1))
{
FamilyNode * n1 = Mesh::Manager::curEnt->FindLocal( s1);
if (n1 && n1 != Mesh::Manager::curEnt)
{
FamilyNode * n2 = Mesh::Manager::curEnt;
char * s2;
if (Console::GetArgString( 2, s2))
{
FamilyNode * n = Mesh::Manager::curEnt->FindLocal( s2);
if (n)
{
n2 = n;
}
}
Matrix matrix;
matrix.ClearData();
n2->FindOffsetLocal( n1, matrix);
CON_DIAG((""));
CON_DIAG(("right %f,%f,%f", matrix.right.x, matrix.right.y, matrix.right.z));
CON_DIAG(("up %f,%f,%f", matrix.up.x, matrix.up.y, matrix.up.z));
CON_DIAG(("front %f,%f,%f", matrix.front.x, matrix.front.y, matrix.front.z));
CON_DIAG(("posit %f,%f,%f", matrix.posit.x, matrix.posit.y, matrix.posit.z));
break;
}
}
CON_DIAG(("app.offset [dstnode] [opt:srcnode]"));
break;
}
}