Ejemplo n.º 1
0
//--------------------------------------------------------------
void testApp::setup(){
	
    
    long size;
    char *buf;
    char *ptr;
    
    size = pathconf(".", _PC_PATH_MAX);
    if ((buf = (char *)malloc((size_t)size)) != NULL){
        ptr = getcwd(buf, (size_t)size);
    }
    cout << ptr << endl;
    
	ofSetVerticalSync(true);
	ofEnableAlphaBlending();
	
	parser.loadFromFiles();
	visualSystems.loadPresets();
	
	storyEngine.parser = &parser;
	storyEngine.visualSystems = &visualSystems;
	storyEngine.printDecisions = false;
	storyEngine.combinedClipsOnly = false;
	storyEngine.setup();
	
	vector<CloudsClip*> startingNodes = parser.getClipsWithKeyword("#start");
	srand(ofGetSeconds());
    cout << "starting node size is " << startingNodes.size() << endl;
    
	ofRandomuf();
    ofRandomuf();
    ofRandomuf();
    
    int startNode = ofRandomuf()*startingNodes.size();
    cout << "START NODE index is " << startNode << endl;
    
	CloudsAct* act = storyEngine.buildAct(run, startingNodes[ startNode ]);
	run.topicHistory = act->getAllTopics();
	run.clipHistory = act->getAllClips();
	cout << "** TRAVERSAL INCLUDES:" << endl;
	for(int i = 0; i < run.clipHistory.size(); i++){
		cout << "	** " << run.clipHistory[i]->getID() << endl;
	}
    
//	clusterMap.forceScreenResolution(1920, 1080);
	clusterMap.setup();
#ifdef OCULUS_RIFT
	if(CloudsVisualSystem::getOculusRift().isHD()){
		clusterMap.loadPresetGUISFromName("FollowTraverse_OculusHD");
	}
	else{
		clusterMap.loadPresetGUISFromName("FollowTraverse_OculusSD");
	}
#else
//	clusterMap.loadPresetGUISFromName("FollowTraverse_Screen");
    clusterMap.loadPresetGUISFromName("NavigationInterlude_Screen");
#endif

	clusterMap.setRun(run);
	clusterMap.setAct(act);
	clusterMap.buildEntireCluster(parser);
	clusterMap.allocateFlickerTexture();
	
//	clusterMap.autoTraversePoints = true;
	clusterMap.populateDummyQuestions();
    
	clusterMap.playSystem();
	
}
Ejemplo n.º 2
0
//--------------------------------------------------------------
void testApp::exploreAct(CloudsClip* clip, string topic, bool playSeed, CloudsRun run, int depth, int maxDepth){
    if(depth == maxDepth){
        return;
    }
    
    if(topic == ""){
        ofLogError("TOPIC IS BLANK");
    }
    
    CloudsAct* act = storyEngine.buildAct(storyEngine.runTest, clip, topic, playSeed);
    copy( act->getAllClips().begin(), act->getAllClips().end(), inserter( traversedClips, traversedClips.end() ) );

    for(int c = 0; c < act->getAllQuestions().size(); c++){
        if(traversedClips.find(act->getAllQuestions()[c].first) == traversedClips.end()){
            cout << "TAKING QUESTION  " << act->getAllQuestions()[c].first->getLinkName() << " with TOPIC " <<  act->getAllQuestions()[c].second << " DEPTTH " << depth+1 << "/" << maxDepth << endl;
            exploreAct(act->getAllQuestions()[c].first, act->getAllQuestions()[c].second, true, run, depth+1, maxDepth);
        }
    }

    if(act->getAllClips().size() != 0){
        cout << "CONTINUING ACT  " << act->getAllClips().back()->getLinkName() << " with TOPIC " <<  act->getAllTopics().back() << " DEPTH " << depth+1 << "/" << maxDepth << endl;
    
        exploreAct(act->getAllClips().back(), act->getAllTopics().back(), false, run, depth+1, maxDepth);
    }
    
    delete act;
}