本文整理汇总了C++中Triangle::Translate方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangle::Translate方法的具体用法?C++ Triangle::Translate怎么用?C++ Triangle::Translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangle
的用法示例。
在下文中一共展示了Triangle::Translate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Translate
void Mesh::Translate(Vector d)
{
Triangle *tri = tris;
for(int i = 0; i < numTris; i++, tri++)
{
tri->Translate(d);
}
centroidChanged = true;
}
示例2: SetRotation
void Mesh::SetRotation(Vector r)
{
Triangle *tri = tris, *ot = originalTris;
Vector c = ComputeCentroid();
Vector o;
for(int i = 0; i < numTris; i++, tri++, ot++)
{
*tri = *ot;
tri->RotateAboutPoint(rotation + r, o);
tri->Translate(c);
tri->RecalcNormal();
}
}
示例3: MoveTo
void Mesh::MoveTo(float x, float y, float z)
{
Triangle *tri = tris, *ot = originalTris;
Vector c;
for(int i = 0; i < numTris; i++, tri++, ot++)
{
*tri = *ot;
tri->RotateAboutPoint(rotation, c);
tri->Translate(x, y, z);
tri->RecalcNormal();
}
centroidChanged = true;
}
示例4: Explode
void Mesh::Explode(float dist, float variance)
{
Vector c = ComputeCentroid();
Vector d;
Triangle *tri = tris;
float rand;
variance *= 2;
for(int i = 0; i < numTris; i++, tri++)
{
tri->ComputeCentroid();
d = tri->centroid - c;
rand = (Random::randf() - 0.5f) * variance;
d = d.Normalize() * (dist + rand);
tri->Translate(d);
}
}