#ifndef _SCENECONTENTGENERATOR_H__ #define _SCENECONTENTGENERATOR_H__ #include #include #include namespace Ogre { typedef std::vector SceneNodeList; typedef std::vector EntityList; /** Class which fills a scene with content in a random fashion. */ class __declspec(dllexport) SceneContentGenerator { public: SceneContentGenerator(SceneManager *sm); virtual ~SceneContentGenerator() {}; /** Generates scene object in a random fashion. @param number of objects to generate @param objName the name of the mesh to be generated */ void GenerateScene(int numObjects, const String &objName); /** Generates a new object in the scene using ray scene queries and inserts it into thr scene hierarchy. @param position position where the object is created @param rotation rotation angle applied locally to object @objName the name of the object entity @returns scene object if it was successfully created, NULL otherwise @remark internally stores pointer to object */ virtual SceneNode *GenerateSceneObject(const Vector3 &position, const Vector3 &rotation, const String &objName); /** Minimum angle for the random orientation. */ void SetMinAngle(Vector3 minAngle); /** Maximum angle for the random orientation. */ void SetMaxAngle(Vector3 maxAngle); /** Minimum possible random position. */ void SetMinPos(Vector3 minPos); /** Maximum possible random position. */ void SetMaxPos(Vector3 maxPos); /** Scale factor applied to each generated object. */ void SetScale(Vector3 scale); /** The number of created objects. */ int GetObjectCount(); /** Writes scene nodes to file. */ bool WriteObjects(const std::string &filename); /** Loads scene nodes from file. */ bool LoadObjects(const std::string &filename); /** Generates a scene object with the specified parameters @param position the position of the scene object @param orientation the orientation of the scene object @param objName the mesh name of the scene object @returns the created scene object */ SceneNode *GenerateSceneObject(const Vector3 &position, const Quaternion &orientation, const String &objName); /** Gets pointer to list of generated scene nodes. */ SceneNodeList *GetGeneratedSceneNodes(); /** Gets pointer to list of entities. */ EntityList *GetGeneratedEntities(); /** Removes generated object from scene graph. */ void RemoveGeneratedObjects(); protected: Vector3 mMinAngle; Vector3 mMaxAngle; Vector3 mMaxPos; Vector3 mMinPos; Vector3 mScale; SceneManager *mSceneMgr; SceneNodeList mSceneNodes; EntityList mEntities; }; } // namespace Ogre #endif // SCENECONTENTGENERATOR_H_