Skip to content

Commit

Permalink
various rift fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m1keall1son committed Jul 9, 2016
1 parent 1fa72e6 commit 117f000
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 22 deletions.
10 changes: 6 additions & 4 deletions CloudsLibrary/src/Core/CloudsPlaybackController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1836,8 +1836,8 @@ void CloudsPlaybackController::clearRenderTarget(){
//--------------------------------------------------------------------
bool CloudsPlaybackController::updateInterludeInterface(){

/*
#ifdef OCULUS_RIFT
/*
interludeContinueSelected = interludeHoveringContinue;
interludeResetSelected = interludeHoveringReset;
Expand All @@ -1849,12 +1849,14 @@ bool CloudsPlaybackController::updateInterludeInterface(){
interludeContinueSelected = true;
return true;
}
if(ofGetElapsedTimef() - interludeStartTime > 30 && !interludeHoveringContinue && !interludeHoveringReset){
interludeResetSelected = true;
*/

// if(ofGetElapsedTimef() - interludeStartTime > 15 && !interludeHoveringContinue && !interludeHoveringReset){
if(ofGetElapsedTimef() - interludeStartTime > 15){
interludeContinueSelected = true;
return true;
}
#endif
*/
return false;

}
Expand Down
27 changes: 22 additions & 5 deletions CloudsLibrary/src/RGBD/CloudsVisualSystemRGBD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ void CloudsVisualSystemRGBD::selfUpdate(){
questionSelectFade = 1.0;
#endif

// if(!transitioning){
// playerScaleModifier = 1.0;
// }

float transitionValue = getRGBDTransitionValue();
//cout << "TRANSITION IS " << transitionValue << endl;

Expand Down Expand Up @@ -1333,16 +1337,23 @@ void CloudsVisualSystemRGBD::startTransitionOut(RGBDTransitionType transitionTyp
setTransitionNodes( transitionType, option );

//transition to the left or right based on relative posiiton
#ifdef OCULUS_RIFT
if(selectedPortal != nullptr){
setOutOption(selectedPortal == &leftPortal ? OutRight : OutLeft);
}
else{
setOutOption( (cloudsCamera.getPosition().x - translatedHeadPosition.x) > 0 ? OutLeft : OutRight);
}
#else
setOutOption( (cloudsCamera.getPosition().x - translatedHeadPosition.x) > 0 ? OutLeft : OutRight);
#endif
//transitionEase = ofxTween::easeOut;
transitionEase = ofxTween::easeIn;
transitioning = true;

if(isResetSelected()){
cloudsCamera.setTransitionStartNode( &cloudsCamera.mouseBasedNode );
cloudsCamera.setTransitionTargetNode( &transitionOutReset );

}
else{
cloudsCamera.setTransitionStartNode( &cloudsCamera.mouseBasedNode );
Expand All @@ -1369,8 +1380,13 @@ void CloudsVisualSystemRGBD::updateTransition(float percentComplete)
if(transitioning) {
float easedPercent = ofxTween::map(percentComplete, 0, 1, 0, 1, true, ofxEasingCubic(), transitionEase );//ofxEasingSine
cloudsCamera.setTransitionPercent( easedPercent );


if(selectedPortal != nullptr){
playerScaleModifier = powf(ofMap(percentComplete,0,.8,1.0,0.0,true),2.0);
}
else{
playerScaleModifier = 1.0;
}

float easedRotPercent = easedPercent * easedPercent;//ofxTween::map(percentComplete, .6, 1, 0, 1, true, ofxEasingCubic(), transitionEase );//ofxEasingSine
cloudsCamera.setTransitionRotationPercent( easedRotPercent );

Expand Down Expand Up @@ -2103,7 +2119,8 @@ void CloudsVisualSystemRGBD::selfBegin(){
//clear any previously selected portals
caughtPortal = NULL;
selectedPortal = NULL;

playerScaleModifier = 1.0;

//make sure any portals are clear
leftPortal.clearSelection();
rightPortal.clearSelection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,13 @@ void CloudsIntroSequence::updateCamera(){
}
else {
float percentZoomed = powf(ofMap(ofGetElapsedTimef(), selectedQuestionTime, selectedQuestionTime + 2.0, 0.0, 1.0, true),2.);
playerScaleModifier = powf(ofMap(percentZoomed, 0, .4, 1.0, 0.0, true), 2.);
warpCamera.setPosition(selectQuestionStartPos.interpolate(selectedQuestion->hoverPosition, percentZoomed));
}
}

void CloudsIntroSequence::updateWaiting(){


#if defined(OCULUS_RIFT)
CalibrationNode* selectedNode = NULL;
for(int i = 0; i < introNodes.size(); i++){
Expand Down
12 changes: 5 additions & 7 deletions CloudsLibrary/src/VisualSystemsLibrary/CloudsVisualSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ CloudsVisualSystem::CloudsVisualSystem(){
bDoBloom = false;
bloomAmount = 0.;
isInterlude = false;

playerScaleModifier = 1.0;

bSetManualBackgroundColors = false;

pointcloudOffsetZ = 0.0;
Expand Down Expand Up @@ -564,11 +565,7 @@ void CloudsVisualSystem::update(ofEventArgs & args)

#ifdef OCULUS_RIFT
getOculusRift().baseCamera = &getCameraRef();
#ifdef OCULUS_RIFT
//TODO: Make dynamic
getOculusRift().setPlayerScale(playerScale);
#endif

getOculusRift().setPlayerScale(playerScale * playerScaleModifier);
#endif

for(vector<ofx1DExtruder *>::iterator it = extruders.begin(); it != extruders.end(); ++it){
Expand Down Expand Up @@ -955,7 +952,7 @@ void CloudsVisualSystem::draw3DCursor(){

// EZ: Only draw cursor on _Intro for now
// JG: Also draw during interlude
if(getSystemName() == "_Intro" || isInterlude){
if(getSystemName() == "_Intro"){
ofPushStyle();
ofPushMatrix();
glPushAttrib(GL_ALL_ATTRIB_BITS);
Expand Down Expand Up @@ -3618,6 +3615,7 @@ void CloudsVisualSystem::loadPresetGUISFromPath(string presetPath)

bWashGradient = false;
bBarGradient = false;
playerScaleModifier = 1.0;
backgroundGradientExponent = 1.0;

selfSetDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ class CloudsVisualSystem {
ofVec2f interactiveCameraRot, previousinteractiveCameraRot;

float questionSelectFade; //only used on Oculus in RGBD system
float playerScaleModifier; //attenuate player scale

//POST FX
bool bEnablePostFX;
Expand Down
10 changes: 5 additions & 5 deletions VSClusterMap/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ void testApp::setup(){
// clusterMap.forceScreenResolution(1920, 1080);
clusterMap.setup();
#ifdef OCULUS_RIFT
if(CloudsVisualSystem::getOculusRift().isHD()){
clusterMap.loadPresetGUISFromName("FollowTraverse_OculusHD");
}
else{
// if(CloudsVisualSystem::getOculusRift().isHD()){
// clusterMap.loadPresetGUISFromName("FollowTraverse_OculusHD");
// }
// else{
clusterMap.loadPresetGUISFromName("FollowTraverse_OculusSD");
}
// }
#else
// clusterMap.loadPresetGUISFromName("FollowTraverse_Screen");
clusterMap.loadPresetGUISFromName("TopicResearch_pretty");
Expand Down

0 comments on commit 117f000

Please sign in to comment.