1 | #ifndef _TERRAINCONTENTGENERATOR_H__
|
---|
2 | #define _TERRAINCONTENTGENERATOR_H__
|
---|
3 |
|
---|
4 | #include "OgreSceneContentGenerator.h"
|
---|
5 | //#include <Ogre.h>
|
---|
6 |
|
---|
7 | #define MAX_HEIGHT 5000 // maximal possible height for object position
|
---|
8 |
|
---|
9 | namespace Ogre {
|
---|
10 |
|
---|
11 | /** Class which executes a simple ray query.
|
---|
12 | */
|
---|
13 | class __declspec(dllexport) RayQueryExecutor
|
---|
14 | {
|
---|
15 | public:
|
---|
16 | RayQueryExecutor(SceneManager *sm);
|
---|
17 | ~RayQueryExecutor();
|
---|
18 |
|
---|
19 | bool executeRayQuery(Vector3 *result, const Vector3 &pos, const Vector3 &dir);
|
---|
20 | bool RayQueryExecutor::executeRayQuery( Vector3 *result, const Ray &ray);
|
---|
21 |
|
---|
22 | protected:
|
---|
23 | RaySceneQuery *mRaySceneQuery;
|
---|
24 | };
|
---|
25 |
|
---|
26 | /**
|
---|
27 | Thsi class used to fill a terrain with content,
|
---|
28 | e.g., it randomly fills a terrain with objects of a specific type.
|
---|
29 | */
|
---|
30 | class __declspec(dllexport) TerrainContentGenerator: public SceneContentGenerator
|
---|
31 | {
|
---|
32 | public:
|
---|
33 | TerrainContentGenerator(SceneManager *sm);
|
---|
34 | ~TerrainContentGenerator();
|
---|
35 |
|
---|
36 | /** Generates objects and places it on the terrain.
|
---|
37 | */
|
---|
38 | SceneNode *GenerateSceneObject(const Vector3 &position,
|
---|
39 | const Vector3 &rotation, const String &objName);
|
---|
40 | /** Generates objects and optionally places it on the terrain.
|
---|
41 | @param clampToTerrain if true, scene object is clamped to the terrain
|
---|
42 | */
|
---|
43 | SceneNode *GenerateSceneObject(const Vector3 &position,
|
---|
44 | const Vector3 &rotation, const String &objName, const bool clampToTerrain);
|
---|
45 |
|
---|
46 | /** The offset is added to objects when they are put into the terrain.
|
---|
47 | */
|
---|
48 | void SetOffset(Real offset);
|
---|
49 |
|
---|
50 | protected:
|
---|
51 | RayQueryExecutor *mRayQueryExecutor;
|
---|
52 | Real mOffset;
|
---|
53 | };
|
---|
54 |
|
---|
55 | } // namespace Ogre
|
---|
56 | #endif // _TERRAINCONTENTGENERATOR_H |
---|