1 | #ifndef _SCENECONTENTGENERATOR_H__
|
---|
2 | #define _SCENECONTENTGENERATOR_H__
|
---|
3 |
|
---|
4 | #include <OgrePrerequisites.h>
|
---|
5 | #include <OgreMath.h>
|
---|
6 | #include <Ogre.h>
|
---|
7 |
|
---|
8 | namespace Ogre {
|
---|
9 |
|
---|
10 | /** Class which fills a scene with content in a random fashion.
|
---|
11 | */
|
---|
12 | class __declspec(dllexport) SceneContentGenerator
|
---|
13 | {
|
---|
14 | public:
|
---|
15 | SceneContentGenerator(SceneManager *sm);
|
---|
16 | virtual ~SceneContentGenerator() {};
|
---|
17 | /** Generates scene object in a random fashion.
|
---|
18 | @param number of objects to generate
|
---|
19 | @param objName the name of the mesh to be generated
|
---|
20 | */
|
---|
21 | void GenerateScene(int numObjects, const String &objName);
|
---|
22 | /** Generates a new object in the scene using ray scene queries |
---|
23 | and inserts it into thr scene hierarchy. |
---|
24 | @param position position where the object is created |
---|
25 | @param rotation rotation angle applied locally to object |
---|
26 | @objName the name of the object entity |
---|
27 | @returns scene object if it was successfully created, NULL otherwise |
---|
28 | @remark internally stores pointer to object |
---|
29 | */ |
---|
30 | virtual SceneNode *GenerateSceneObject(const Vector3 &position,
|
---|
31 | const Vector3 &rotation, const String &objName);
|
---|
32 |
|
---|
33 | void SetMinAngle(Vector3 minAngle);
|
---|
34 | void SetMaxAngle(Vector3 maxAngle);
|
---|
35 | void SetMinPos(Vector3 minPos);
|
---|
36 | void SetMaxPos(Vector3 maxPos);
|
---|
37 | void SetScale(Vector3 scale);
|
---|
38 |
|
---|
39 | /** The number of created objects */
|
---|
40 | int GetObjectCount();
|
---|
41 |
|
---|
42 | /** Writes scene nodes to file */
|
---|
43 | bool WriteObjects(const std::string &filename);
|
---|
44 |
|
---|
45 | /** Loads scene nodes from file */
|
---|
46 | bool LoadObjects(const std::string &filename);
|
---|
47 | /** Generates a scene object with the specified parameters
|
---|
48 | @param position the position of the scene object
|
---|
49 | @param orientation the orientation of the scene object
|
---|
50 | @param objName the mesh name of the scene object
|
---|
51 | @returns the created scene object
|
---|
52 | */
|
---|
53 | SceneNode *GenerateSceneObject(const Vector3 &position,
|
---|
54 | const Quaternion &orientation, const String &objName);
|
---|
55 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | Vector3 mMinAngle;
|
---|
59 | Vector3 mMaxAngle;
|
---|
60 | Vector3 mMaxPos;
|
---|
61 | Vector3 mMinPos;
|
---|
62 | Vector3 mScale;
|
---|
63 |
|
---|
64 | SceneManager *mSceneMgr;
|
---|
65 |
|
---|
66 | std::vector<SceneNode *> mSceneObjects;
|
---|
67 | };
|
---|
68 |
|
---|
69 | } // namespace Ogre
|
---|
70 |
|
---|
71 | #endif // SCENECONTENTGENERATOR_H_ |
---|