#ifndef _GAME_RENDER_OBJECTS_H #define _GAME_RENDER_OBJECTS_H #include #include #include "../mwworld/refdata.hpp" #include "../mwworld/ptr.hpp" namespace MWRender{ /// information about light needed for rendering struct LightInfo { std::string name; // ogre handle Ogre::ColourValue colour; float radius; }; class Objects{ OEngine::Render::OgreRenderer &mRenderer; std::map mCellSceneNodes; std::map mStaticGeometry; std::map mStaticGeometrySmall; std::map mBounds; std::vector mLights; Ogre::SceneNode* mMwRoot; bool mIsStatic; static int uniqueID; static float lightLinearValue; static float lightLinearRadiusMult; static bool lightQuadratic; static float lightQuadraticValue; static float lightQuadraticRadiusMult; static bool lightOutQuadInLin; bool mInterior; void clearSceneNode (Ogre::SceneNode *node); ///< Remove all movable objects from \a node. public: Objects(OEngine::Render::OgreRenderer& renderer): mRenderer (renderer), mInterior(true) {} ~Objects(){} void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_); void insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh); void insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius); void enableLights(); void disableLights(); void update (const float dt); ///< per-frame update void setInterior(const bool interior); ///< call this to switch from interior to exterior or vice versa 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 &cell); void setMwRoot(Ogre::SceneNode* root); }; } #endif