Ejemplo n.º 1
0
MotionGraphController::MotionGraphController(MotionGraph* _motion_graph,
	MotionDataSpecification& _motion_data_specs,
	float _character_size_scale)
: frame_rate(120.0f), character_size_scale(_character_size_scale)
{
	readInMotionSequences(_motion_data_specs);
	motion_graph = _motion_graph;

	// force a transition to start of first sequence
	string initial_seqID = _motion_data_specs.getSeqID(0);
	status.active_seqID = initial_seqID;
	status.active_frame = 0;
	status.active_frame = LONG_MAX;
	status.transition_trigger_frame = 0;
	status.transition_frame = 0;
	status.transition_seqID = initial_seqID;
	status.current_time = -1.0f;
	status.frame_zero_time = 0.0f;
}
Ejemplo n.º 2
0
MotionGraphController::MotionGraphController(MotionGraph &input)
{
	g = input;
	//Connector(g.allFrames.at(0), g.allFrames.at(1));
	cout << "initializing Motion Graph Controller \n Reading all frames to test first \n then Checking for neighbors \n" << endl;
	// pretty much tests to see if all frames are readable in the graph;
	readAllFrames();
	//read in the motion sequences
	readInMotionSequences();
	//read all the ids in the vector of MsVNames
	readAllSequenceIDs();

	/* test code*/
	status.FrameNumber = 0;
	status.SeqID = "swing5.bvh";
	status.isTransitioning = true;
	status.TransitionToSeqId = "swing5.bvh";
	MotionSequence *MS;
	MotionSequence *MS2;
	MotionSequence *MS3;
	MotionSequence *MS4;
	MS = returnMotionSequenceContainerFromID(status.SeqID).MS;
	status.FrameNumberTransition = MS->numFrames();
	status.FrameNumberTransitionTo = 0;



	//temp vertex target list
	/*
	MotionGraphController::vertexTargets temp;
	temp.SeqID = "swing5.bvh";
	temp.SeqID2 = "swing6.bvh";
	temp.FrameNumber = MS->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);
	//second transition
	MS2 = returnMotionSequenceContainerFromID("swing6.bvh").MS;
	temp.SeqID = "swing6.bvh";
	temp.SeqID2 = "swing5.bvh";
	temp.FrameNumber = MS2->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);

	MS3 = returnMotionSequenceContainerFromID("swing5.bvh").MS;
	temp.SeqID = "swing5.bvh";
	temp.SeqID2 = "swing7.bvh";
	temp.FrameNumber = MS3->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);

	MS4 = returnMotionSequenceContainerFromID("swing7.bvh").MS;
	temp.SeqID = "swing7.bvh";
	temp.SeqID2 = "swing8.bvh";
	temp.FrameNumber = MS4->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);

	MS4 = returnMotionSequenceContainerFromID("swing8.bvh").MS;
	temp.SeqID = "swing8.bvh";
	temp.SeqID2 = "swing9.bvh";
	temp.FrameNumber = MS4->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);

	MS4 = returnMotionSequenceContainerFromID("swing9.bvh").MS;
	temp.SeqID = "swing9.bvh";
	temp.SeqID2 = "swing10.bvh";
	temp.FrameNumber = MS4->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);

	MS4 = returnMotionSequenceContainerFromID("swing10.bvh").MS;
	temp.SeqID = "swing10.bvh";
	temp.SeqID2 = "swing11.bvh";
	temp.FrameNumber = MS4->numFrames();
	temp.FrameNumber2 = 0;
	path.push_back(temp);
	

	printStatus();
	cout << "update status" << endl;
	iterateStatus();
	pathBackup = path;
	*/
	//set the current_vertex 
	// only use once the names of the files MS match up with the names of the motion graph verticies 
	//CurrentVertex = FindVertex(status.SeqID, status.FrameNumber); 
	//cout << "just for testing" << endl;
}