本文整理汇总了C++中OvrGuiSys::GetApp方法的典型用法代码示例。如果您正苦于以下问题:C++ OvrGuiSys::GetApp方法的具体用法?C++ OvrGuiSys::GetApp怎么用?C++ OvrGuiSys::GetApp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OvrGuiSys
的用法示例。
在下文中一共展示了OvrGuiSys::GetApp方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEvent_Impl
//==============================
// ResumeMovieComponent::OnEvent_Impl
eMsgStatus ResumeMovieComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
switch( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return Frame( guiSys, vrFrame, self, event );
case VRMENU_EVENT_FOCUS_GAINED:
return FocusGained( guiSys, vrFrame, self, event );
case VRMENU_EVENT_FOCUS_LOST:
return FocusLost( guiSys, vrFrame, self, event );
case VRMENU_EVENT_TOUCH_DOWN:
if ( CallbackView != NULL )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
return MSG_STATUS_CONSUMED;
}
return MSG_STATUS_ALIVE;
case VRMENU_EVENT_TOUCH_UP:
if ( !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) && ( CallbackView != NULL ) )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->ResumeChoice( ItemNum );
return MSG_STATUS_CONSUMED;
}
return MSG_STATUS_ALIVE;
default:
OVR_ASSERT( !"Event flags mismatch!" );
return MSG_STATUS_ALIVE;
}
}
示例2: Frame
//==============================
// TheaterSelectionComponent::Frame
eMsgStatus TheaterSelectionComponent::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
double t = vrapi_GetTimeInSeconds();
if ( StartFadeInTime >= 0.0f && t >= StartFadeInTime )
{
HilightFader.StartFadeIn();
StartFadeInTime = -1.0f;
}
else if ( StartFadeOutTime >= 0.0f && t > StartFadeOutTime )
{
HilightFader.StartFadeOut();
StartFadeOutTime = -1.0f;
}
float const fadeRate = 1.0f / FadeDuration;
HilightFader.Update( fadeRate, vrFrame.DeltaSeconds );
float const hilightAlpha = HilightFader.GetFinalAlpha();
float const scale = ( ( HilightScale - 1.0f ) * hilightAlpha ) + 1.0f;
self->SetHilightScale( scale );
#if 0
if ( ( CallbackView != NULL ) && self->IsHilighted() && ( vrFrame.Input.buttonReleased & BUTTON_A ) )
{
if ( vrFrame.Input.buttonPressed & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
}
if ( vrFrame.Input.buttonReleased & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->SelectPressed();
}
}
#endif
return MSG_STATUS_ALIVE;
}
示例3: FocusGained
//==============================
// MovieSelectionComponent::FocusGained
eMsgStatus MovieSelectionComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
LOG( "FocusGained" );
// set the hilight flag
self->SetHilighted( true );
CallbackView->SelectionHighlighted( true );
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
return MSG_STATUS_ALIVE;
}
示例4: Frame
//==============================
// MovieSelectionComponent::Frame
eMsgStatus MovieSelectionComponent::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
CallbackView->SelectionHighlighted( self->IsHilighted() );
#if 0
if ( self->IsHilighted() )
{
if ( vrFrame.Input.buttonPressed & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
}
if ( vrFrame.Input.buttonReleased & BUTTON_A )
{
Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
CallbackView->SelectMovie();
}
}
#endif
return MSG_STATUS_ALIVE;
}
示例5: FocusGained
//==============================
// TheaterSelectionComponent::FocusGained
eMsgStatus TheaterSelectionComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
// set the hilight flag
self->SetHilighted( true );
StartFadeOutTime = -1.0;
StartFadeInTime = vrapi_GetTimeInSeconds();
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
return MSG_STATUS_ALIVE;
}
示例6: OnOpening
eMsgStatus OnOpening( OvrGuiSys & guiSys, ovrFrameInput const & vrFrame, VRMenuObject * self, VRMenuEvent const & event )
{
OVR_UNUSED( vrFrame );
OVR_UNUSED( event );
Oculus360Videos * videos = static_cast< Oculus360Videos* >( guiSys.GetApp()->GetAppInterface() );
CurrentVideo = (OvrVideosMetaDatum *)( videos->GetActiveVideo() );
// If opening VideoMenu without a Video selected, bail
if ( CurrentVideo == NULL )
{
guiSys.CloseMenu( &VideoMenu, false );
}
LoadAttribution( self );
return MSG_STATUS_CONSUMED;
}
示例7: FocusGained
//==============================
// ResumeMovieComponent::FocusGained
eMsgStatus ResumeMovieComponent::FocusGained( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
//LOG( "FocusGained" );
HasFocus = true;
Sound.PlaySound( guiSys.GetApp(), "gaze_on", 0.1 );
self->SetHilighted( true );
self->SetTextColor( HighlightColor );
if ( Icon != NULL )
{
Icon->SetColor( HighlightColor );
}
return MSG_STATUS_ALIVE;
}
示例8: FocusLost
//==============================
// ResumeMovieComponent::FocusLost
eMsgStatus ResumeMovieComponent::FocusLost( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
//LOG( "FocusLost" );
HasFocus = false;
Sound.PlaySound( guiSys.GetApp(), "gaze_off", 0.1 );
self->SetHilighted( false );
self->SetTextColor( self->IsHilighted() ? HighlightColor : NormalColor );
if ( Icon != NULL )
{
Icon->SetColor( self->IsHilighted() ? HighlightColor : NormalColor );
}
return MSG_STATUS_ALIVE;
}
示例9: OnItemEvent_Impl
void OvrVideoMenu::OnItemEvent_Impl( OvrGuiSys & guiSys, ovrFrameInput const & vrFrame,
VRMenuId_t const itemId, VRMenuEvent const & event )
{
OVR_UNUSED( vrFrame );
OVR_UNUSED( event );
const double now = vrapi_GetTimeInSeconds();
if ( ButtonCoolDown <= 0.0f && (now - OpenTime > 0.5))
{
ButtonCoolDown = BUTTON_COOL_DOWN_SECONDS;
Oculus360Videos * videos = static_cast< Oculus360Videos* >( guiSys.GetApp()->GetAppInterface() );
if ( itemId.Get() == ID_BROWSER_BUTTON.Get() )
{
videos->SetMenuState( Oculus360Videos::MENU_BROWSER );
}
else if ( itemId.Get( ) == ID_VIDEO_BUTTON.Get( ) )
{
videos->SeekTo( 0 );
}
}
}
示例10: Frame
//==============================
// VRMenuEventHandler::Frame
void VRMenuEventHandler::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame,
menuHandle_t const & rootHandle, Posef const & menuPose, Array< VRMenuEvent > & events )
{
VRMenuObject * root = guiSys.GetVRMenuMgr().ToObject( rootHandle );
if ( root == NULL )
{
return;
}
// find the object the gaze is touching and update gaze focus
const Matrix4f viewMatrix = guiSys.GetApp()->GetLastViewMatrix();
const Vector3f viewPos( GetViewMatrixPosition( viewMatrix ) );
const Vector3f viewFwd( GetViewMatrixForward( viewMatrix ) );
HitTestResult result;
menuHandle_t hitHandle = root->HitTest( guiSys, menuPose, viewPos, viewFwd, ContentFlags_t( CONTENT_SOLID ), result );
result.RayStart = viewPos;
result.RayDir = viewFwd;
VRMenuObject * hit = hitHandle.IsValid() ? guiSys.GetVRMenuMgr().ToObject( hitHandle ) : NULL;
/*
if ( hit != NULL )
{
guiSys.GetApp()->ShowInfoText( 0.0f, "%s", hit->GetText().ToCStr() );
}
*/
bool focusChanged = ( hitHandle != FocusedHandle );
if ( focusChanged )
{
// focus changed
VRMenuObject * oldFocus = guiSys.GetVRMenuMgr().ToObject( FocusedHandle );
if ( oldFocus != NULL )
{
// setup event for item losing the focus
VRMenuEvent event( VRMENU_EVENT_FOCUS_LOST, EVENT_DISPATCH_TARGET, FocusedHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
if ( hit != NULL )
{
if ( ( hit->GetFlags() & VRMENUOBJECT_FLAG_NO_FOCUS_GAINED ) == 0 )
{
// set up event for item gaining the focus
VRMenuEvent event( VRMENU_EVENT_FOCUS_GAINED, EVENT_DISPATCH_FOCUS, hitHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
}
FocusedHandle = hitHandle;
}
if ( ( vrFrame.Input.buttonPressed & BUTTON_SWIPE_UP ) != 0 )
{
VRMenuEvent event( VRMENU_EVENT_SWIPE_UP, EVENT_DISPATCH_FOCUS, FocusedHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
if ( ( vrFrame.Input.buttonPressed & BUTTON_SWIPE_DOWN ) != 0 )
{
VRMenuEvent event( VRMENU_EVENT_SWIPE_DOWN, EVENT_DISPATCH_FOCUS, FocusedHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
if ( ( vrFrame.Input.buttonPressed & BUTTON_SWIPE_FORWARD ) != 0 )
{
VRMenuEvent event( VRMENU_EVENT_SWIPE_FORWARD, EVENT_DISPATCH_FOCUS, FocusedHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
if ( ( vrFrame.Input.buttonPressed & BUTTON_SWIPE_BACK ) != 0 )
{
VRMenuEvent event( VRMENU_EVENT_SWIPE_BACK, EVENT_DISPATCH_FOCUS, FocusedHandle, Vector3f( 0.0f ), result );
events.PushBack( event );
}
bool touchPressed = ( vrFrame.Input.buttonPressed & ( BUTTON_TOUCH | BUTTON_A ) ) != 0;
bool touchReleased = !touchPressed && ( vrFrame.Input.buttonReleased & ( BUTTON_TOUCH | BUTTON_A ) ) != 0;
bool touchDown = ( vrFrame.Input.buttonState & BUTTON_TOUCH ) != 0;
// Need to update this for keyboard events as well
for ( int i = 0; i < vrFrame.Input.NumKeyEvents; i++ )
{
if ( vrFrame.Input.KeyEvents[i].KeyCode == OVR_KEY_RETURN )
{
switch ( vrFrame.Input.KeyEvents[i].EventType )
{
case KEY_EVENT_DOWN:
touchPressed = true;
break;
case KEY_EVENT_UP:
touchReleased = true;
break;
default:
break;
}
}
}
/*
// report swipe data
char const * swipeNames[5] = { "none", "down", "up", "back", "forward" };
//.........这里部分代码省略.........