void CloudsIntroSequence::updateWaiting(){ // Trigger start manually if (startedOnclick) { nodeAlphaAttenuate = MAX(0,nodeAlphaAttenuate-0.02); clickToBeginAlpha *= .99; clickToBeginAlpha -= .001; clickToBeginAlpha = MAX(0,clickToBeginAlpha); return; } for(int i = 0; i < introNodes.size(); i++){ updateIntroNodePosition(*introNodes[i]); } for(int i = 0; i < introNodes.size(); i++){ updateIntroNodeInteraction(*introNodes[i]); //bail if we haven't completed this part of the sequence if(!introNodes[i]->finished){ break; } } if(introNodeThree.finished){ startedOnclick = true; timeline->play(); } #ifdef OCULUS_RIFT #elif defined(KINECT_INPUT) k4w::ViewerState viewerState = ((CloudsInputKinectOSC*)GetCloudsInput().get())->viewerState; if(startQuestions.size() > 0 && viewerState != k4w::ViewerState_None){ if(!promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 8){ if(viewerState == k4w::ViewerState_OutOfRange){ // CloudsPortalEventArgs args("MOVE CLOSER TO THE DISPLAY"); // ofNotifyEvent(events.portalHoverBegan, args); } else if(viewerState == k4w::ViewerState_PresentIdle){ // CloudsPortalEventArgs args("EXTEND YOUR HAND TO BEGIN"); // ofNotifyEvent(events.portalHoverBegan, args); } timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = true; kinectHelperTargetAlpha = 1.0; } else if(promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 4){ CloudsPortalEventArgs args(""); ofNotifyEvent(events.portalHoverEnded, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = false; kinectHelperTargetAlpha = 0.0; } } #else if(startQuestions.size() > 0){ if(!promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 10){ // CloudsPortalEventArgs args("CLICK TO BEGIN"); // ofNotifyEvent(events.portalHoverBegan, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = true; } else if(promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 4){ CloudsPortalEventArgs args(""); ofNotifyEvent(events.portalHoverEnded, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = false; } } #endif #ifdef MOUSE_INPUT if(clickTextActive){ float timeSinceActive = ofGetElapsedTimef() - clickTextActiveTime; float timeSinceMouse = ofGetElapsedTimef() - mouseLastMovedTime; clickToBeginAlpha = ofMap(timeSinceActive, .5,1.5, 0.0,1.0,true) * ofMap(currentTitleOpacity,titleTypeOpacity,.9,0.3,.7,true); #ifdef TARGET_WIN32 if(timeSinceMouse > 4.){ clickToBeginAlpha *= ofMap(timeSinceMouse, 4.0, 5.0, 1.0, 0.0,true); if(timeSinceMouse > 5.0){ clickTextActive = false; glfwSetCursorPos( ofAppGLFWWindow::windowP, getCanvasWidth()/2, getCanvasHeight()/2); } } #endif } #endif }
void CloudsIntroSequence::updateWaiting(){ // Trigger start manually if (startedOnclick) { nodeAlphaAttenuate = MAX(0,nodeAlphaAttenuate-0.02); return; } for(int i = 0; i < introNodes.size(); i++){ updateIntroNodePosition(*introNodes[i]); } for(int i = 0; i < introNodes.size(); i++){ updateIntroNodeInteraction(*introNodes[i]); //bail if we haven't completed this part of the sequence if(!introNodes[i]->finished){ break; } } if(introNodeThree.finished){ startedOnclick = true; timeline->play(); } #ifdef OCULUS_RIFT #elif defined(KINECT_INPUT) k4w::ViewerState viewerState = ((CloudsInputKinectOSC*)GetCloudsInput().get())->viewerState; if(startQuestions.size() > 0 && viewerState != k4w::ViewerState_None){ if(!promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 8){ if(viewerState == k4w::ViewerState_OutOfRange){ // CloudsPortalEventArgs args("MOVE CLOSER TO THE DISPLAY"); // ofNotifyEvent(events.portalHoverBegan, args); } else if(viewerState == k4w::ViewerState_PresentIdle){ // CloudsPortalEventArgs args("EXTEND YOUR HAND TO BEGIN"); // ofNotifyEvent(events.portalHoverBegan, args); } timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = true; kinectHelperTargetAlpha = 1.0; } else if(promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 4){ CloudsPortalEventArgs args(""); ofNotifyEvent(events.portalHoverEnded, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = false; kinectHelperTargetAlpha = 0.0; } } #else if(startQuestions.size() > 0){ if(!promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 10){ // CloudsPortalEventArgs args("CLICK TO BEGIN"); // ofNotifyEvent(events.portalHoverBegan, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = true; } else if(promptShown && ofGetElapsedTimef() - timeSinceLastPrompt > 4){ CloudsPortalEventArgs args(""); ofNotifyEvent(events.portalHoverEnded, args); timeSinceLastPrompt = ofGetElapsedTimef(); promptShown = false; } } #endif }