Skip to content

Commit

Permalink
fix deprecation warnings with OF0.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
edovino committed Mar 7, 2016
1 parent 46cf628 commit 3520127
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ofxParticlesExample/src/testApp.cpp
Expand Up @@ -73,7 +73,7 @@ void testApp::update(){
float dt = min(ofGetLastFrameTime(), 1.0/10.0);
particleSystem.gravitateTo(ofPoint(ofGetWidth()/2,ofGetHeight()/2), gravAcc, 1, 10.0, false);
particleSystem.rotateAround(ofPoint(ofGetWidth()/2,ofGetHeight()/2), rotAcc, 10.0, false);
particleSystem.applyVectorField(vectorField.getPixels(), vectorField.getWidth(), vectorField.getHeight(), vectorField.getNumChannels(), ofGetWindowRect(), fieldMult);
particleSystem.applyVectorField(vectorField.getData(), vectorField.getWidth(), vectorField.getHeight(), vectorField.getNumChannels(), ofGetWindowRect(), fieldMult);
if(ofGetMousePressed(2)){
particleSystem.gravitateTo(ofPoint(mouseX,mouseY), gravAcc, 1, 10.0, false);
}
Expand Down Expand Up @@ -110,17 +110,17 @@ void testApp::draw(){
ofColor_<float> c = vectorField.getColor(x, y);
ofVec2f dir(c.r,c.g);

ofLine(x, y, x+dir.x, y+dir.y);
ofDrawLine(x, y, x+dir.x, y+dir.y);
}
ofPopMatrix();
}

ofNoFill();
ofSetCircleResolution(180);
ofSetColor(255, 0, 0, 50);
ofCircle(ofGetWidth()/2, ofGetHeight()/2, sqrt(gravAcc));
ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, sqrt(gravAcc));
ofSetColor(0, 0, 255, 50);
ofCircle(ofGetWidth()/2, ofGetHeight()/2, sqrt(rotAcc));
ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, sqrt(rotAcc));

ofSetLineWidth(2.0);
if (displayMode == 1) {
Expand Down
8 changes: 4 additions & 4 deletions src/ofxParticles.h
Expand Up @@ -170,7 +170,7 @@ class ofxParticle {
dist = springDist - dist;
float force = (-k / (mass * p->mass)) * (dist / drag);

ofVec3f dir = ((ofVec3f)(p->position - position)).normalized();
ofVec3f dir = ((ofVec3f)(p->position - position)).getNormalized();

acceleration += dir * (force / mass);
p->acceleration -= dir * (force / p->mass);
Expand Down Expand Up @@ -249,7 +249,7 @@ class ofxParticle {
ofColor c = color;
c.a = life/lifeStart*color.a;
ofSetColor(c);
ofLine(position, position-velocity*dt);
ofDrawLine(position, position-velocity*dt);
}

void draw(ofTexture &tex){
Expand Down Expand Up @@ -335,8 +335,8 @@ class ofxParticle {
ofVec3f vel = src.velocityStart;
if(src.positionEnd != src.positionStart || src.velocityStart != src.velocityEnd){
float rf = ofRandomuf();
pos = src.positionStart.interpolated(src.positionEnd, rf);
vel = src.velocityStart.interpolated(src.velocityEnd, rf);
pos = src.positionStart.getInterpolated(src.positionEnd, rf);
vel = src.velocityStart.getInterpolated(src.velocityEnd, rf);
}
ofVec3f p = pos+ofRandVec3f()*src.posSpread;
ofVec3f v = vel+ofRandVec3f()*src.velSpread;
Expand Down

0 comments on commit 3520127

Please sign in to comment.