本文整理汇总了C++中Polygon::AddPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Polygon::AddPoint方法的具体用法?C++ Polygon::AddPoint怎么用?C++ Polygon::AddPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon
的用法示例。
在下文中一共展示了Polygon::AddPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleNotificationUpdateCallback
/*
* Position the notification relative to the block it is
* talking about.
*/
void GameController::HandleNotificationUpdateCallback(void *handler, void *notification)
{
hdVec2 screenPos;
hdVec2 aa,bb;
/* Volatile - both the notification and handler may go away at any time */
if (handler == NULL || notification == NULL) return;
GameController *self = (GameController *)handler;
Polygon* note = (Polygon *)notification;
Block* block = (Block *)note->GetRelative();
if (NULL == note->GetWorld()) return;
if (block != NULL)
{
self->ConvertInterfaceToScreen(screenPos, block->GetWorldCenter().x, block->GetWorldCenter().y);
aa.Set(screenPos.x - 35.0f, screenPos.y + 30.0f);
bb.Set(aa.x + 70, aa.y + 35);
note->RemoveAllPoints();
note->AddPoint(aa.x, aa.y);
note->AddPoint(aa.x, bb.y);
note->AddPoint(bb.x, bb.y);
note->AddPoint(bb.x, aa.y);
}
}
示例2: hull
shared_ptr<Hull>
CreateHull()
{
shared_ptr<Hull> hull(new Hull());
static const double octoSmall = 0.178;
static const double octoBig = 0.430;
Polygon outline; // temporary
outline.AddPoint( octoBig , octoSmall);
outline.AddPoint( octoSmall, octoBig);
outline.AddPoint(-octoSmall, octoBig);
outline.AddPoint(-octoBig , octoSmall);
outline.AddPoint(-octoBig ,-octoSmall);
outline.AddPoint(-octoSmall,-octoBig);
outline.AddPoint( octoSmall,-octoBig);
outline.AddPoint( octoBig ,-octoSmall);
hull->AddPolygon(outline);
return hull;
}