#include <infiniteterrain.h>

Public Member Functions | |
| InfiniteTerrain (const std::string &name="infiniteTerrain", osg::Image *textureImage=0) | |
| Constructor. | |
| void | Regenerate () |
| Regenerates the terrain surface. | |
| void | SetSegmentSize (float segmentSize) |
| Sets the size of the terrain segments. | |
| float | GetSegmentSize () const |
| Returns the size of the terrain segments. | |
| void | SetSegmentDivisions (int segmentDivisions) |
| Sets the number of divisions in each segment. | |
| int | GetSegmentDivisions () const |
| Returns the number of divisions in each segment. | |
| void | SetHorizontalScale (float horizontalScale) |
| Sets the horizontal scale, which affects the feature frequency. | |
| float | GetHorizontalScale () const |
| Returns the horizontal scale. | |
| void | SetVerticalScale (float verticalScale) |
| Sets the vertical scale, which affects the feature amplitude. | |
| float | GetVerticalScale () const |
| Returns the vertical scale. | |
| void | SetBuildDistance (float buildDistance) |
| Sets the build distance: the distance from the eyepoint for which terrain is guaranteed to be generated. | |
| float | GetBuildDistance () const |
| Returns the build distance. | |
| void | EnableSmoothCollisions (bool enable) |
| Enables or disables smooth collision detection (collision detection based on the underlying noise function, rather than the triangle mesh). | |
| bool | SmoothCollisionsEnabled () const |
| Checks whether smooth collision detection is enabled. | |
| float | GetHeight (float x, float y, bool smooth=false) |
| Determines the height of the terrain at the specified location. | |
| void | GetNormal (float x, float y, osg::Vec3 &normal, bool smooth=false) |
| Retrieves the normal of the terrain at the specified location. | |
| virtual bool | FilterContact (dContact *contact, Transformable *collider) |
| We want we collision to happen by default with this class. | |
| bool | IsClearLineOfSight (const osg::Vec3 &pointOne, const osg::Vec3 &pointTwo) |
| Given pointOne and pointTwo, both in world space and with all coordinates in Cartesian space (essentially in meters along X, Y and Z), returns true if there is a clear line of sight and false if the view is blocked. | |
| void | SetLineOfSightSpacing (float spacing) |
| Set the stepping distance to sample points for the line of sight calculation (meters). | |
| float | GetLineOfSightSpacing () const |
| void | SetMinColor (const osg::Vec3 &rgb) |
| Set the color used for low areas of the terrain. | |
| void | SetMaxColor (const osg::Vec3 &rgb) |
| Set the color used for high areas of the terrain. | |
Protected Member Functions | |
| virtual | ~InfiniteTerrain () |
| Destructor. | |
Friends | |
| class | InfiniteTerrainCallback |
Classes | |
| struct | Segment |
| Identifies a single terrain segment. | |
| dtCore::InfiniteTerrain::InfiniteTerrain | ( | const std::string & | name = "infiniteTerrain", |
|
| osg::Image * | textureImage = 0 | |||
| ) |
Constructor.
| name | the instance name | |
| textureImage | An image to apply to the terrain. The appearance of this texture will be effected by HighColor and LowColor | |
| name | the instance name | |
| textureImage | An image to apply to the terrain. |
| dtCore::InfiniteTerrain::~InfiniteTerrain | ( | ) | [protected, virtual] |
Destructor.
| void dtCore::InfiniteTerrain::Regenerate | ( | ) |
Regenerates the terrain surface.
| void dtCore::InfiniteTerrain::SetSegmentSize | ( | float | segmentSize | ) |
Sets the size of the terrain segments.
(def = 1000.0)
| segmentSize | the new segment size | |
| segmentSize | the new segment size |
| float dtCore::InfiniteTerrain::GetSegmentSize | ( | ) | const |
Returns the size of the terrain segments.
| void dtCore::InfiniteTerrain::SetSegmentDivisions | ( | int | segmentDivisions | ) |
Sets the number of divisions in each segment.
(def = 128)
| segmentDivisions | the new segment divisions | |
| segmentDivisions | the new segment divisions |
| int dtCore::InfiniteTerrain::GetSegmentDivisions | ( | ) | const |
Returns the number of divisions in each segment.
| void dtCore::InfiniteTerrain::SetHorizontalScale | ( | float | horizontalScale | ) |
Sets the horizontal scale, which affects the feature frequency.
(def = 0.01)
| horizontalScale | the new horizontal scale | |
| horizontalScale | the new horizontal scale |
| float dtCore::InfiniteTerrain::GetHorizontalScale | ( | ) | const |
Returns the horizontal scale.
| void dtCore::InfiniteTerrain::SetVerticalScale | ( | float | verticalScale | ) |
Sets the vertical scale, which affects the feature amplitude.
(def = 25.0)
| verticalScale | the new vertical scale | |
| verticalScale | the new vertical scale |
| float dtCore::InfiniteTerrain::GetVerticalScale | ( | ) | const |
Returns the vertical scale.
| void dtCore::InfiniteTerrain::SetBuildDistance | ( | float | buildDistance | ) |
Sets the build distance: the distance from the eyepoint for which terrain is guaranteed to be generated.
(def = 3000.0)
| buildDistance | the new build distance | |
| buildDistance | the new build distance |
| float dtCore::InfiniteTerrain::GetBuildDistance | ( | ) | const |
Returns the build distance.
| void dtCore::InfiniteTerrain::EnableSmoothCollisions | ( | bool | enable | ) |
Enables or disables smooth collision detection (collision detection based on the underlying noise function, rather than the triangle mesh).
| enable | true to enable, false to disable |
| bool dtCore::InfiniteTerrain::SmoothCollisionsEnabled | ( | ) | const |
Checks whether smooth collision detection is enabled.
| float dtCore::InfiniteTerrain::GetHeight | ( | float | x, | |
| float | y, | |||
| bool | smooth = false | |||
| ) |
Determines the height of the terrain at the specified location.
| x | the x coordinate to check | |
| y | the y coordinate to check | |
| smooth | if true, use height of underlying noise function instead of triangle mesh height |
| void dtCore::InfiniteTerrain::GetNormal | ( | float | x, | |
| float | y, | |||
| osg::Vec3 & | normal, | |||
| bool | smooth = false | |||
| ) |
Retrieves the normal of the terrain at the specified location.
| x | the x coordinate to check | |
| y | the y coordinate to check | |
| normal | the location at which to store the normal | |
| smooth | if true, use height of underlying noise function instead of triangle mesh height |
| virtual bool dtCore::InfiniteTerrain::FilterContact | ( | dContact * | contact, | |
| Transformable * | collider | |||
| ) | [inline, virtual] |
We want we collision to happen by default with this class.
Reimplemented from dtCore::Transformable.
| bool dtCore::InfiniteTerrain::IsClearLineOfSight | ( | const osg::Vec3 & | pointOne, | |
| const osg::Vec3 & | pointTwo | |||
| ) |
Given pointOne and pointTwo, both in world space and with all coordinates in Cartesian space (essentially in meters along X, Y and Z), returns true if there is a clear line of sight and false if the view is blocked.
| pointOne | The start point. | |
| pointTwo | The end point. |
| void dtCore::InfiniteTerrain::SetLineOfSightSpacing | ( | float | spacing | ) | [inline] |
Set the stepping distance to sample points for the line of sight calculation (meters).
Defaults to 25 meters.
| float dtCore::InfiniteTerrain::GetLineOfSightSpacing | ( | ) | const [inline] |
| void dtCore::InfiniteTerrain::SetMinColor | ( | const osg::Vec3 & | rgb | ) |
Set the color used for low areas of the terrain.
| rgb | The colour (0..255, 0..255, 0..255) of the low areas. |
| void dtCore::InfiniteTerrain::SetMaxColor | ( | const osg::Vec3 & | rgb | ) |
Set the color used for high areas of the terrain.
| rgb | The colour (0..255, 0..255, 0..255) of the high areas. |
friend class InfiniteTerrainCallback [friend] |