1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwrender/objects.hpp

64 lines
2.0 KiB
C++
Raw Normal View History

2011-11-12 15:58:22 -05:00
#ifndef _GAME_RENDER_OBJECTS_H
#define _GAME_RENDER_OBJECTS_H
#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-10-31 23:59:16 -04:00
class Objects{
2012-02-06 10:41:13 +01:00
OEngine::Render::OgreRenderer &mRenderer;
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
2012-02-06 10:41:13 +01:00
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometry;
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometrySmall;
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometryAlpha;
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;
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;
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);
2012-04-02 19:37:24 +02:00
void enableLights();
void disableLights();
Ogre::AxisAlignedBox getDimensions(MWWorld::Ptr::CellStore*);
///< get a bounding box that encloses all objects in the specified cell
bool deleteObject (const MWWorld::Ptr& ptr);
///< \return found?
void removeCell(MWWorld::Ptr::CellStore* store);
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
}
#endif