2011-11-12 15:58:22 -05:00
|
|
|
#ifndef _GAME_RENDER_OBJECTS_H
|
|
|
|
#define _GAME_RENDER_OBJECTS_H
|
|
|
|
|
2012-02-06 10:29:18 +01:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
|
|
|
|
|
|
|
#include <components/esm_store/cell_store.hpp>
|
2011-10-31 23:59:16 -04:00
|
|
|
|
|
|
|
#include "../mwworld/refdata.hpp"
|
2011-11-01 13:46:57 -04:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2011-10-31 23:59:16 -04:00
|
|
|
|
|
|
|
namespace MWRender{
|
2011-11-07 23:35:39 -05:00
|
|
|
|
2011-10-31 23:59:16 -04:00
|
|
|
class Objects{
|
2012-02-06 10:41:13 +01:00
|
|
|
OEngine::Render::OgreRenderer &mRenderer;
|
2011-11-21 12:52:28 +01:00
|
|
|
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
|
2012-02-06 10:41:13 +01:00
|
|
|
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometry;
|
2012-03-27 00:45:25 +02:00
|
|
|
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometrySmall;
|
2012-04-05 19:07:21 +02:00
|
|
|
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometryAlpha;
|
2012-03-10 15:28:18 +01:00
|
|
|
std::map<MWWorld::Ptr::CellStore *, Ogre::AxisAlignedBox> mBounds;
|
2012-04-02 19:37:24 +02:00
|
|
|
std::vector<std::string> mLights;
|
2011-11-22 02:39:28 -05:00
|
|
|
Ogre::SceneNode* mMwRoot;
|
2012-02-06 10:41:13 +01:00
|
|
|
bool mIsStatic;
|
2011-11-04 21:57:39 -04:00
|
|
|
static int uniqueID;
|
|
|
|
static bool lightConst;
|
2011-11-03 19:40:37 -04:00
|
|
|
static float lightConstValue;
|
|
|
|
|
|
|
|
static bool lightLinear;
|
|
|
|
static int lightLinearMethod;
|
|
|
|
static float lightLinearValue;
|
|
|
|
static float lightLinearRadiusMult;
|
|
|
|
|
|
|
|
static bool lightQuadratic;
|
|
|
|
static int lightQuadraticMethod;
|
|
|
|
static float lightQuadraticValue;
|
|
|
|
static float lightQuadraticRadiusMult;
|
|
|
|
|
|
|
|
static bool lightOutQuadInLin;
|
2012-02-06 10:29:18 +01:00
|
|
|
|
|
|
|
void clearSceneNode (Ogre::SceneNode *node);
|
|
|
|
///< Remove all movable objects from \a node.
|
|
|
|
|
2011-10-31 23:59:16 -04:00
|
|
|
public:
|
2012-02-06 10:41:13 +01:00
|
|
|
Objects(OEngine::Render::OgreRenderer& renderer): mRenderer (renderer){}
|
2011-10-31 23:59:16 -04:00
|
|
|
~Objects(){}
|
2011-11-04 21:57:39 -04:00
|
|
|
void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
|
2011-11-01 13:46:57 -04:00
|
|
|
void insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh);
|
2011-11-04 21:57:39 -04:00
|
|
|
void insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius);
|
2011-11-21 12:52:28 +01:00
|
|
|
|
2012-04-02 19:37:24 +02:00
|
|
|
void enableLights();
|
|
|
|
void disableLights();
|
|
|
|
|
2012-03-10 15:28:18 +01:00
|
|
|
Ogre::AxisAlignedBox getDimensions(MWWorld::Ptr::CellStore*);
|
|
|
|
///< get a bounding box that encloses all objects in the specified cell
|
|
|
|
|
2011-11-21 12:52:28 +01:00
|
|
|
bool deleteObject (const MWWorld::Ptr& ptr);
|
|
|
|
///< \return found?
|
|
|
|
|
2011-11-19 01:01:19 -05:00
|
|
|
void removeCell(MWWorld::Ptr::CellStore* store);
|
2011-11-07 23:35:39 -05:00
|
|
|
void buildStaticGeometry(ESMS::CellStore<MWWorld::RefData> &cell);
|
2011-11-17 17:10:27 -05:00
|
|
|
void setMwRoot(Ogre::SceneNode* root);
|
2011-10-31 23:59:16 -04:00
|
|
|
};
|
2011-11-12 15:58:22 -05:00
|
|
|
}
|
2011-11-21 12:52:28 +01:00
|
|
|
#endif
|