本文整理汇总了C++中PhysicsBody::AddVertex方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsBody::AddVertex方法的具体用法?C++ PhysicsBody::AddVertex怎么用?C++ PhysicsBody::AddVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsBody
的用法示例。
在下文中一共展示了PhysicsBody::AddVertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PhysicsBody
void CW::CeilingTerrain::AddBlock(void)
{
PhysicsBody* b = new PhysicsBody();
int dif = rand() % 10;
if (rand() % 10 < 4) dif *= -1;
if (blocks[blocks.size() -1]->Vertices[2]->Position.y > 200) dif = -4;
if (blocks[blocks.size() -1]->Vertices[2]->Position.y < 50) dif = 4;
VerletPoint* V1 = new VerletPoint(blocks[blocks.size() -1]->Vertices[1]->Position.x,
0);
VerletPoint* V2 = new VerletPoint(blocks[blocks.size() -1]->Vertices[1]->Position.x + 60,
0);
VerletPoint* V3 = new VerletPoint(blocks[blocks.size() -1]->Vertices[1]->Position.x + 60,
blocks[blocks.size() -1]->Vertices[2]->Position.y + dif);
VerletPoint* V4 = new VerletPoint(blocks[blocks.size() -1]->Vertices[1]->Position.x,
blocks[blocks.size() -1]->Vertices[2]->Position.y);
b->AddVertex(V1);
b->AddVertex(V2);
b->AddVertex(V3);
b->AddVertex(V4);
blocks.push_back(b);
}