コード例 #1
0
void wxOgreRenderWindow::setCamera( Ogre::Camera* camera )
{
  viewport_->setCamera( camera );

  setCameraAspectRatio();

  Refresh();
}
コード例 #2
0
void QtOgreRenderWindow::setCamera( Ogre::Camera* camera )
{
  camera_ = camera;
  viewport_->setCamera( camera );

  setCameraAspectRatio();

  update();
}
コード例 #3
0
//------------------------------------------------------------------------------
void QtOgreRenderWindow::resizeEvent( QResizeEvent* event )
{
  RenderWidget::resizeEvent( event );

  if( render_window_ )
  {
    setCameraAspectRatio();

    if( auto_render_ )
    {
      update();
    }
  }
}
コード例 #4
0
QtOgreRenderWindow::QtOgreRenderWindow( QWidget* parent )
  : RenderWidget( RenderSystem::get(), parent )
  , viewport_( 0 )
  , ogre_root_( RenderSystem::get()->root() )
  , ortho_scale_( 1.0f )
  , auto_render_( true )
  , camera_( 0 )
  , overlays_enabled_( true ) // matches the default of Ogre::Viewport.
  , background_color_( Ogre::ColourValue::Black ) // matches the default of Ogre::Viewport.
{
  render_window_->setVisible(true);
  render_window_->setAutoUpdated(true);

  viewport_ = render_window_->addViewport( camera_ );
  viewport_->setOverlaysEnabled( overlays_enabled_ );
  viewport_->setBackgroundColour( background_color_ );

  setCameraAspectRatio();
}
コード例 #5
0
//------------------------------------------------------------------------------
void wxOgreRenderWindow::onSize (wxSizeEvent &evt)
{
  if (render_window_)
  {
    // Setting new size;
    int width;
    int height;
    wxSize size = evt.GetSize ();
    width = size.GetWidth ();
    height = size.GetHeight ();

    render_window_->resize (width, height);
    // Letting Ogre know the window has been resized;
    render_window_->windowMovedOrResized ();

    setCameraAspectRatio();

    Refresh();
  }

  evt.Skip();
}
コード例 #6
0
void QtOgreRenderWindow::setOrthoScale( float scale )
{
  ortho_scale_ = scale;

  setCameraAspectRatio();
}
コード例 #7
0
ファイル: SmallFixes.cpp プロジェクト: NGenesis/titanmods
void FixAspectRatio(){
	unsigned int cameraNode = findNode("avatar_camera");

	if(cameraNode)
		setCameraAspectRatio(cameraNode, (float)getScreenWidth() / (float)getScreenHeight());
}