Ejemplo n.º 1
0
//==============================
// OvrSliderComponent::OvrSliderComponent
OvrSliderComponent::OvrSliderComponent( VRMenu & menu, float const sliderFrac, Vector3f const & localSlideDelta, 
		float const minValue, float const maxValue, float const sensitivityScale, VRMenuId_t const rootId, 
		VRMenuId_t const scrubberId, VRMenuId_t const textId, VRMenuId_t const bubbleId, VRMenuId_t const fillId )
		: VRMenuComponent( 	VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) | VRMENU_EVENT_TOUCH_UP |
							VRMENU_EVENT_TOUCH_RELATIVE | VRMENU_EVENT_INIT | VRMENU_EVENT_FRAME_UPDATE )
		, TouchDown( false )
		, SliderFrac( sliderFrac )
		, MinValue( minValue )
		, MaxValue( maxValue )
		, SensitivityScale( sensitivityScale )
		, LocalSlideDelta( localSlideDelta )
		, Menu( menu )
		, RootId( rootId )
		, ScrubberId( scrubberId )
		, TextId( textId )		
		, BubbleId( bubbleId )
		, FillId( fillId )
		, CaretBasePose()
		, BubbleFader( 0.0f )
		, BubbleFadeOutTime( -1.0 )
		, LastDot( 0.0f )
		, OnReleaseFunction( NULL )
		, OnReleaseObject( NULL )
{
}
Ejemplo n.º 2
0
//==============================
//  MoviePosterComponent::
MoviePosterComponent::MoviePosterComponent() :
	CarouselItemComponent( VRMenuEventFlags_t() ),
	CurrentItem( NULL ),
    Poster( NULL ),
	PosterImage( NULL ),
    Is3DIcon( NULL ),
    Shadow( NULL )
{
}
Ejemplo n.º 3
0
ControlsGazeTimer::ControlsGazeTimer() :
	VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) |
			VRMENU_EVENT_FOCUS_GAINED |
            VRMENU_EVENT_FOCUS_LOST ),
    LastGazeTime( 0 ),
    HasFocus( false )

{
}
Ejemplo n.º 4
0
//==============================
// OvrTextFade_Component::OvrTextFade_Component
OvrTextFade_Component::OvrTextFade_Component( Vector3f const & iconBaseOffset, Vector3f const & iconFadeOffset ) :
	VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) | VRMENU_EVENT_FOCUS_GAINED | VRMENU_EVENT_FOCUS_LOST ),
	TextAlphaFader( 0.0f ),
	StartFadeInTime( -1.0 ),
	StartFadeOutTime( -1.0 ),
	IconOffsetFader( 0.0f ),
	IconBaseOffset( iconBaseOffset ),
	IconFadeOffset( iconFadeOffset )
{
}
Ejemplo n.º 5
0
//==============================
//  MovieSelectionComponent::
MovieSelectionComponent::MovieSelectionComponent( SelectionView *view ) :
	VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) |
		VRMENU_EVENT_TOUCH_DOWN |
		VRMENU_EVENT_TOUCH_UP |
        VRMENU_EVENT_FOCUS_GAINED |
        VRMENU_EVENT_FOCUS_LOST ),
    CallbackView( view )

{
}
Ejemplo n.º 6
0
UIDiscreteSliderComponent::UIDiscreteSliderComponent( UIDiscreteSlider & discreteSlider, unsigned int startValue )
	: VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) |
						VRMENU_EVENT_TOUCH_UP |
						VRMENU_EVENT_FOCUS_GAINED |
						VRMENU_EVENT_FOCUS_LOST )
	, DiscreteSlider( discreteSlider )
	, CurrentValue( startValue )
{
	
}
Ejemplo n.º 7
0
UICellComponent::UICellComponent( UIDiscreteSliderComponent & sliderComponent, unsigned int val )
: VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_UP ) |
						VRMENU_EVENT_FOCUS_GAINED |
						VRMENU_EVENT_FOCUS_LOST )
	, SliderComponent( sliderComponent ) 
	, Value( val )
	, OnClickFunction( &UIDiscreteSliderComponent::OnCellSelect )
	, OnFocusGainedFunction( &UIDiscreteSliderComponent::OnCellFocusOn )
	, OnFocusLostFunction( &UIDiscreteSliderComponent::OnCellFocusOff )
{

}
//==============================
//  TheaterSelectionComponent::
TheaterSelectionComponent::TheaterSelectionComponent( TheaterSelectionView *view ) :
		CarouselItemComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) |
            VRMENU_EVENT_TOUCH_UP |
            VRMENU_EVENT_FOCUS_GAINED |
            VRMENU_EVENT_FOCUS_LOST |
            VRMENU_EVENT_FRAME_UPDATE ),
	CallbackView( view ),
	HilightFader( 0.0f ),
	StartFadeInTime( 0.0 ),
	StartFadeOutTime( 0.0 ),
	HilightScale( 1.05f ),
	FadeDuration( 0.25f )
{
}
Ejemplo n.º 9
0
//==============================
//  SwipeHintComponent::SwipeHintComponent()
SwipeHintComponent::SwipeHintComponent( CarouselBrowserComponent *carousel, const bool isRightSwipe, const float totalTime, const float timeOffset, const float delay ) :
	VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) | VRMENU_EVENT_OPENING ),
	Carousel( carousel ),
	IsRightSwipe( isRightSwipe ),
    TotalTime( totalTime ),
    TimeOffset( timeOffset ),
    Delay( delay ),
    StartTime( 0 ),
    ShouldShow( false ),
    IgnoreDelay( false ),
    TotalAlpha()

{
}
Ejemplo n.º 10
0
//==============================
//  ResumeMovieComponent::
ResumeMovieComponent::ResumeMovieComponent( ResumeMovieView * view, int itemNum ) :
    VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) | 
            VRMENU_EVENT_TOUCH_UP | 
            VRMENU_EVENT_FOCUS_GAINED | 
            VRMENU_EVENT_FOCUS_LOST |
            VRMENU_EVENT_FRAME_UPDATE ),

    Icon( NULL ),
    Sound(),
	HasFocus( false ),
    ItemNum( itemNum ),
    CallbackView( view )
{
}
Ejemplo n.º 11
0
//==============================
// OvrTextFade_Component::OnEvent_Impl
eMsgStatus OvrTextFade_Component::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
												VRMenuObject * self, VRMenuEvent const & event )
{
	OVR_ASSERT( HandlesEvent( VRMenuEventFlags_t( event.EventType ) ) );
	switch ( event.EventType )
	{
		case VRMENU_EVENT_FRAME_UPDATE:
		return Frame( app, vrFrame, menuMgr, self, event );
		case VRMENU_EVENT_FOCUS_GAINED:
		return FocusGained( app, vrFrame, menuMgr, self, event );
		case VRMENU_EVENT_FOCUS_LOST:
		return FocusLost( app, vrFrame, menuMgr, self, event );
		default:
		OVR_ASSERT( !"Event flags mismatch!" ); // the constructor is specifying a flag that's not handled
		return MSG_STATUS_ALIVE;
	}
}
Ejemplo n.º 12
0
ScrubBarComponent::ScrubBarComponent() :
	VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) |
		VRMENU_EVENT_TOUCH_DOWN |
		VRMENU_EVENT_FRAME_UPDATE |
		VRMENU_EVENT_FOCUS_GAINED |
        VRMENU_EVENT_FOCUS_LOST ),
	HasFocus( false ),
	TouchDown( false ),
	Progress( 0.0f ),
	Duration( 0 ),
	Background( NULL ),
	ScrubBar( NULL ),
	CurrentTime( NULL ),
	SeekTime( NULL ),
	OnClickFunction( NULL ),
	OnClickObject( NULL )

