本文整理汇总了C++中ofRectangle::getBottomRight方法的典型用法代码示例。如果您正苦于以下问题:C++ ofRectangle::getBottomRight方法的具体用法?C++ ofRectangle::getBottomRight怎么用?C++ ofRectangle::getBottomRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofRectangle
的用法示例。
在下文中一共展示了ofRectangle::getBottomRight方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawBrakets
void Dimentions::drawBrakets(ofRectangle _rect, float size, float margin){
ofPushStyle();
ofSetLineWidth(2);
ofPushMatrix();
ofTranslate(_rect.getTopLeft() + ofPoint(-margin,-margin));
ofLine(0, 0, size, 0);
ofLine(0, 0, 0, size);
ofPopMatrix();
ofPushMatrix();
ofTranslate(_rect.getTopRight() + ofPoint(margin,-margin));
ofLine(0, 0, -size, 0);
ofLine(0, 0, 0, size);
ofPopMatrix();
ofPushMatrix();
ofTranslate(_rect.getBottomLeft() + ofPoint(-margin,margin));
ofLine(0, 0, size, 0);
ofLine(0, 0, 0, -size);
ofPopMatrix();
ofPushMatrix();
ofTranslate(_rect.getBottomRight() + ofPoint(margin,margin));
ofLine(0, 0, -size, 0);
ofLine(0, 0, 0, -size);
ofPopMatrix();
ofPopStyle();
}
示例2: rectangle
//----------------------------------------------------------
void ofPath::rectangle(const ofRectangle & r){
moveTo(r.getTopLeft());
lineTo(r.getTopRight());
lineTo(r.getBottomRight());
lineTo(r.getBottomLeft());
close();
}
示例3: rectangle
// Temporary fix until OF 0.8.0
static void rectangle(ofPath & path, const ofRectangle & r){
path.moveTo(r.getTopLeft());
path.lineTo(r.getTopRight());
path.lineTo(r.getBottomRight());
path.lineTo(r.getBottomLeft());
path.close();
}
示例4: ofRectangleLerp
ofRectangle ofRectangleLerp(const ofRectangle & rectFrom,
const ofRectangle & rectTo,
float progress) {
ofVec3f r00 = rectFrom.getTopLeft();
ofVec3f r01 = rectFrom.getBottomRight();
ofVec3f r10 = rectTo.getTopLeft();
ofVec3f r11 = rectTo.getBottomRight();
ofVec3f r20 = r00.interpolate(r10, progress);
ofVec3f r21 = r01.interpolate(r11, progress);
ofRectangle rect;
rect.set(r20, r21);
return rect;
}
示例5: pbPushRect
//--------------------------------------------------------------
void pbPushRect( const ofPoint &p1, const ofPoint &p2, const ofPoint &p3, const ofPoint &p4,
const ofRectangle &texRect,
vector<ofPoint> &points, vector<ofVec2f> &texs ) {
points.push_back( p1 );
points.push_back( p2 );
points.push_back( p3 );
points.push_back( p4 );
texs.push_back( texRect.getTopLeft() );
texs.push_back( texRect.getTopRight() );
texs.push_back( texRect.getBottomRight() );
texs.push_back( texRect.getBottomLeft() );
}
示例6: ofRectangleTransform
ofRectangle ofRectangleTransform(const ofRectangle & rect, const ofMatrix4x4 & mat) {
ofVec3f tl = rect.getTopLeft();
ofVec3f br = rect.getBottomRight();
tl = mat.preMult(tl);
br = mat.preMult(br);
ofRectangle r;
r.setPosition(tl);
r.growToInclude(br);
return r;
}
示例7: constrainToRect
void ofxParticle::constrainToRect(ofRectangle bounds, const float k, const float dist, const float drag)
{
ofPoint minPoint = bounds.getTopLeft();
ofPoint maxPoint = bounds.getBottomRight();
float inverse_drag = 1.0f / drag;
float inverse_mass = 1.0f / mass;
float spring_constant = inverse_mass * inverse_drag;
float force;
ofVec3f dir;
float dis;
// left side
if (position.x < minPoint.x) {
velocity.x = minPoint.x - position.x;
position.x = minPoint.x+1;
}
if (position.x < minPoint.x + dist) {
dir = ofVec3f(1,0,0);
dis = position.x - minPoint.x;
dis = dist - dis;
force = -k * dis * spring_constant;
acceleration += dir*(-force);
} else {
// right side
if (position.x > maxPoint.x) {
velocity.x = maxPoint.x - position.x;
position.x = maxPoint.x-1;
}
if (position.x > maxPoint.x - dist) {
dir = ofVec3f(-1,0,0);
dis = maxPoint.x - position.x;
dis = dist - dis;
force = -k * dis * spring_constant;
acceleration += dir*(-force);
}
}
// top side
if (position.y < minPoint.y) {
velocity.y = minPoint.y - position.y;
position.y = minPoint.y+1;
}
if (position.y < minPoint.y + dist) {
dir = ofVec3f(0,1,0);
dis = position.y - minPoint.y;
dis = dist - dis;
force = -k * dis * spring_constant;
acceleration += dir*(-force);
} else {
// bottom side
if (position.y > maxPoint.y) {
velocity.y = maxPoint.y - position.y;
position.y = maxPoint.y-1;
}
if (position.y > maxPoint.y - dist) {
dir = ofVec3f(0,-1,0);
dis = maxPoint.y - position.y;
dis = dist - dis;
force = -k * dis * spring_constant;
acceleration += dir*(-force);
}
}
}