//============================== // OvrSliderComponent::SetCaretPoseFromFrac void OvrSliderComponent::SetCaretPoseFromFrac( OvrVRMenuMgr & menuMgr, VRMenuObject * self, float const frac ) { OVR_UNUSED( frac ); VRMenuObject * caret = menuMgr.ToObject( self->ChildHandleForId( menuMgr, ScrubberId ) ); if ( caret != NULL ) { Posef curPose = CaretBasePose; float range = MaxValue - MinValue; float frac = floor( SliderFrac * range ) / range; curPose.Position += ( LocalSlideDelta * -0.5f ) + LocalSlideDelta * frac; caret->SetLocalPose( curPose ); } // find the fill object and scale it menuHandle_t fillHandle = Menu.HandleForId( menuMgr, FillId ); VRMenuObject * fillObj = menuMgr.ToObject( fillHandle ); if ( fillObj != NULL ) { Vector4f clipUVs( 0.0f, 1.0f - SliderFrac, 1.0f, 1.0f ); VRMenuSurface & surf = fillObj->GetSurface( 0 ); surf.SetClipUVs( clipUVs ); //LOG( "SliderFrac = %.2f", SliderFrac ); //LOG( "Setting clip UVs to ( %.2f, %.2f, %.2f, %.2f )", clipUVs.x, clipUVs.y, clipUVs.z, clipUVs.w ); } }
void ResumeMovieView::SetPosition( OvrVRMenuMgr & menuMgr, const Vector3f &pos ) { menuHandle_t centerRootHandle = Menu->HandleForId( menuMgr, ID_CENTER_ROOT ); VRMenuObject * centerRoot = menuMgr.ToObject( centerRootHandle ); OVR_ASSERT( centerRoot != NULL ); Posef pose = centerRoot->GetLocalPose(); pose.Position = pos; centerRoot->SetLocalPose( pose ); }
//============================== // OvrSliderComponent::SetCaretPoseFromFrac void OvrSliderComponent::SetCaretPoseFromFrac( OvrVRMenuMgr & menuMgr, VRMenuObject * self, float const frac ) { VRMenuObject * caret = menuMgr.ToObject( self->ChildHandleForId( menuMgr, ScrubberId ) ); if ( caret != NULL ) { Posef curPose = CaretBasePose; float range = MaxValue - MinValue; float frac = floor( SliderFrac * range ) / range; curPose.Position += ( LocalSlideDelta * -0.5f ) + LocalSlideDelta * frac; caret->SetLocalPose( curPose ); } }