Skip to content

Instantly share code, notes, and snippets.

@joezuntz
Created August 26, 2016 09:58
Show Gist options
  • Save joezuntz/5f8cafd3bf011d354b7f896530b7ad8e to your computer and use it in GitHub Desktop.
Save joezuntz/5f8cafd3bf011d354b7f896530b7ad8e to your computer and use it in GitHub Desktop.
AVROculusTimeline timeline;
AVROculus * main_loop;
// add main_loop to the AVROculusTimeline object.
// add
// give the main oculus object a vector (and hold on to the vector to keep it alive)
// and a timeline. Add a method to populate both.
// write the transitionTo function
// add stub translateTo
// add stub rotateTo
// add stub switchToFreeMode
for (auto & event : vector) {
timeline.append(event.type(), event.time, &event);
}
void AVROculusTimeline::callback(timeline_entry &entry, double timepoint){
if (event.type==EVENT_TYPE_TRANSITION){
OculusTransition * transition = (OculusTransition*) entry.data;
oculus->transitionTo(transition->target);
} else if (event.type==EVENT_TYPE_TRANSLATION){
OculusTransition * translation = (OculusTranslation *) entry.data;
main_loop->translateTo(transition.x, transition.y, transition.z);
} else if (event.type==EVENT_TYPE_ROTATION){
OculusRotation * rotation = (OculusRotation *) entry.data;
oculus->rotateTo(transition->theta, transition->phi);
}
}
void AVROculusTimeline::finished(double timepoint){
// Not sure what we should do here.
// End the tour? Switch to free mode?
// The latter
oculus->switchToFreeMode();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment