TerrainComponent Class Reference

Component wrapper of Irrlicht's ITerrainSceneNode. More...

Inheritance diagram for TerrainComponent:

Inheritance graph
[legend]
Collaboration diagram for TerrainComponent:

Collaboration graph
[legend]

List of all members.

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 TerrainComponentrefFactory (Entity *parent)
 Will be used to instanciate objects of this class.
static TerrainComponentrefFactory (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.


Detailed Description

Component wrapper of Irrlicht's ITerrainSceneNode.

Definition at line 26 of file TerrainComponent.h.


Constructor & Destructor Documentation

TerrainComponent::TerrainComponent ( Entity parent  ) 

Constructor (default).

Parameters:
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.

Parameters:
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 (  ) 

Deconstructor.

Definition at line 62 of file TerrainComponent.cpp.


Member Function Documentation

const aabbox3df & TerrainComponent::getBoundingBox ( s32  patchX,
s32  patchZ 
) const

Gets the bounding box of a patch.

Definition at line 96 of file TerrainComponent.cpp.

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 
)

Gets height of a point of the terrain.

Definition at line 102 of file TerrainComponent.cpp.

IMesh * TerrainComponent::getMesh (  ) 

Returns the current mesh.

Note:
Not available in AngelScript.

Definition at line 108 of file TerrainComponent.cpp.

const vector3df & TerrainComponent::getTerrainCenter (  )  const

Gets the center of the terrain.

Definition at line 114 of file TerrainComponent.cpp.

ITerrainSceneNode * TerrainComponent::getTerrainSceneNode (  ) 

Returns a direct pointer to the ITerrainSceneNode.

Note:
Not available in AngelScript.

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.

Parameters:
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.

Note:
For internal use only!

Definition at line 75 of file TerrainComponent.cpp.

TerrainComponent * TerrainComponent::refFactory ( Entity parent  )  [static]

Will be used to instanciate objects of this class.

Note:
For internal use only!

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.

Parameters:
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.


The documentation for this class was generated from the following files:

Generated on Wed Jun 10 22:26:27 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8