Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

sp::scene::Terrain Class Reference

#include <spSceneTerrain.hpp>

Inheritance diagram for sp::scene::Terrain:
sp::scene::MaterialNode sp::scene::RenderNode sp::scene::SceneNode sp::Node sp::BaseObject

List of all members.

Classes

struct  STreeNodeData

Public Member Functions

 Terrain (const video::SHeightMapTexture &HeightMap, const dim::size2di &Resolution, s32 GeoMIPLevels)
virtual ~Terrain ()
virtual void render ()
void changeHeightMap (const video::SHeightMapTexture &HeightMap, const dim::size2di &Resolution, s32 GeoMIPLevels)
dim::size2di getResolution () const
video::MeshBuffergetTextureReferenceMesh ()

Protected Member Functions

void init ()
void clear ()
void createQuadTree (QuadTreeNode *Node, s32 &MIPLevel, dim::point2di CurPos)
void createTreeNodeMesh (QuadTreeNode *Node, STreeNodeData *NodeData, const dim::point2di &CurPos)
void selectTreeNodeMesh (QuadTreeNode *Node)
void renderTreeNodeMesh (QuadTreeNode *Node)
bool deformTreeNodeMesh (QuadTreeNode *Node, const dim::point2df &Pos)
s32 getNodeLevel (const QuadTreeNode *Node, const dim::point2df &Pos)
s32 getVertexIndex (s32 x, s32 y) const
bool checkFurstumCulling (const scene::ViewFrustum &Frustum, const dim::matrix4f &Transformation, const dim::aabbox3df &BoundBox) const

Protected Attributes

video::SHeightMapTexture HeightMap_
dim::size2di Resolution_
dim::size2di MeshResolution_
s32 GeoMIPLevels_
QuadTreeNodeRootTreeNode_
video::MeshBufferMeshTexReference_
s32 RenderModeListSize_
std::vector< QuadTreeNode * > RenderNodeList_
dim::matrix4f GlobalTerrainTransformation_
dim::vector3df GlobalCamPosition_

Friends

void clbTerrainTreeNodeDestructor (TreeNode *Node)

Detailed Description

Terrain class assumes the work of mesh LOD (level-of-detail) for the model-patches. Used are quad-trees.


Constructor & Destructor Documentation

sp::scene::Terrain::Terrain ( const video::SHeightMapTexture HeightMap,
const dim::size2di Resolution,
s32  GeoMIPLevels 
)
sp::scene::Terrain::~Terrain (  )  [virtual]

Member Function Documentation

void sp::scene::Terrain::changeHeightMap ( const video::SHeightMapTexture HeightMap,
const dim::size2di Resolution,
s32  GeoMIPLevels 
)
bool sp::scene::Terrain::checkFurstumCulling ( const scene::ViewFrustum Frustum,
const dim::matrix4f Transformation,
const dim::aabbox3df BoundBox 
) const [inline, protected]
void sp::scene::Terrain::clear (  )  [protected]
void sp::scene::Terrain::createQuadTree ( QuadTreeNode Node,
s32 MIPLevel,
dim::point2di  CurPos 
) [protected]
void sp::scene::Terrain::createTreeNodeMesh ( QuadTreeNode Node,
STreeNodeData NodeData,
const dim::point2di CurPos 
) [protected]
bool sp::scene::Terrain::deformTreeNodeMesh ( QuadTreeNode Node,
const dim::point2df Pos 
) [protected]
s32 sp::scene::Terrain::getNodeLevel ( const QuadTreeNode Node,
const dim::point2df Pos 
) [protected]
dim::size2di sp::scene::Terrain::getResolution (  )  const [inline]
video::MeshBuffer* sp::scene::Terrain::getTextureReferenceMesh (  )  [inline]
s32 sp::scene::Terrain::getVertexIndex ( s32  x,
s32  y 
) const [inline, protected]
void sp::scene::Terrain::init (  )  [protected]
void sp::scene::Terrain::render (  )  [virtual]

Renders the object. In this case rendering does not only mean drawing a 3d mesh. It can also be a light source.

Returns:
True if the object has been rendered. Otherwise the object has been sorted out by frustum culling.

Implements sp::scene::MaterialNode.

void sp::scene::Terrain::renderTreeNodeMesh ( QuadTreeNode Node  )  [protected]
void sp::scene::Terrain::selectTreeNodeMesh ( QuadTreeNode Node  )  [protected]

Friends And Related Function Documentation

void clbTerrainTreeNodeDestructor ( TreeNode Node  )  [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines