本文整理汇总了C++中ofPtr::getVector方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPtr::getVector方法的具体用法?C++ ofPtr::getVector怎么用?C++ ofPtr::getVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPtr
的用法示例。
在下文中一共展示了ofPtr::getVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPolygon
void Server::drawPolygon( ofPtr<Polygon> polygon )
{
Vertex currentVertex;
Vertex prevVertex; //= currentPolygon->getScalatedVertex(0);
float distance;
prevVertex = polygon->getScalatedVertex(0);
// Place brick in the first position of the poligon
moveForNextPoint(prevVertex, polygon->getVector(0) );
unsigned int i = 1;
// Iterate for all other vertices, but last one
for(; i < polygon->getSize() - 1; i++){
//Advance until next vertex
currentVertex = polygon->getScalatedVertex(i);
distance = prevVertex.distance(currentVertex);
sendMessage(distance*MOVE_FACTOR, distance*MOVE_FACTOR, PEN_DOWN);
brickPosition[X] += brickAngle[X]*distance;
brickPosition[Y] += brickAngle[Y]*distance;
//Move the brick so it can draw next line
moveForNextPoint(currentVertex, polygon->getVector(i));
prevVertex = currentVertex;
}
//Advance to draw the last line
currentVertex = polygon->getScalatedVertex(i);
distance = prevVertex.distance(currentVertex);
sendMessage(distance*MOVE_FACTOR, distance*MOVE_FACTOR, PEN_DOWN);
brickPosition[X] += brickAngle[X]*distance;
brickPosition[Y] += brickAngle[Y]*distance;
if( lock() ){
polygons.erase(polygons.begin());
unlock();
}else{
cout << "Server: lock is supposed to be bloking, noooo\n";
}
}