Public Member Functions | |
TerrainComponent (Entity *parent) | |
Constructor (default). | |
TerrainComponent (Entity *parent, const std::string &fileName, const vector3df &rotation=vector3df(0.0f, 0.0f, 0.0f), const vector3df &scale=vector3df(1.0f, 1.0f, 1.0f), const SColor &vertexColor=SColor(255, 255, 255, 255), s32 maxLOD=5, s32 smoothFactor=0) | |
Constructor. | |
~TerrainComponent () | |
Deconstructor. | |
ITerrainSceneNode * | getTerrainSceneNode () |
Returns a direct pointer to the ITerrainSceneNode. | |
const aabbox3df & | getBoundingBox () const |
Get the bounding box of the terrain. | |
const aabbox3df & | getBoundingBox (s32 patchX, s32 patchZ) const |
Gets the bounding box of a patch. | |
f32 | getHeight (f32 x, f32 y) |
Gets height of a point of the terrain. | |
IMesh * | getMesh () |
Returns the current mesh. | |
const vector3df & | getTerrainCenter () const |
Gets the center of the terrain. | |
bool | loadHeightMap (const std::string &fileName, const SColor &vertexColor=SColor(255, 255, 255, 255), s32 smoothFactor=0) |
Loads the data from a heightMapFile. | |
void | scaleTexture (f32 scale=1.0f, f32 scale2=0.0f) |
Scales the base texture. | |
Static Public Member Functions | |
static TerrainComponent * | refFactory (Entity *parent) |
Will be used to instanciate objects of this class. | |
static TerrainComponent * | refFactory (Entity *parent, const std::string &fileName, const vector3df &rotation, const vector3df &scale, const SColor &vertexColor, s32 maxLOD, s32 smoothFactor) |
Will be used to instanciate objects of this class. |
Definition at line 26 of file TerrainComponent.h.
TerrainComponent::TerrainComponent | ( | Entity * | parent | ) |
Constructor (default).
parent | The parent entity to which the component should be added. |
Definition at line 23 of file TerrainComponent.cpp.
TerrainComponent::TerrainComponent | ( | Entity * | parent, | |
const std::string & | fileName, | |||
const vector3df & | rotation = vector3df(0.0f, 0.0f, 0.0f) , |
|||
const vector3df & | scale = vector3df(1.0f, 1.0f, 1.0f) , |
|||
const SColor & | vertexColor = SColor(255, 255, 255, 255) , |
|||
s32 | maxLOD = 5 , |
|||
s32 | smoothFactor = 0 | |||
) |
Constructor.
parent | The parent entity to which the component should be added. | |
fileName | Filename of the heightmap to load. | |
rotation | The initial rotation of the component. | |
scale | The initial scale of the component. | |
vertexColor | The default color of all the vertices. | |
maxLOD | The maximum LOD (level of detail) for the component. | |
smoothFactor | The number of times the vertices are smoothed. |
Definition at line 42 of file TerrainComponent.cpp.
TerrainComponent::~TerrainComponent | ( | ) |
const aabbox3df & TerrainComponent::getBoundingBox | ( | s32 | patchX, | |
s32 | patchZ | |||
) | const |
const aabbox3df & TerrainComponent::getBoundingBox | ( | ) | const [virtual] |
Get the bounding box of the terrain.
Reimplemented from SceneComponent.
Definition at line 90 of file TerrainComponent.cpp.
f32 TerrainComponent::getHeight | ( | f32 | x, | |
f32 | y | |||
) |
IMesh * TerrainComponent::getMesh | ( | ) |
Returns the current mesh.
Definition at line 108 of file TerrainComponent.cpp.
const vector3df & TerrainComponent::getTerrainCenter | ( | ) | const |
ITerrainSceneNode * TerrainComponent::getTerrainSceneNode | ( | ) |
Returns a direct pointer to the ITerrainSceneNode.
Definition at line 84 of file TerrainComponent.cpp.
bool TerrainComponent::loadHeightMap | ( | const std::string & | fileName, | |
const SColor & | vertexColor = SColor(255, 255, 255, 255) , |
|||
s32 | smoothFactor = 0 | |||
) |
Loads the data from a heightMapFile.
fileName | Filename of the heightmap to load. | |
vertexColor | The default color of all the vertices. | |
smoothFactor | The number of times the vertices are smoothed. |
Definition at line 120 of file TerrainComponent.cpp.
TerrainComponent * TerrainComponent::refFactory | ( | Entity * | parent, | |
const std::string & | fileName, | |||
const vector3df & | rotation, | |||
const vector3df & | scale, | |||
const SColor & | vertexColor, | |||
s32 | maxLOD, | |||
s32 | smoothFactor | |||
) | [static] |
Will be used to instanciate objects of this class.
Definition at line 75 of file TerrainComponent.cpp.
TerrainComponent * TerrainComponent::refFactory | ( | Entity * | parent | ) | [static] |
Will be used to instanciate objects of this class.
Reimplemented from SceneComponent.
Definition at line 69 of file TerrainComponent.cpp.
void TerrainComponent::scaleTexture | ( | f32 | scale = 1.0f , |
|
f32 | scale2 = 0.0f | |||
) |
Scales the base texture.
scale | The scaling amount. Values above 1.0 increase the number of time the texture is drawn on the terrain. Values below 0 will decrease the number of times the texture is drawn on the terrain. Using negative values will flip the texture, as well as still scaling it. | |
scale2 | If set to 0 (default value), this will set the second texture coordinate set to the same values as in the first set. If this is another value than zero, it will scale the second texture coordinate set by this value. |
Definition at line 133 of file TerrainComponent.cpp.