void gradientWaves::addPointsToMesh(ofMesh *m, ofNode l, ofNode r, int i){ ofFloatColor col = ofColor::white; float mix = cos(i*3); ofFloatColor temp = ofColor::lightGreen; ofFloatColor temp2 = ofColor::darkMagenta; m->addVertex(l.getGlobalPosition()); m->addColor(col); m->addVertex(r.getGlobalPosition()); m->addColor(col); }
//---------------------------------------- void ofNode::setParent(ofNode& parent, bool bMaintainGlobalTransform) { if (this->parent) { // we need to make sure to clear before // re-assigning parenthood. clearParent(bMaintainGlobalTransform); } if(bMaintainGlobalTransform) { auto postParentPosition = position - parent.getGlobalPosition(); auto postParentOrientation = orientation.get() * glm::inverse(parent.getGlobalOrientation()); auto postParentScale = scale / parent.getGlobalScale(); parent.addListener(*this); setOrientation(postParentOrientation); setPosition(postParentPosition); setScale(postParentScale); } else { parent.addListener(*this); } this->parent = &parent; }
//---------------------------------------- void ofNode::orbitRad(float longitude, float latitude, float radius, ofNode& centerNode) { orbitRad(longitude, latitude, radius, centerNode.getGlobalPosition()); }
//---------------------------------------- void ofNode::lookAt(const ofNode& lookAtNode, const glm::vec3& upVector) { lookAt(lookAtNode.getGlobalPosition(), upVector); }
//---------------------------------------- void ofNode::lookAt(const ofNode& lookAtNode){ lookAt(lookAtNode.getGlobalPosition()); }
void ofNode::lookAt(ofNode& lookAtNode, const ofVec3f& upVector) { lookAt(lookAtNode.getGlobalPosition(), upVector); }