mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 06:15:35 +00:00
moved test cube from SceneWidget to WorldspaceWidget
This commit is contained in:
parent
7812427836
commit
ef1364878f
3 changed files with 17 additions and 6 deletions
|
@ -45,11 +45,6 @@ namespace CSVRender
|
||||||
|
|
||||||
mCamera = mSceneMgr->createCamera("foo");
|
mCamera = mSceneMgr->createCamera("foo");
|
||||||
|
|
||||||
Ogre::Entity* ent = mSceneMgr->createEntity("cube", Ogre::SceneManager::PT_CUBE);
|
|
||||||
ent->setMaterialName("BaseWhite");
|
|
||||||
|
|
||||||
mSceneMgr->getRootSceneNode()->attachObject(ent);
|
|
||||||
|
|
||||||
mCamera->setPosition(300,300,300);
|
mCamera->setPosition(300,300,300);
|
||||||
mCamera->lookAt(0,0,0);
|
mCamera->lookAt(0,0,0);
|
||||||
mCamera->setNearClipDistance(0.1);
|
mCamera->setNearClipDistance(0.1);
|
||||||
|
@ -118,6 +113,11 @@ namespace CSVRender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ogre::SceneManager *SceneWidget::getSceneManager()
|
||||||
|
{
|
||||||
|
return mSceneMgr;
|
||||||
|
}
|
||||||
|
|
||||||
void SceneWidget::paintEvent(QPaintEvent* e)
|
void SceneWidget::paintEvent(QPaintEvent* e)
|
||||||
{
|
{
|
||||||
if (!mWindow)
|
if (!mWindow)
|
||||||
|
|
|
@ -34,6 +34,8 @@ namespace CSVRender
|
||||||
void setNavigation (Navigation *navigation);
|
void setNavigation (Navigation *navigation);
|
||||||
///< \attention The ownership of \a navigation is not transferred to *this.
|
///< \attention The ownership of \a navigation is not transferred to *this.
|
||||||
|
|
||||||
|
Ogre::SceneManager *getSceneManager();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void paintEvent(QPaintEvent* e);
|
void paintEvent(QPaintEvent* e);
|
||||||
void resizeEvent(QResizeEvent* e);
|
void resizeEvent(QResizeEvent* e);
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
|
|
||||||
#include "worldspacewidget.hpp"
|
#include "worldspacewidget.hpp"
|
||||||
|
|
||||||
|
#include <OgreSceneNode.h>
|
||||||
|
#include <OgreSceneManager.h>
|
||||||
|
#include <OgreEntity.h>
|
||||||
|
|
||||||
#include "../world/scenetoolmode.hpp"
|
#include "../world/scenetoolmode.hpp"
|
||||||
|
|
||||||
CSVRender::WorldspaceWidget::WorldspaceWidget (QWidget *parent)
|
CSVRender::WorldspaceWidget::WorldspaceWidget (QWidget *parent)
|
||||||
: SceneWidget (parent)
|
: SceneWidget (parent)
|
||||||
{}
|
{
|
||||||
|
Ogre::Entity* ent = getSceneManager()->createEntity("cube", Ogre::SceneManager::PT_CUBE);
|
||||||
|
ent->setMaterialName("BaseWhite");
|
||||||
|
|
||||||
|
getSceneManager()->getRootSceneNode()->attachObject(ent);
|
||||||
|
}
|
||||||
|
|
||||||
void CSVRender::WorldspaceWidget::selectNavigationMode (const std::string& mode)
|
void CSVRender::WorldspaceWidget::selectNavigationMode (const std::string& mode)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue