本文整理汇总了C++中Bounds3f::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds3f::GetSize方法的具体用法?C++ Bounds3f::GetSize怎么用?C++ Bounds3f::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds3f
的用法示例。
在下文中一共展示了Bounds3f::GetSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOpen
void MoviePlayerView::OnOpen()
{
LOG( "OnOpen" );
CurViewState = VIEWSTATE_OPEN;
Cinema.SceneMgr.ClearMovie();
SeekSpeed = 0;
PlaybackPos = 0;
NextSeekTime = 0;
SetSeekIcon( SeekSpeed );
ScrubBar.SetProgress( 0.0f );
RepositionScreen = false;
MoveScreenAlpha.Set( 0, 0, 0, 0.0f );
HideUI();
Cinema.SceneMgr.LightsOff( 1.5f );
Cinema.StartMoviePlayback();
MovieTitleLabel.SetText( Cinema.GetCurrentMovie()->Title );
Bounds3f titleBounds = MovieTitleLabel.GetTextLocalBounds( Cinema.app->GetDefaultFont() ) * VRMenuObject::TEXELS_PER_METER;
MovieTitleLabel.SetImage( 0, SURFACE_TEXTURE_DIFFUSE, BackgroundTintTexture, titleBounds.GetSize().x + 88, titleBounds.GetSize().y + 32 );
PlayButton.SetButtonImages( PauseTexture, PauseHoverTexture, PausePressedTexture );
}
示例2: OnClick
void ScrubBarComponent::OnClick( App * app, VrFrame const & vrFrame, VRMenuEvent const & event )
{
if ( OnClickFunction == NULL )
{
return;
}
Vector3f hitPos = event.HitResult.RayStart + event.HitResult.RayDir * event.HitResult.t;
// move hit position into local space
const Posef modelPose = Background->GetWorldPose();
Vector3f localHit = modelPose.Orientation.Inverted().Rotate( hitPos - modelPose.Position );
Bounds3f bounds = Background->GetMenuObject()->GetLocalBounds( app->GetDefaultFont() ) * Background->GetParent()->GetWorldScale();
const float progress = ( localHit.x - bounds.GetMins().x ) / bounds.GetSize().x;
if ( ( progress >= 0.0f ) && ( progress <= 1.0f ) )
{
( *OnClickFunction )( this, OnClickObject, progress );
}
}
示例3: OnFrame
eMsgStatus ScrubBarComponent::OnFrame( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuObject * self, VRMenuEvent const & event )
{
if ( TouchDown )
{
if ( ( vrFrame.Input.buttonState & ( BUTTON_A | BUTTON_TOUCH ) ) != 0 )
{
OnClick( app, vrFrame, event );
}
else
{
TouchDown = false;
}
}
SeekTime->SetVisible( HasFocus );
if ( HasFocus )
{
Vector3f hitPos = event.HitResult.RayStart + event.HitResult.RayDir * event.HitResult.t;
// move hit position into local space
const Posef modelPose = Background->GetWorldPose();
Vector3f localHit = modelPose.Orientation.Inverted().Rotate( hitPos - modelPose.Position );
Bounds3f bounds = Background->GetMenuObject()->GetLocalBounds( app->GetDefaultFont() ) * Background->GetParent()->GetWorldScale();
const float progress = ( localHit.x - bounds.GetMins().x ) / bounds.GetSize().x;
if ( ( progress >= 0.0f ) && ( progress <= 1.0f ) )
{
const float seekwidth = ScrubBarWidth * progress;
Vector3f pos = SeekTime->GetLocalPosition();
pos.x = PixelScale( ScrubBarWidth * -0.5f + seekwidth );
SeekTime->SetLocalPosition( pos );
SetTimeText( SeekTime, Duration * progress );
}
}
return MSG_STATUS_ALIVE;
}