本文整理汇总了C++中ofRectangle::getMaxY方法的典型用法代码示例。如果您正苦于以下问题:C++ ofRectangle::getMaxY方法的具体用法?C++ ofRectangle::getMaxY怎么用?C++ ofRectangle::getMaxY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofRectangle
的用法示例。
在下文中一共展示了ofRectangle::getMaxY方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromRectangle
//----------------------------------------------------------
ofPolyline ofPolyline::fromRectangle(const ofRectangle& rect) {
ofPolyline polyline;
polyline.addVertex(rect.getMin());
polyline.addVertex(rect.getMaxX(),rect.getMinY());
polyline.addVertex(rect.getMax());
polyline.addVertex(rect.getMinX(),rect.getMaxY());
polyline.close();
return polyline;
}
示例2: growToInclude
//----------------------------------------------------------
void ofRectangle::growToInclude(const ofRectangle& rect){
float x0 = MIN(getMinX(),rect.getMinX());
float x1 = MAX(getMaxX(),rect.getMaxX());
float y0 = MIN(getMinY(),rect.getMinY());
float y1 = MAX(getMaxY(),rect.getMaxY());
float w = x1 - x0;
float h = y1 - y0;
set(x0,y0,w,h);
}
示例3: setKinectROI
void KinectGrabber::setKinectROI(ofRectangle ROI){
minX = static_cast<int>(ROI.getMinX());
maxX = static_cast<int>(ROI.getMaxX());
minY = static_cast<int>(ROI.getMinY());
maxY = static_cast<int>(ROI.getMaxY());
ROIwidth = maxX-minX;
ROIheight = maxY-minY;
resetBuffers();
}
示例4: ofRectangleCrop
ofRectangle ofRectangleCrop(const ofRectangle & rect, const ofRectangle & rectCrop) {
ofRectangle r;
if(rect.intersects(rectCrop) == false) {
return r;
}
r = rect;
if(r.getMinX() < rectCrop.getMinX()) {
r.x = rectCrop.getMinX();
}
if(r.getMaxX() > rectCrop.getMaxX()) {
r.width = rectCrop.getMaxX() - r.x;
}
if(r.getMinY() < rectCrop.getMinY()) {
r.y = rectCrop.getMinY();
}
if(r.getMaxY() > rectCrop.getMaxY()) {
r.height = rectCrop.getMaxY() - r.y;
}
return r;
}
示例5: applyVectorField
void ofxParticleSystem::applyVectorField(float * field, int fieldWidth, int fieldHeight, int numComponents, ofRectangle areaOfInfluence, float force) {
for(list<ofxParticle*>::iterator it = particles.begin(); it != particles.end(); it++){
ofxParticle & p = (**it);
ofVec2f pos(p.position.x,p.position.y);
if(areaOfInfluence.inside(pos)){
int x = (int)ofMap(pos.x, areaOfInfluence.getMinX(), areaOfInfluence.getMaxX(), 0, fieldWidth-1);
int y = (int)ofMap(pos.y, areaOfInfluence.getMinY(), areaOfInfluence.getMaxY(), 0, fieldHeight-1);
int index = (x+y*fieldWidth)*numComponents;
ofVec2f dir(field[index],field[index+1]);
dir.scale(force);
// cout << "(" << dir.x << "," << dir.y << ")\n";
p.applyForce(dir);
}
}
}
示例6: getIntersection
//----------------------------------------------------------
ofRectangle ofRectangle::getIntersection(const ofRectangle& rect) const {
float x0 = MAX(getMinX(),rect.getMinX());
float x1 = MIN(getMaxX(),rect.getMaxX());
float w = x1 - x0;
if(w < 0.0f) return ofRectangle(0,0,0,0); // short circuit if needed
float y0 = MAX(getMinY(),rect.getMinY());
float y1 = MIN(getMaxY(),rect.getMaxY());
float h = y1 - y0;
if(h < 0.0f) return ofRectangle(0,0,0,0); // short circuit if needed
return ofRectangle(x0,y0,w,h);
}
示例7: intersects
//----------------------------------------------------------
bool ofRectangle::intersects(const ofRectangle& rect) const {
return (getMinX() < rect.getMaxX() && getMaxX() > rect.getMinX() &&
getMinY() < rect.getMaxY() && getMaxY() > rect.getMinY());
}
示例8: inside
//----------------------------------------------------------
bool ofRectangle::inside(const ofRectangle& rect) const {
return inside(rect.getMinX(),rect.getMinY()) &&
inside(rect.getMaxX(),rect.getMaxY());
}
示例9: joelInside
bool testApp::joelInside(ofRectangle r, ofPoint p){
return p.x >= r.getMinX() && p.y >= r.getMinY() && p.x <= r.getMaxX() && p.y <= r.getMaxY();
}
示例10: mapClamp
ofRectangle ofRectangle::mapClamp(const ofRectangle & coeff) const {
return ofRectangle(
mapClamp(glm::vec2(coeff.getMinX(), coeff.getMinY())),
mapClamp(glm::vec2(coeff.getMaxX(), coeff.getMaxY()))
);
}