#ifndef _TERRAINCONTENTGENERATOR_H__ #define _TERRAINCONTENTGENERATOR_H__ #include "OgreSceneContentGenerator.h" #define MAX_HEIGHT 5000 // maximal possible height for object position namespace Ogre { /** Class which executes a simple ray query. */ class __declspec(dllexport) RayQueryExecutor { public: RayQueryExecutor(SceneManager *sm); ~RayQueryExecutor(); bool executeRayQuery(Vector3 *result, const Vector3 &pos, const Vector3 &dir); bool RayQueryExecutor::executeRayQuery( Vector3 *result, const Ray &ray); protected: RaySceneQuery *mRaySceneQuery; }; /** This class used to fill a terrain with content, e.g., it randomly fills a terrain with objects of a specific type. */ class __declspec(dllexport) TerrainContentGenerator: public SceneContentGenerator { public: TerrainContentGenerator(SceneManager *sm); ~TerrainContentGenerator(); /** Generates objects and places it on the terrain. */ SceneNode *GenerateSceneObject(const Vector3 &position, const Vector3 &rotation, const String &objName); /** Generates objects and optionally places it on the terrain. @param clampToTerrain if true, scene object is clamped to the terrain */ SceneNode *GenerateSceneObject(const Vector3 &position, const Vector3 &rotation, const String &objName, const bool clampToTerrain); /** The offset is added to objects when they are put into the terrain. */ void SetOffset(Real offset); protected: RayQueryExecutor *mRayQueryExecutor; Real mOffset; }; } // namespace Ogre #endif // _TERRAINCONTENTGENERATOR_H