Esempio n. 1
0
// -------------- update
void gradientWaves::update(){
    updateFade();
    updateWaveParameters();
    if(isEnabled){
        for (int i = waves.size()-1; i > 0; i--) {
            waves[i].update();
            waves[i].updateFishWave();
            
            int i_1 = waves.size()-1;
            int i_p = i+1;
            
            // add force to other waves
            // ~~~~~~~~~~ 0
            // ~~~~~~~~~~ 1
            // ~~~~~~~~~~ 2
            
            if(i != i_1){
                for(int j = 0; j < waves[i].points.size(); j++){
                    ofVec2f p1 = waves[i_p].points[j].p;
                    ofVec2f &p2 = waves[i].points[j].p;
                    if(fabs(p1.y - p2.y) < wavesTreshold * sf){
                        waves[i].addForceTo(&waves[i].points[j], - wavesForce);
                    }
                }
            }
        }
    }
}
Esempio n. 2
0
void wavesScene::update(){
    updateModeChange();
    updateParticles();
    updateInput();
    gradientWaves.update();
    stencilWaves.update();
    updateFade();
}
void StairvilleLEDParSpot::update(){
    if(fading){ updateFade(); }
    if(pulsing){ updatePulse(); }
    
    // TODO: Checken, ob das mit dem sizeof funktioniert
    for(int i=0; i<sizeof(channels); i++) {
        dmx->setLevel(i + startAddress, channels[i]);
    }
}
void ModSelectorScreen::initModAndPatchPanel()
{
    IconGridPanel *modgrid = panels[0];
    IconGridPanel *patchgrid = panels[1];
    ModIcon *ico;
    std::vector<ModIcon*> tv; // for sorting
    tv.resize(dsq->modEntries.size());
    for(unsigned int i = 0; i < tv.size(); ++i)
    {
        ico = NULL;
        for(RenderObject::Children::iterator it = modgrid->children.begin(); it != modgrid->children.end(); ++it)
            if(ModIcon* other = dynamic_cast<ModIcon*>(*it))
                if(other->modId == i)
                {
                    ico = other;
                    break;
                }

        if(!ico)
        {
            for(RenderObject::Children::iterator it = patchgrid->children.begin(); it != patchgrid->children.end(); ++it)
                if(ModIcon* other = dynamic_cast<ModIcon*>(*it))
                    if(other->modId == i)
                    {
                        ico = other;
                        break;
                    }

            if(!ico) // ok, its really not there.
            {
                ico = new ModIcon;
                ico->followCamera = 1;
                std::ostringstream os;
                os << "Created ModIcon " << i;
                debugLog(os.str());
            }
        }
            
        tv[i] = ico;
        ico->loadEntry(dsq->modEntries[i]);
    }
    std::sort(tv.begin(), tv.end(), _modname_cmp);

    for(int i = 0; i < tv.size(); ++i)
    {
        if(!tv[i]->getParent()) // ensure it was not added earlier
        {
            if(tv[i]->modType == MODTYPE_PATCH)
                patchgrid->add(tv[i]);
            else
                modgrid->add(tv[i]);
        }
    }
    updateFade();
}
Esempio n. 5
0
	void render(Graphics::RenderPass pass) {
		bool isTransparent = _fadeValue < 1.0;
		if (((pass == Graphics::kRenderPassOpaque     ) &&  isTransparent) ||
		    ((pass == Graphics::kRenderPassTransparent) && !isTransparent))
			return;

		glColor4f(1.0, 1.0, 1.0, _fadeValue);
		Graphics::Aurora::Model_NWN::render(Graphics::kRenderPassAll);
		glColor4f(1.0, 1.0, 1.0, 1.0);

		updateFade();
	}
void ModSelectorScreen::initNetPanel()
{
    if(!gotServerList)
    {
#ifndef AQUARIA_DEMO
        _FetchModList(dsq->user.network.masterServer, MAX_SERVER_HOPS);
#endif
        gotServerList = true; // try only once
    }

    updateFade();
}
Esempio n. 7
0
bool AudioMixer::event(QEvent *event)
{
    switch (event->type()){
        case QEvent::Timer:{
            QTimerEvent *timerEvent = static_cast<QTimerEvent *>(event);
            if (timerEvent->timerId() == m_fadeTimer)
                updateFade();
            break; }
        default:
            break;
    }
    return MediaNode::event(event);
}
Esempio n. 8
0
bool VolumeFaderEffect::event(QEvent *event)
{
    switch (event->type()){
        case QEvent::Timer:
        {
            QTimerEvent *timerEvent = static_cast<QTimerEvent *>(event);
            if (timerEvent->timerId() == m_fadeTimer)
                updateFade();
            break;
        }
        default:
            break;
    }
    return QObject::event(event);
}
void ModSelectorScreen::showPanel(int id)
{
    if(id == currentPanel)
        return;

    const float t = 0.2f;
    IconGridPanel *newgrid = panels[id];

    // fade in selected panel
    if(currentPanel < 0) // just bringing up?
    {
        newgrid->scale = Vector(0.8f,0.8f);
        newgrid->alpha = 0;
    }
    newgrid->fade(true, true);

    currentPanel = id;

    updateFade();
}
Esempio n. 10
0
void ofxFadableBase::updateFade(){
	unsigned long _currentTime = ofGetSystemTime();
	updateFade(_currentTime);
}