Skip to content

Commit

Permalink
dispatch optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
smukkejohan committed Apr 21, 2016
1 parent 0c510a8 commit c25fadc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ofStereo2016/src/SoundField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void SoundField::update() {


//if(voroEnd->enabled.get()) {


fadeInFromNodes = voroEnd->wall.getChildren();

Expand All @@ -126,7 +127,14 @@ void SoundField::update() {
}

if(fadeIn < 1) {
for( auto c : cluster.getChildren() ) {


dispatch_apply( cluster.getChildren().size(), dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^(size_t childNumber){

VoroNode * c = cluster.getChildren()[childNumber];


//for( auto c : cluster.getChildren() ) {

// TODO: theese null nullptr checks doesn't work
// fidn a way to invalidate transitionRef and check for it
Expand All @@ -136,17 +144,15 @@ void SoundField::update() {

ofVec3f from = ofVec3f(c->transitionRef->getPosition() + ofVec3f(c->transitionRef->renderPosOffset * c->transitionRef->getLocalTransformMatrix().getInverse() ) ) * c->transitionRef->getGlobalTransformMatrix();



//ofVec3f toDiff = c->positionOverideTarget - c->getGlobalPosition();

ofVec3f interp = from.getInterpolated(c->positionOverideTarget * cluster.getGlobalTransformMatrix() , fadeIn);

c->setGlobalPosition(interp);
}

}
//}
});
}

//}


Expand Down

0 comments on commit c25fadc

Please sign in to comment.