From: <vo...@us...> - 2008-11-20 09:44:39
|
Revision: 984 http://opde.svn.sourceforge.net/opde/?rev=984&view=rev Author: volca Date: 2008-11-20 09:44:34 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Some more preformance statistics Modified Paths: -------------- trunk/src/scenemanager/DarkSceneManager.cpp trunk/src/scenemanager/DarkSceneManager.h Modified: trunk/src/scenemanager/DarkSceneManager.cpp =================================================================== --- trunk/src/scenemanager/DarkSceneManager.cpp 2008-11-20 09:43:33 UTC (rev 983) +++ trunk/src/scenemanager/DarkSceneManager.cpp 2008-11-20 09:44:34 UTC (rev 984) @@ -7,11 +7,11 @@ * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to @@ -21,8 +21,8 @@ * $Id$ * *****************************************************************************/ - + #include "DarkSceneManager.h" #include "DarkBspTree.h" #include "DarkCamera.h" @@ -35,12 +35,12 @@ #include <OgreTimer.h> namespace Ogre { - + // ---------------------------------------------------------------------- DarkSceneManager::DarkSceneManager(const String& instanceName) : SceneManager(instanceName), mFrameNum(1), mActiveGeometry(NULL) { mBspTree = new BspTree(this); mDarkLightFactory = new DarkLightFactory(); - + Root::getSingleton().addMovableObjectFactory(mDarkLightFactory); } @@ -49,12 +49,12 @@ DarkSceneManager::~DarkSceneManager() { // Just to be sure clearScene(); - + // Delete the bsp tree delete mBspTree; - + Root::getSingleton().removeMovableObjectFactory(mDarkLightFactory); - + // and the factory for darklights delete mDarkLightFactory; } @@ -67,27 +67,27 @@ // Destroy all the portals PortalList::iterator it = mPortals.begin(); - + for (; it != mPortals.end(); ++it) { (*it)->detach(); delete *it; } - + mPortals.clear(); - + // clear the BSP tree mBspTree->clear(); - + // clear all the geometries destroyAllGeometries(); // clear the visible cell list for all cameras CameraList::iterator cit = mCameras.begin(); - + for (; cit != mCameras.end(); ++cit) static_cast<DarkCamera*>(cit->second)->mVisibleCells.clear(); - SceneManager::clearScene(); + SceneManager::clearScene(); } @@ -98,7 +98,7 @@ if (it != mPortals.end()) { (*it)->detach(); mPortals.erase(it); - + delete *it; } } @@ -107,19 +107,19 @@ // ---------------------------------------------------------------------- Portal * DarkSceneManager::createPortal(BspNode* src, BspNode* dst, const Plane& plane) { Portal* p = new Portal(src, dst, plane); - + mPortals.insert(p); - + p->attach(); return p; } - + // ---------------------------------------------------------------------- Portal * DarkSceneManager::createPortal(int srcLeafID, int dstLeafID, const Plane& plane) { Portal* p = new Portal(getBspLeaf(srcLeafID), getBspLeaf(dstLeafID), plane); - + mPortals.insert(p); - + p->attach(); return p; } @@ -128,11 +128,15 @@ void DarkSceneManager::_updateSceneGraph(Camera* cam) { // The cam should be updated with the current cell list // TODO: Specialize here. Only update the part of the world visible by the camera + unsigned long startt = Root::getSingleton().getTimer()->getMilliseconds(); + updateDirtyLights(); - + SceneManager::_updateSceneGraph(cam); - + mFrameNum++; + + mSceneGraphTime = Root::getSingleton().getTimer()->getMilliseconds() - startt; } @@ -147,46 +151,46 @@ } Camera * c = new DarkCamera( name, this ); - + mCameras.insert( CameraList::value_type( name, c ) ); - + // Visible objects bounds info for the camera mCamVisibleObjectsMap[c] = VisibleObjectsBoundsInfo(); return c; } - + // ---------------------------------------------------------------------- BspNode* DarkSceneManager::createBspNode(int id, int leafID) { BspNode* node = mBspTree->createNode(id, leafID); - + return node; } - - + + // ---------------------------------------------------------------------- BspNode* DarkSceneManager::getBspNode(int id) { return mBspTree->getNode(id); } - + // ---------------------------------------------------------------------- BspNode* DarkSceneManager::getBspLeaf(int leafID) { return mBspTree->getLeafNode(leafID); - } - + } + // ---------------------------------------------------------------------- void DarkSceneManager::setRootBspNode(int id) { mBspTree->setRootNode(id); } - + // ---------------------------------------------------------------------- SceneNode* DarkSceneManager::createSceneNode(void) { DarkSceneNode * sn = new DarkSceneNode( this ); mSceneNodes[ sn->getName() ] = sn; return sn; } - + // ---------------------------------------------------------------------- SceneNode* DarkSceneManager::createSceneNode(const String& name) { if (mSceneNodes.find(name) != mSceneNodes.end()) @@ -196,12 +200,12 @@ "A SceneNode with the name " + name + " already exists", "DarkSceneManager::createSceneNode" ); } - + DarkSceneNode * sn = new DarkSceneNode( this, name ); mSceneNodes[ sn->getName() ] = sn; return sn; } - + // ---------------------------------------------------------------------- void DarkSceneManager::_notifyObjectMoved(const MovableObject* mov, const Vector3& pos) { if (mBspTree != NULL) { @@ -218,6 +222,8 @@ //----------------------------------------------------------------------- void DarkSceneManager::_findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters) { + unsigned long startt = Root::getSingleton().getTimer()->getMilliseconds(); + // Clear the render queue first RenderQueue* renderQueue = getRenderQueue(); @@ -227,22 +233,22 @@ // Ensure the camera is updated (otherwise we'd have problems if it updated while in the upcoming loop) static_cast<DarkCamera*>(cam)->updateFrustum(); static_cast<DarkCamera*>(cam)->updateView(); - + // update the camera's internal visibility list static_cast<DarkCamera*>(cam)->updateVisibleCellList(); - + MovablesForRendering movablesForRendering; // using a tag (frameNum) would probably be faster. hmm. // clear the current visibility list DarkCamera* dcam = static_cast<DarkCamera*>(cam); BspNodeList::iterator it = dcam->mVisibleCells.begin(); BspNodeList::iterator end = dcam->mVisibleCells.end(); - + // Insert all movables that are visible according to the parameters while (it != end) { BspNode *node = *(it++); - + // insert the movables of this cell to the movables for rendering const BspNode::IntersectingObjectSet& objects = node->getObjects(); BspNode::IntersectingObjectSet::const_iterator oi, oiend; @@ -253,138 +259,143 @@ { // It hasn't been rendered yet MovableObject *mov = const_cast<MovableObject*>(*oi); // hacky - + if (mov == cam) continue; - - + + if (mov->isVisible() && (!onlyShadowCasters || mov->getCastShadows())) { // && cam->isVisible(mov->getWorldBoundingBox()) mov->_notifyCurrentCamera(cam); mov->_updateRenderQueue( getRenderQueue() ); - + visibleBounds->merge(mov->getBoundingBox(), mov->getWorldBoundingSphere(), cam); - + movablesForRendering.insert(*oi); } - } + } } } - + + mFindVisibleObjectsTime = Root::getSingleton().getTimer()->getMilliseconds() - startt; + + if (mActiveGeometry) { - unsigned long startt = Root::getSingleton().getTimer()->getMilliseconds(); - + startt = Root::getSingleton().getTimer()->getMilliseconds(); + mActiveGeometry->updateFromCamera(static_cast<DarkCamera*>(cam)); mActiveGeometry->queueForRendering(mRenderQueue); - + mStaticBuildTime = Root::getSingleton().getTimer()->getMilliseconds() - startt; } } - + //----------------------------------------------------------------------- const String& DarkSceneManager::getTypeName(void) const { return DarkSceneManagerFactory::FACTORY_TYPE_NAME; } - + //----------------------------------------------------------------------- Light* DarkSceneManager::createLight(const String& name) { return static_cast<Light*>(createMovableObject(name, DarkLightFactory::FACTORY_TYPE_NAME)); - + } - + //----------------------------------------------------------------------- Light* DarkSceneManager::getLight(const String& name) { return static_cast<Light*>(getMovableObject(name, DarkLightFactory::FACTORY_TYPE_NAME)); } - + //----------------------------------------------------------------------- bool DarkSceneManager::hasLight(const String& name) { return hasMovableObject(name, DarkLightFactory::FACTORY_TYPE_NAME); } - + //----------------------------------------------------------------------- void DarkSceneManager::destroyLight(const String& name) { destroyMovableObject(name, DarkLightFactory::FACTORY_TYPE_NAME); } - - + + //----------------------------------------------------------------------- void DarkSceneManager::destroyAllLights(void) { destroyAllMovableObjectsByType(DarkLightFactory::FACTORY_TYPE_NAME); } - + //----------------------------------------------------------------------- void DarkSceneManager::queueLightForUpdate(Light* l) { static_cast<DarkLight*>(l)->_updateNeeded(); // Adds itself into queue } - + //----------------------------------------------------------------------- void DarkSceneManager::_queueLightForUpdate(Light* l) { mLightsForUpdate.insert(static_cast<DarkLight*>(l)); } - + //----------------------------------------------------------------------- void DarkSceneManager::destroyAllGeometries(void) { DarkGeometryMap::iterator it = mDarkGeometryMap.begin(); - + while (it != mDarkGeometryMap.end()) { DarkGeometryMap::iterator it2 = it++; - + DarkGeometry* g = it2->second; mDarkGeometryMap.erase(it2); - + delete g; } } - + //----------------------------------------------------------------------- void DarkSceneManager::updateDirtyLights() { LightSet::iterator it = mLightsForUpdate.begin(); LightSet::iterator end = mLightsForUpdate.end(); - + while (it != end) { DarkLight* l = *(it++); - + l->_updateAffectedCells(); } - + mLightsForUpdate.clear(); } - + //----------------------------------------------------------------------- void DarkSceneManager::findLightsAffectingFrustum(const Camera* camera) { + unsigned long startt = Root::getSingleton().getTimer()->getMilliseconds(); + // Collect lights from visible cells std::set<Light*> lightSet; - + const DarkCamera* dcam = static_cast<const DarkCamera*>(camera); - + BspNodeList::const_iterator it = dcam->mVisibleCells.begin(); BspNodeList::const_iterator end = dcam->mVisibleCells.end(); - + while (it != end) { BspNode* n = *(it++); - + lightSet.insert(n->mAffectingLights.begin(), n->mAffectingLights.end()); } - + // Transfer into mTestLightInfos std::set<Light*>::iterator lit = lightSet.begin(); std::set<Light*>::iterator lend = lightSet.end(); - + mTestLightInfos.clear(); mTestLightInfos.reserve(lightSet.size()); - + while (lit != lend) { LightInfo lightInfo; - + Light* light = *(lit++); - + lightInfo.light = light; lightInfo.type = light->getType(); - + if (lightInfo.type == Light::LT_DIRECTIONAL) { lightInfo.position = Vector3::ZERO; lightInfo.range = 0; @@ -392,9 +403,9 @@ } else { lightInfo.range = light->getAttenuationRange(); lightInfo.position = light->getDerivedPosition(); - + Sphere sphere(lightInfo.position, lightInfo.range); - + if (camera->isVisible(sphere)) { mTestLightInfos.push_back(lightInfo); } @@ -406,29 +417,29 @@ // Update lights affecting frustum if changed if (mCachedLightInfos != mTestLightInfos) { mLightsAffectingFrustum.resize(mTestLightInfos.size()); - + LightInfoList::const_iterator i; LightList::iterator j = mLightsAffectingFrustum.begin(); - + for (i = mTestLightInfos.begin(); i != mTestLightInfos.end(); ++i, ++j) { *j = i->light; - + // add cam distance for sorting if texture shadows if (isShadowTechniqueTextureBased()) { (*j)->tempSquareDist = (camera->getDerivedPosition() - (*j)->getDerivedPosition()).squaredLength(); } } - + // Sort the lights if using texture shadows, since the first 'n' will be // used to generate shadow textures and we should pick the most appropriate if (isShadowTechniqueTextureBased()) { // Allow a Listener to override light sorting // Reverse iterate so last takes precedence bool overridden = false; - + for (ShadowListenerList::reverse_iterator ri = mShadowListeners.rbegin(); ri != mShadowListeners.rend(); ++ri) { - + overridden = (*ri)->sortLightsAffectingFrustum(mLightsAffectingFrustum); if (overridden) break; @@ -446,50 +457,54 @@ // notify light dirty, so all movable objects will re-populate // their light list next time - + // TODO: This takes too much time per frame! _notifyLightsDirty(); } + + mLightListTime = Root::getSingleton().getTimer()->getMilliseconds() - startt; } - + //----------------------------------------------------------------------- void DarkSceneManager::_populateLightList(const Vector3 &position, Real radius, LightList &destList) { - /* It's a pity we don't get a movable object here, + /* It's a pity we don't get a movable object here, since that would mean we'd save one BSP tree traversal per MovableObject light list population. - + The root of the problem is that many classes base on MovableObject, and that one queries with pos and radius already, so we would have to create our own versions of Entity, BillBoardChain, etc. just to override one method (queryLights) - - As a solution, this scenemanager uses MovableObject::Listener on BspTree, and as the BspTree caches light lists for cells, + + As a solution, this scenemanager uses MovableObject::Listener on BspTree, and as the BspTree caches light lists for cells, it returns the light list for object immediately */ - + if (!mBspTree) return; - + + return; + BspNodeList leafList; - + mBspTree->findLeafsForSphere(leafList, position, radius); - + // List of all leafs the sphere is in BspNodeList::iterator it = leafList.begin(); - + // This set ensures the resulting destination list will get unique set of lights std::set<DarkLight*> resLights; - + destList.clear(); - + while (it != leafList.end()) { BspNode* node = *(it++); - + BspNode::AffectingLights::const_iterator lit = node->mAffectingLights.begin(); BspNode::AffectingLights::const_iterator lend = node->mAffectingLights.end(); - + // Fill the light list by querying if the light's radius is touching the movable while (lit != lend) { DarkLight* lt = *(lit++); - - // If it has not been considered yet, reconsider this light + + // If it has not been considered yet, reconsider this light // (no need to consider light twice) if (resLights.find(lt) == resLights.end()) { resLights.insert(lt); @@ -501,12 +516,12 @@ } else { // Calc squared distance lt->tempSquareDist = (lt->getDerivedPosition() - position).squaredLength(); - + // only add in-range lights Real range = lt->getAttenuationRange(); - + Real maxDist = range + radius; - + if (lt->tempSquareDist <= Math::Sqr(maxDist)) { destList.push_back(lt); } @@ -514,10 +529,10 @@ } } } - - + + // the end is the same as in Ogre::SceneManager: - + // Sort (stable to guarantee ordering on directional lights) if (isShadowTechniqueTextureBased()) { // Note that if we're using texture shadows, we actually want to use @@ -533,75 +548,84 @@ std::stable_sort(destList.begin(), destList.end(), lightLess()); } } - + //----------------------------------------------------------------------- Entity *DarkSceneManager::createEntity(const String &entityName, const String &meshName) { Entity* e = SceneManager::createEntity(entityName, meshName); - + e->setListener(mBspTree); - + return e; } - + //----------------------------------------------------------------------- DarkGeometry *DarkSceneManager::createGeometry(const String& geomName) { DarkGeometryMap::iterator it = mDarkGeometryMap.find(geomName); - + if (it != mDarkGeometryMap.end()) { return it->second; } - + DarkGeometry* geom = new DarkGeometry(geomName, RENDER_QUEUE_WORLD_GEOMETRY_1); - + mDarkGeometryMap.insert(make_pair(geomName, geom)); - + return geom; } - + //----------------------------------------------------------------------- void DarkSceneManager::destroyGeometry(const String& name) { DarkGeometryMap::iterator it = mDarkGeometryMap.find(name); - + if (it != mDarkGeometryMap.end()) { DarkGeometry* g = it->second; mDarkGeometryMap.erase(it); delete g; } } - - + + //----------------------------------------------------------------------- DarkGeometry *DarkSceneManager::getGeometry(const String& name) { DarkGeometryMap::iterator it = mDarkGeometryMap.find(name); - + if (it != mDarkGeometryMap.end()) { return it->second; } - + // TODO: The damned NULL/Exception throw dilema all over again return NULL; } - + //----------------------------------------------------------------------- void DarkSceneManager::setActiveGeometry(const String& name) { mActiveGeometry = getGeometry(name); } - + //----------------------------------------------------------------------- void DarkSceneManager::setActiveGeometry(DarkGeometry* geom) { mActiveGeometry = geom; } - + //----------------------------------------------------------------------- bool DarkSceneManager::getOption(const String &strKey, void *pDestValue) { if (strKey == "StaticBuildTime") { *(static_cast<unsigned long*>(pDestValue)) = mStaticBuildTime; return true; + } else if (strKey == "FindVisibleObjectsTime") { + *(static_cast<unsigned long*>(pDestValue)) = mFindVisibleObjectsTime; + return true; + } else if (strKey == "LightListTime") { + *(static_cast<unsigned long*>(pDestValue)) = mLightListTime; + return true; + } else if (strKey == "SceneGraphTime") { + *(static_cast<unsigned long*>(pDestValue)) = mSceneGraphTime; + return true; } - + return SceneManager::getOption(strKey, pDestValue); } - + //----------------------------------------------------------------------- //----------------------------------------------------------------------- const String DarkSceneManagerFactory::FACTORY_TYPE_NAME = "DarkSceneManager"; Modified: trunk/src/scenemanager/DarkSceneManager.h =================================================================== --- trunk/src/scenemanager/DarkSceneManager.h 2008-11-20 09:43:33 UTC (rev 983) +++ trunk/src/scenemanager/DarkSceneManager.h 2008-11-20 09:44:34 UTC (rev 984) @@ -7,11 +7,11 @@ * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to @@ -21,8 +21,8 @@ * $Id$ * *****************************************************************************/ - - + + #ifndef __DARKSCENEMANAGER_H #define __DARKSCENEMANAGER_H @@ -35,34 +35,34 @@ namespace Ogre { - /** Portal + BSP based SceneManager targetted at DE based levels. + /** Portal + BSP based SceneManager targetted at DE based levels. * This SceneManager is targetted at scenes composed of great amount of convex cells connected with portals. * Each cell has to be a leaf node of the supplied Bsp node tree. Portals are created */ class OPDELIB_EXPORT DarkSceneManager : public SceneManager { // So we don't need to expose getBspTree() method to public friend class DarkCamera; friend class DarkLight; - + public: /// Constructor DarkSceneManager(const String& instanceName); - + /// Destructor ~DarkSceneManager(); - - /** Clears the scene. + + /** Clears the scene. * @note Delete's the current BSP tree and creates a new one */ virtual void clearScene(void); - - /** Creates a new portal from src to dst on a plane 'plane' + + /** Creates a new portal from src to dst on a plane 'plane' * @param src the source cell (leaf bsp node) to attach to * @param dst the destination cell (leaf bsp node) to attach to * @param plane the plane on which the portal should be placed * @return new portal instance (to be destroyed with destroyPortal call) * @note the returned portal has to be filled with points to be usable */ Portal* createPortal(BspNode* src, BspNode* dst, const Plane& plane); - + /** Creates a new portal from src to dst on a plane 'plane'. * @param src the source cell (leaf) ID to attach to * @param dst the destination cell (leaf) ID to attach to @@ -70,142 +70,151 @@ * @return new portal instance (to be destroyed with destroyPortal call) * @note the returned portal has to be filled with points to be usable */ Portal* createPortal(int srcLeafID, int dstLeafID, const Plane& plane); - + /** Destroys the given portal */ void destroyPortal(Portal* portal); - + /** Creates our specialized camera (DarkCamera) */ virtual Camera* createCamera(const String& name); - + /** Specialised scene graph update method. Update's the Camera's visible cell list if needed */ virtual void _updateSceneGraph(Camera* cam); - - /** creates a new BSP node + + /** creates a new BSP node * @param id the bsp node id - * @param leafID the id of the cell (leaf) - if >=0 then this BSP node is marked as leaf, and is registered as a cell with ID leafID + * @param leafID the id of the cell (leaf) - if >=0 then this BSP node is marked as leaf, and is registered as a cell with ID leafID */ BspNode* createBspNode(int id, int leafID = -1); - + /** gets a BSP node by id */ BspNode* getBspNode(int id); - + /** gets a BSP Leaf node by leaf id */ BspNode* getBspLeaf(int leafID); - + /** sets new root bsp node */ void setRootBspNode(int id); - + /// Specialized version of SceneNode creation. Creates DarkSceneNode instances virtual SceneNode* createSceneNode(void); - + /// Specialized version of SceneNode creation. Creates DarkSceneNode instances virtual SceneNode* createSceneNode(const String& name); - + /// Internal method that updates scenenode membership in BSP tree void _notifyObjectMoved(const MovableObject* mov, const Vector3& pos); - - /** Internal method, makes sure an object is removed from the leaves when detached from a node. */ + + /** Internal method, makes sure an object is removed from the leaves when detached from a node. */ void _notifyObjectDetached(const MovableObject* mov); - + /** Overriden visible object finder which only enlists the object found in Camera's visible cells */ virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters); - + /// Scene manager type name getter virtual const String& getTypeName(void) const; - + /// Specialized method for creating DarkLight objects virtual Light* createLight(const String& name); - + /// Specialized method for getting DarkLight objects virtual Light* getLight(const String& name); - + /// Specialized method for querying the existence of DarkLight objects virtual bool hasLight(const String& name); - + /// Specialized method for destroying DarkLight objects virtual void destroyLight(const String& name); - + /// Specialized method for destroying all DarkLight objects virtual void destroyAllLights(void); - + /// Queues a light to be included in the pre-render update /// @note Do call this method after manipulating the light's parameters void queueLightForUpdate(Light* l); - + /// Finds lights that are affecting the cells the camera sees virtual void findLightsAffectingFrustum(const Camera* camera); - - /** Populates a light list by looking into the BSP tree and getting all the lights from leaf nodes the MovableObject is in + + /** Populates a light list by looking into the BSP tree and getting all the lights from leaf nodes the MovableObject is in (customized to get use of caching of BSPTree) */ virtual void _populateLightList(const Vector3 &position, Real radius, LightList &destList); - + /** Overrided entity creation. Sets BspTree as the entity listener - this accelerates the population of the light lists */ virtual Entity *createEntity(const String &entityName, const String &meshName); - + // TODO: The DarkGeometry should probably have a factory /** Creates an instance of static geometry */ DarkGeometry *createGeometry(const String& geomName); - + /** destroys an instance of static geometry */ void destroyGeometry(const String& name); - + /** retrieves a pointer to existing static geometry */ DarkGeometry *getGeometry(const String& name); - + /** sets a geometry that will be active and rendered */ void setActiveGeometry(const String& name); - + /** sets the active geometry (NULL means no geom) */ void setActiveGeometry(DarkGeometry* g); - - /** gets an option from this scenemanager + + /** gets an option from this scenemanager * @param strKey the option name (valid options: StaticBuildTime - unsigned long) */ virtual bool getOption(const String &strKey, void *pDestValue); - + protected: /// BSP Tree getter BspTree* getBspTree(void) { return mBspTree; }; - + /// routine that updates dirty lights before rendering takes place void updateDirtyLights(); - + /// Internal method, which really queues the light void _queueLightForUpdate(Light* l); - + /// destroys all static geometries void destroyAllGeometries(void); - + /// The BSP tree currently used BspTree* mBspTree; - + typedef std::set<Portal*> PortalSet; - + PortalSet mPortals; - + typedef std::set<DarkLight*> LightSet; - + LightSet mLightsForUpdate; - + /// Current frame number - int mFrameNum; - + int mFrameNum; + /// Time it took to build the static geometry unsigned long mStaticBuildTime; + /// Time it took to find visible objects + unsigned long mFindVisibleObjectsTime; + + /// Time it took to populate light list + unsigned long mLightListTime; + + /// Time it took to update scene graph + unsigned long mSceneGraphTime; + /** movables found to be visible */ typedef std::set<const MovableObject*> MovablesForRendering; /** MovableObjects listed that will get inserted into the renderQueue */ // MovablesForRendering mMovablesForRendering; - + /** Factory for DarkLight objects */ DarkLightFactory *mDarkLightFactory; - + /** Map of dark geometry objects */ typedef std::map<String, DarkGeometry*> DarkGeometryMap; - + DarkGeometryMap mDarkGeometryMap; - + DarkGeometry* mActiveGeometry; }; @@ -216,16 +225,16 @@ public: DarkSceneManagerFactory() {} ~DarkSceneManagerFactory() {} - + /// Factory type name static const String FACTORY_TYPE_NAME; - + SceneManager* createInstance(const String& instanceName); - + void destroyInstance(SceneManager* instance); }; - + }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |