1 | /**
|
---|
2 | \file
|
---|
3 | TerrainContentGenerator.h
|
---|
4 | */
|
---|
5 | #include "ExampleApplication.h"
|
---|
6 |
|
---|
7 | /** Class which executes a simple ray query.
|
---|
8 | */
|
---|
9 | class RayQueryExecutor
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | RayQueryExecutor(SceneManager *sm);
|
---|
13 | ~RayQueryExecutor();
|
---|
14 |
|
---|
15 | bool executeRayQuery(Vector3 *result, const Vector3 &pos, const Vector3 &dir);
|
---|
16 | bool RayQueryExecutor::executeRayQuery( Vector3 *result, const Ray &ray);
|
---|
17 |
|
---|
18 | protected:
|
---|
19 | RaySceneQuery *mRaySceneQuery;
|
---|
20 | };
|
---|
21 | /** Class which fills a terrain with content in a random way.
|
---|
22 | */
|
---|
23 | class TerrainContentGenerator
|
---|
24 | {
|
---|
25 | public:
|
---|
26 | TerrainContentGenerator(SceneManager *sm, RayQueryExecutor *rayQueryEx);
|
---|
27 | /** Generates a the scene hierarchy with random values .
|
---|
28 | @param number of objects to generate
|
---|
29 | */
|
---|
30 | void generateScene(int numObjects);
|
---|
31 | /** Generates a new scene object |
---|
32 | @param tranlationRatio ratio between minimal and maximal possible translation |
---|
33 | @param rotationRatio ratio between minimal and maximal possible rotation |
---|
34 | @idx the index of the new object |
---|
35 | @entName the name of the object entity |
---|
36 | */ |
---|
37 | void generateSceneObject(const Vector3 &translationRatio, const Vector3 &rotationRatio,
|
---|
38 | const int idx, const String &entName);
|
---|
39 |
|
---|
40 | protected:
|
---|
41 |
|
---|
42 | Real mMinAngle;
|
---|
43 | Real mMaxAngle;
|
---|
44 | Vector3 mMaxPos;
|
---|
45 | Vector3 mMinPos;
|
---|
46 |
|
---|
47 | RayQueryExecutor *mRayQueryExecutor;
|
---|
48 | SceneManager *mSceneMgr;
|
---|
49 | int mCount; // The number of objects on the screen
|
---|
50 | };
|
---|
51 |
|
---|