openmw-tes3coop/game/mwrender/interior.hpp

86 lines
2.1 KiB
C++
Raw Normal View History

2010-06-12 11:01:20 +00:00
#ifndef _GAME_RENDER_INTERIOR_H
#define _GAME_RENDER_INTERIOR_H
#include "cell.hpp"
#include "esm_store/cell_store.hpp"
2010-06-12 12:45:54 +00:00
#include "OgreColourValue.h"
namespace Ogre
{
class SceneNode;
}
2010-06-12 11:01:20 +00:00
namespace MWRender
{
class MWScene;
2010-06-12 11:01:20 +00:00
/**
This class is responsible for inserting meshes and other
rendering objects from the given cell into the given rendering
scene.
TODO FIXME: Doesn't do full cleanup yet.
*/
class InteriorCellRender : private CellRender
{
const ESMS::CellStore &cell;
MWScene &scene;
/// The scene node that contains all objects belonging to this
/// cell.
Ogre::SceneNode *base;
Ogre::SceneNode *insert;
2010-06-12 12:45:54 +00:00
// 0 normal, 1 more bright, 2 max
int ambientMode;
Ogre::ColourValue ambientColor;
2010-06-12 11:01:20 +00:00
/// start inserting a new reference.
virtual void insertBegin (const ESM::CellRef &ref);
2010-06-12 11:01:20 +00:00
/// insert a mesh related to the most recent insertBegin call.
virtual void insertMesh(const std::string &mesh);
/// insert a light related to the most recent insertBegin call.
virtual void insertLight(float r, float g, float b, float radius);
2010-06-12 11:01:20 +00:00
/// finish inserting a new reference and return a handle to it.
virtual std::string insertEnd();
2010-06-12 12:45:54 +00:00
/// configure lighting according to cell
void configureAmbient();
/// configure fog according to cell
void configureFog();
void setAmbientMode();
2010-06-12 11:01:20 +00:00
public:
InteriorCellRender(const ESMS::CellStore &_cell, MWScene &_scene)
2010-06-12 12:45:54 +00:00
: cell(_cell), scene(_scene), base(NULL), insert(NULL), ambientMode (0) {}
2010-06-12 11:01:20 +00:00
virtual ~InteriorCellRender() { destroy(); }
/// Make the cell visible. Load the cell if necessary.
void show();
/// Remove the cell from rendering, but don't remove it from
/// memory.
void hide();
/// Destroy all rendering objects connected with this cell.
void destroy();
2010-06-12 12:45:54 +00:00
/// Switch through lighting modes.
void toggleLight();
2010-06-12 11:01:20 +00:00
};
}
#endif