2010-06-05 18:37:01 +00:00
|
|
|
#include "mwscene.hpp"
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
2010-06-06 11:36:45 +00:00
|
|
|
#include "OgreRoot.h"
|
|
|
|
#include "OgreRenderWindow.h"
|
|
|
|
#include "OgreSceneManager.h"
|
|
|
|
#include "OgreViewport.h"
|
|
|
|
#include "OgreCamera.h"
|
|
|
|
#include "OgreTextureManager.h"
|
|
|
|
|
2010-06-08 11:53:34 +00:00
|
|
|
using namespace MWRender;
|
2010-06-05 18:37:01 +00:00
|
|
|
using namespace Ogre;
|
|
|
|
|
2010-07-16 12:26:46 +00:00
|
|
|
MWScene::MWScene(OEngine::Render::OgreRenderer &_rend)
|
2010-06-06 11:48:20 +00:00
|
|
|
: rend(_rend)
|
2010-06-05 18:37:01 +00:00
|
|
|
{
|
2010-07-08 09:53:59 +00:00
|
|
|
rend.createScene("PlayerCam", 55, 5);
|
2010-06-05 18:37:01 +00:00
|
|
|
|
|
|
|
// Set default mipmap level (NB some APIs ignore this)
|
|
|
|
TextureManager::getSingleton().setDefaultNumMipmaps(5);
|
|
|
|
|
|
|
|
// Load resources
|
|
|
|
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
|
|
|
|
|
|
|
|
// Turn the entire scene (represented by the 'root' node) -90
|
|
|
|
// degrees around the x axis. This makes Z go upwards, and Y go into
|
|
|
|
// the screen (when x is to the right.) This is the orientation that
|
|
|
|
// Morrowind uses, and it automagically makes everything work as it
|
|
|
|
// should.
|
2010-07-08 09:53:59 +00:00
|
|
|
SceneNode *rt = rend.getScene()->getRootSceneNode();
|
2010-06-05 18:37:01 +00:00
|
|
|
mwRoot = rt->createChildSceneNode();
|
|
|
|
mwRoot->pitch(Degree(-90));
|
|
|
|
}
|