本文整理汇总了C++中ofPtr::getOuterEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPtr::getOuterEdge方法的具体用法?C++ ofPtr::getOuterEdge怎么用?C++ ofPtr::getOuterEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPtr
的用法示例。
在下文中一共展示了ofPtr::getOuterEdge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkInZone
bool zoneManager::checkInZone(ofPtr<clamourNode> n, ofPtr<zone> z) {
// cout << "check in zone \n";
// return clamourUtils::pointInPath(z->getOuterEdge(), n->getMeanPos_abs());
ofPoint intersect;
bool isIntersect = clamourUtils::pathInPath( n->getOuterEdge(), z->getOuterEdge(), intersect);
if(isIntersect)n->setIntersect(intersect);
return isIntersect;
}
示例2: repellNode
void zoneManager::repellNode(ofPtr<clamourNode> n, ofPtr<zone> z) {
// cout << "repell \n";
//finding centroid is not solved here so this method only works if zones drawn from the center
ofVec2f v = n->getMeanPos_abs() - n->getIntersect();
ofPoint p = clamourUtils::getInsideIntersect(z->getOuterEdge(), z->getPos_abs(), n->getIntersect());
p = p + v;
n->setRawPos_abs(p);
n->modifyHistory();
}
示例3: containNode
void zoneManager::containNode(ofPtr<clamourNode> n, ofPtr<zone> z) {
ofPoint intersect;
bool isOutside = clamourUtils::pathOutPath( n->getOuterEdge(), z->getOuterEdge(), intersect);
if(isOutside) {
ofVec2f v = n->getMeanPos_abs() - intersect;
ofVec2f vi(intersect - z->getPos_abs());
ofPoint p = clamourUtils::getInsideIntersect(z->getOuterEdge(), z->getPos_abs(), intersect);
ofVec2f d = (p - z->getPos_abs());
p -= d * 0.05; //move it slightly inside
p = p + v;
if(d.length() * 0.95 < vi.length()) { //only if necessary
n->setRawPos_abs(p);
n->modifyHistory();
}
}
}