{
}
Ejemplo n.º 13
0
//==============================
//  OvrDefaultComponent::
OvrDefaultComponent::OvrDefaultComponent( Vector3f const & hilightOffset, float const hilightScale, 
        float const fadeDuration, float const fadeDelay, Vector4f const & textNormalColor, 
		Vector4f const & textHilightColor ) :
    VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_TOUCH_DOWN ) | 
            VRMENU_EVENT_TOUCH_UP | 
            VRMENU_EVENT_FOCUS_GAINED | 
            VRMENU_EVENT_FOCUS_LOST |
            VRMENU_EVENT_FRAME_UPDATE ),
    HilightFader( 0.0f ),
    StartFadeInTime( -1.0 ),
    StartFadeOutTime( -1.0 ),
    HilightOffset( hilightOffset ),
    HilightScale( hilightScale ),
    FadeDuration( fadeDuration ),
    FadeDelay( fadeDelay ),
	TextNormalColor( textNormalColor ),
	TextHilightColor( textHilightColor ),
	SuppressText( false )
{
}
Ejemplo n.º 14
0
//==============================
// OvrScrollBarComponent::OvrScrollBarComponent
OvrScrollBarComponent::OvrScrollBarComponent( const VRMenuId_t rootId, const VRMenuId_t baseId,
	const VRMenuId_t thumbId, const int startElementIndex, const int numElements )
		: VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) )
		, Fader( 0.0f )
		, FadeInRate( 1.0f / 0.2f )
		, FadeOutRate( 1.0f / 0.5f )
		, NumOfItems( 0 )
		, ScrollBarBaseWidth( 0.0f )
		, ScrollBarBaseHeight( 0.0f )
		, ScrollBarCurrentbaseLength( 0.0f )
		, ScrollBarThumbWidth( 0.0f )
		, ScrollBarThumbHeight( 0.0f )
		, ScrollBarCurrentThumbLength( 0.0f )
		, ScrollRootId( rootId )
		, ScrollBarBaseId( baseId )
		, ScrollBarThumbId( thumbId )
		, CurrentScrollState( SCROLL_STATE_HIDDEN )
		, IsVertical( false )
{
}
Ejemplo n.º 15
0
//==============================
// VRMenuEventHandler::DispatchToComponents
bool VRMenuEventHandler::DispatchToComponents( OvrGuiSys & guiSys, VrFrame const & vrFrame, 
        VRMenuEvent const & event, VRMenuObject * receiver ) const
{
	ASSERT_WITH_TAG( receiver != NULL, "VrMenu" );

	Array< VRMenuComponent* > const & list = receiver->GetComponentList();
	int numComps = list.GetSizeI();
	for ( int i = 0; i < numComps; ++i )
	{
		VRMenuComponent * item = list[i];
		if ( item->HandlesEvent( VRMenuEventFlags_t( event.EventType ) ) )
		{
			LogEventType( event, "DispatchEvent: to '%s'", receiver->GetText().ToCStr() );

			if ( item->OnEvent( guiSys, vrFrame, receiver, event ) == MSG_STATUS_CONSUMED )
			{
				LogEventType( event, "DispatchEvent: receiver '%s', component %i consumed event.", receiver->GetText().ToCStr(), i );
				return true;    // consumed by component
			}
		}
	}
	return false;
}
Ejemplo n.º 16
0
	OvrVideoMenuRootComponent( OvrVideoMenu & videoMenu )
		: VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) | VRMENU_EVENT_OPENING )
		, VideoMenu( videoMenu )
		, CurrentVideo( NULL )
	{
	}
Ejemplo n.º 17
0
	OvrPanoMenuRootComponent( OvrPanoMenu & panoMenu )
		: VRMenuComponent( VRMenuEventFlags_t( VRMENU_EVENT_FRAME_UPDATE ) | VRMENU_EVENT_OPENING )
		, PanoMenu( panoMenu )
		, CurrentPano( NULL )
	{
	}