#include <control.h>
Public Member Functions | |
| wxOgreControl () | |
| Default constructor. | |
| wxOgreControl (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSUNKEN_BORDER|wxTRANSPARENT_WINDOW, const wxValidator &val=wxDefaultValidator, const wxString &name=wxT("OgreControl")) | |
| Constructs a window, with an embedded Ogre rendering window. | |
| virtual | ~wxOgreControl () |
| Destructor, call Destroy to clean Ogre stuff. | |
| virtual bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSUNKEN_BORDER|wxTRANSPARENT_WINDOW, const wxValidator &val=wxDefaultValidator, const wxString &name=wxT("OgreControl")) |
| Constructs a window, with an embedded Ogre rendering window. | |
| virtual bool | Destroy () |
| Destructor, deletes the camera if exists,. | |
| virtual void | Update () |
| Render a frame and update the rendering window. | |
| virtual wxSize | DoGetBestSize () const |
| Returns a small 3:4 window size. | |
| virtual Ogre::SceneManager * | CreateSceneManager (const Ogre::String &tn, const Ogre::String &name="") |
| Creates a scene manager instance of a given type. | |
| virtual Ogre::SceneManager * | CreateSceneManager (Ogre::SceneTypeMask tm, const Ogre::String &name="") |
| Creates a SceneManager instance of a given type. | |
| virtual void | SetSceneManager (Ogre::SceneManager *sm) |
| Set-up the rendering window for the given scene manager. | |
| virtual void | SetCamera (Ogre::Camera *cam) |
| Creates a viewport and attach the given camera to it. | |
| virtual void | RotateCamera (float relX, float relY, float relZ) |
| Rotates the camera anticlockwise, around its local x, y and z axis. | |
| virtual void | TranslateCamera (float x, float y, float z) |
| Moves the camera's position by the x, y, and z offsets along it's own axes (relative to orientation). | |
| virtual void | SetPolygonMode (const Ogre::PolygonMode &pm) |
| Sets the level of rendering detail required from this camera. | |
| virtual void | ProcessSelection (const wxPoint &pt) |
| Virtual method called by the default mouse handler. | |
| Ogre::Camera * | GetCamera () const |
| Retrieves the control's camera. | |
| Ogre::RenderWindow * | GetRenderWindow () const |
| Retrieves the control's render window. | |
| Ogre::Viewport * | GetViewport () const |
| Retrieves the control's viewport. | |
| void | AddViewport (Ogre::Camera *cam, int ZOrder=0, float left=0.0f, float top=0.0f, float width=1.0f, float height=1.0f) |
| Adds a viewport to the rendering target. | |
| void | DestroyRenderWindow () |
| Detaches the control's render window if exists. | |
Protected Member Functions | |
| virtual void | OnSize (wxSizeEvent &event) |
| virtual void | OnPaint (wxPaintEvent &event) |
| virtual void | OnMouseMove (wxMouseEvent &event) |
| virtual void | OnEraseBackground (wxEraseEvent &event) |
Protected Attributes | |
| Ogre::SceneManager * | m_sm |
| Ogre::Camera * | m_cam |
Private Member Functions | |
| virtual void | Init () |
| Initializes private variables. | |
| Ogre::RenderWindow * | CreateRenderWindow (const Ogre::String &name) |
| Creates an Ogre's rendering window. | |
| void | GetParentWindowHandle (Ogre::NameValuePairList &pl) |
| Retrieves the unique window identifier of this control. | |
Private Attributes | |
| Ogre::Root * | m_root |
| Ogre::RenderWindow * | m_rwin |
| Ogre::Viewport * | m_vp |
| long | m_x |
| Last x position of the cursor. | |
| long | m_y |
| Last y position of the cursor. | |
Static Private Attributes | |
| static unsigned int | m_instances |
| Number of rendering windows instantiated. | |
Definition at line 35 of file control.h.
| wxOgreControl::wxOgreControl | ( | ) |
Default constructor.
| wxOgreControl::wxOgreControl | ( | wxWindow * | parent, | |
| wxWindowID | id = wxID_ANY, |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = wxSUNKEN_BORDER|wxTRANSPARENT_WINDOW, |
|||
| const wxValidator & | val = wxDefaultValidator, |
|||
| const wxString & | name = wxT("OgreControl") | |||
| ) |
Constructs a window, with an embedded Ogre rendering window.
| virtual wxOgreControl::~wxOgreControl | ( | ) | [virtual] |
Destructor, call Destroy to clean Ogre stuff.
| void wxOgreControl::AddViewport | ( | Ogre::Camera * | cam, | |
| int | ZOrder = 0, |
|||
| float | left = 0.0f, |
|||
| float | top = 0.0f, |
|||
| float | width = 1.0f, |
|||
| float | height = 1.0f | |||
| ) |
Adds a viewport to the rendering target.
| virtual bool wxOgreControl::Create | ( | wxWindow * | parent, | |
| wxWindowID | id = wxID_ANY, |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = wxSUNKEN_BORDER|wxTRANSPARENT_WINDOW, |
|||
| const wxValidator & | val = wxDefaultValidator, |
|||
| const wxString & | name = wxT("OgreControl") | |||
| ) | [virtual] |
Constructs a window, with an embedded Ogre rendering window.
| Ogre::RenderWindow* wxOgreControl::CreateRenderWindow | ( | const Ogre::String & | name | ) | [private] |
Creates an Ogre's rendering window.
| name | the internal name of the Ogre::RenderWindow |
| virtual Ogre::SceneManager* wxOgreControl::CreateSceneManager | ( | Ogre::SceneTypeMask | tm, | |
| const Ogre::String & | name = "" | |||
| ) | [virtual] |
Creates a SceneManager instance of a given type.
| virtual Ogre::SceneManager* wxOgreControl::CreateSceneManager | ( | const Ogre::String & | tn, | |
| const Ogre::String & | name = "" | |||
| ) | [virtual] |
Creates a scene manager instance of a given type.
| virtual bool wxOgreControl::Destroy | ( | ) | [virtual] |
Destructor, deletes the camera if exists,.
| void wxOgreControl::DestroyRenderWindow | ( | ) |
Detaches the control's render window if exists.
| virtual wxSize wxOgreControl::DoGetBestSize | ( | ) | const [virtual] |
| Ogre::Camera* wxOgreControl::GetCamera | ( | ) | const |
| void wxOgreControl::GetParentWindowHandle | ( | Ogre::NameValuePairList & | pl | ) | [private] |
Retrieves the unique window identifier of this control.
| pl | an Ogre pair list passed to the createRenderWinow function. |
| Ogre::RenderWindow* wxOgreControl::GetRenderWindow | ( | ) | const |
| Ogre::Viewport* wxOgreControl::GetViewport | ( | ) | const |
| virtual void wxOgreControl::Init | ( | ) | [private, virtual] |
Initializes private variables.
| virtual void wxOgreControl::OnEraseBackground | ( | wxEraseEvent & | event | ) | [protected, virtual] |
| virtual void wxOgreControl::OnMouseMove | ( | wxMouseEvent & | event | ) | [protected, virtual] |
| virtual void wxOgreControl::OnPaint | ( | wxPaintEvent & | event | ) | [protected, virtual] |
| virtual void wxOgreControl::OnSize | ( | wxSizeEvent & | event | ) | [protected, virtual] |
| virtual void wxOgreControl::ProcessSelection | ( | const wxPoint & | pt | ) | [virtual] |
Virtual method called by the default mouse handler.
| pt | the position clicked by the user. |
Tutorial 3
| virtual void wxOgreControl::RotateCamera | ( | float | relX, | |
| float | relY, | |||
| float | relZ | |||
| ) | [virtual] |
Rotates the camera anticlockwise, around its local x, y and z axis.
Ogre::Camera::yaw
Ogre::Camera::pitch
| virtual void wxOgreControl::SetCamera | ( | Ogre::Camera * | cam | ) | [virtual] |
Creates a viewport and attach the given camera to it.
| virtual void wxOgreControl::SetPolygonMode | ( | const Ogre::PolygonMode & | pm | ) | [virtual] |
Sets the level of rendering detail required from this camera.
| virtual void wxOgreControl::SetSceneManager | ( | Ogre::SceneManager * | sm | ) | [virtual] |
Set-up the rendering window for the given scene manager.
This method creates a camera and attaches a viewport to the rendering window for the given scene manager.
| virtual void wxOgreControl::TranslateCamera | ( | float | x, | |
| float | y, | |||
| float | z | |||
| ) | [virtual] |
Moves the camera's position by the x, y, and z offsets along it's own axes (relative to orientation).
| virtual void wxOgreControl::Update | ( | ) | [virtual] |
Render a frame and update the rendering window.
Ogre::Camera* wxOgreControl::m_cam [protected] |
unsigned int wxOgreControl::m_instances [static, private] |
Ogre::Root* wxOgreControl::m_root [private] |
Ogre::RenderWindow* wxOgreControl::m_rwin [private] |
Ogre::SceneManager* wxOgreControl::m_sm [protected] |
Ogre::Viewport* wxOgreControl::m_vp [private] |
long wxOgreControl::m_x [private] |
long wxOgreControl::m_y [private] |