![]() |
Kochol Game Engine
0.1.0
|
#include <TileTerrain.h>
Public Member Functions | |
TileTerrain () | |
Constructor. | |
virtual | ~TileTerrain () |
Destructor. | |
virtual void | PreRender (float elapsedTime=0.0f) |
Karhayee ke Ghabl az render bayad anjam shvad. Mesle colision detection. | |
virtual void | Render () |
Render the terrain. | |
virtual void | PostRender () |
Karhaee ke bad az render bayad anjam beshe. | |
virtual bool | AddEffect (efx::EffectType p, efx::Effect **ppOut) |
virtual void | Draw (bool WithMaterial, bool WithTransform, bool bPosition, bool bNormalTexcoord, bool bTangentBinormal) |
virtual void | ReCreate (int numCols, int numRows, float MinHeight=0.0f, float MaxHeight=0.0f) |
Creates a tile based terrain with the given size. | |
void | SetTileTexture (gfx::TileTexture *pTileTex) |
Sets the tile texture. | |
void | SetNormalMapTileTexture (gfx::TileTexture *pTileTex) |
Sets the tile texture. | |
gfx::TileTexture * | GetTileTexture () |
Returns the tile texture pointer then you can modify it directly. | |
virtual void | SetTile (int Col, int Row, u32 TileID) |
Sets the tile in the terrain. | |
void | SetTiles (u32 tileID) |
Sets the tiles. | |
void | Blend (int Col, int Row) |
Blend the tile stored in the given position and their same tiles attached to it. | |
void | Fill (int Col, int Row, int TileID) |
Fill the terrain with the given tile ID. | |
float | GetHeight (float x, float z) |
Returns the terrain height at the given grid position. | |
void | SetHeight (int IndexID, float h) |
Sets the terrain height by the index id. | |
void | SetHeight (int Col, int Row, float h) |
Sets the terrain height by the tile position. | |
void | SetVertexColor (int IndexID, gfx::Color c) |
Sets the terrain color by the index id. | |
void | SetVertexColor (int Col, int Row, gfx::Color c) |
Sets the terrain color by the tile position. | |
void | SetHeightAdd (int IndexID, float h) |
Adds the terrain height by the index id. | |
void | SetHeightAdd (int Col, int Row, float h) |
Adds the terrain height by the tile position. | |
void | Smooth (int Col, int Row) |
Smooths the tile height. | |
void | SmoothOneNode (int Col, int Row) |
Smooths one node height. | |
math::Vector2I | GetTileByFaceID (int FaceID) |
Gets the column number and row number by Face index. | |
gfx::Vertex3 * | GetPositions () |
Returns the terrain position vertices. | |
void | GetYs (float *inArray) |
Create an array of Y position vertices and return. | |
void | SetYs (float *pHeights) |
Sets the heights. | |
int | GetTiles (int *pTiles1, int *pTiles2) |
Returns the tile count if you pass the NULL and set them otherwise. | |
void | SetTiles (int *pTiles1, int *pTiles2) |
Sets the tiles. | |
int | GetBlendMap (u8 *pBlendMap) |
Returns blend map size if you pass NULL and set the pointer otherwise. | |
void | SetBlendMap (u8 *pBlendMap) |
Sets the blend map. | |
void | GetVertexColors (ul32 *pVertexColor) |
Copy the vertex colors to the pointer. | |
void | SetVertexColors (ul32 *pVertexColor) |
Copy the vertex colors from the pointer. | |
int | GetVertexCount () |
Returns the count of the vertexes. | |
u32 * | GetIndices () |
Returns the terrain indexes. | |
int | GetIndexesCount () |
Returns the terrain indexes count. | |
ph::DynamicTriangleMesh * | GetDynamicTriangleMesh () |
Returns the DynamicTriangleMesh pointer. | |
void | SetDynamicTriangleMesh (ph::DynamicTriangleMesh *pDTM) |
Returns the DynamicTriangleMesh pointer and send updates to it if needed. | |
void | UpdateNormals () |
Recalculate the terrain normals. | |
int | GetAABBcount () |
Return the number of AABB that splited the terrain. | |
math::AABB * | GetAABBs () |
Returns the AABBs array pointer. | |
int | GetUcount () |
Returns the number of ... in U. | |
int | GetVcount () |
Returns the number of ... in V. | |
Decal * | CreateDecal (int sizeX, int sizeY, gfx::Texture *pTex) |
Create a decal and return its pointer. | |
void | SetDecal (float fx, float fy, Decal *pDecal) |
Sets the decal on position. | |
virtual u32 | GetMaterialCount () |
Get the count of materials this terrain has. always returns 1. | |
virtual gfx::Material * | GetMaterial (u32 Index) |
Get the terrain material. | |
virtual void | CreateShaderCode (core::String &VertexCode, core::String &PixelCode) |
Creates the terrain shader code. | |
void | EnableWater (bool Enable, const gfx::Colorf &cStart=gfx::Colorf(255, 255, 255), const gfx::Colorf &cEnd=gfx::Colorf(0, 229, 255)) |
Enables the under water vertex coloring effect. | |
void | SetCaustics (gfx::Texture **ppTextures, int TexturesCount, int speed=100) |
Enable and sets the caustics textures. | |
void | SetBlendMap (gfx::Texture *pTexture) |
Sets the Blend Map. | |
void | ReceiveShadow (const char *Code, math::Matrix *shadowmat) |
Sets the shadow receiver params. | |
int | GetColumnsCount () |
Returns the columns count. | |
int | GetRowsCount () |
Returns the rows count. | |
void | RenderDecals () |
Render decals. | |
void | RemoveDecal (Decal *pDecal) |
Empty space in vertex buffer. | |
void | OnLost () |
void | OnReset () |
Refills vertex and index buffers after reseting device. | |
void | RecreateShaders () |
![]() | |
SceneNode () | |
Constructor. | |
virtual | ~SceneNode () |
Destructor. | |
virtual void | AddChild (SceneNode *child) |
Adds a node as child. | |
virtual void | SetSceneManager (SceneManager *smgr) |
Sets the scene manager and renderer pointer. | |
virtual void | SetPosition (const math::Vector &v) |
Set the position of the scenenode. | |
virtual void | SetRotation (const math::Vector &v) |
Set the rotation of the scenenode. | |
virtual void | SetScale (const math::Vector &v) |
Set the scale of the scenenode. | |
virtual void | SetAutomaticCulling (bool isTrue) |
Set Cutting Enable or Disable. | |
virtual void | SetVisible (bool isVisible) |
Set Visible Enable or Disable. | |
virtual bool | GetVisible () |
Get Visible. | |
virtual bool | IsVisibleInFrame () |
Is it visible in this frame? | |
virtual const math::Vector & | GetPosition () const |
Returns the node position. | |
virtual const math::Vector & | GetRotation () const |
Returns the node rotation. | |
virtual const math::Vector & | GetScale () const |
Returns the node scale. | |
virtual math::Matrix * | GetAbsoluteMatrix () const |
Get the absolute matrix. | |
virtual math::Matrix * | GetFinalMatrix () |
Get the final matrix. | |
virtual math::Sphere * | GetBoundingBox () |
Returns the node bounding box. | |
virtual math::AABB * | GetAxisAlignedBoundingBox () |
Returns the node Axis aligned bounding box. | |
virtual NodeType | GetType () const |
Returns the node type. | |
virtual void | RemoveChild (SceneNode *child) |
virtual void | RemoveChildren () |
Removes all children of this node. | |
virtual const SceneNode * | GetParent () |
Returns the node parent. | |
virtual void | SetParent (SceneNode *parent) |
Sets the node parent. | |
virtual void | SetName (const char *name) |
Sets the node name. | |
virtual core::String * | GetName () |
Gets the node name. | |
virtual void | SetID (int ID) |
Sets the node ID. | |
virtual int | GetID () |
Gets the node ID. | |
void | EnableShadow (bool enable) |
bool | HasShadow () const |
virtual void | UpdateFinalMat () |
Update final matrix. | |
![]() | |
KgeUnknown () | |
Constructor. | |
virtual | ~KgeUnknown () |
Destructor. | |
virtual void | AddRef () |
Add a reference to the object. | |
virtual void | DecRef () |
Decrease a reference from the object. if its reference count get 0 then the object will destroy. | |
u32 | GetRefCount () |
Return resource reference count. | |
const char * | GetDebugText () |
returns the instance debug text. |
Public Attributes | |
gfx::Shader * | m_pVshader |
Shaders. | |
gfx::Shader * | m_pPshader |
Protected Member Functions | |
void | Flood_Fill (int Col, int Row, int TileID) |
void | Flood_Fill (int Col, int Row, int ReplaceID, int TileID) |
void | SetTile (int Col, int Row, int TileID, int TileID2) |
virtual void | SetShaderParams () |
virtual void | userSetShaderParams () |
void | SetDecalShaderParams (gfx::ShaderInstance *pSI) |
![]() | |
virtual bool | HasThisEffect (efx::EffectType p) |
![]() | |
void | SetDebugText (char *text) |
Definition at line 63 of file TileTerrain.h.
kge::sn::TileTerrain::TileTerrain | ( | ) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Ezafe kardane effect be hamin gereh.
p | Effecti ke mikhahid ezafe konid. |
ppOut | Class Effect sakhte shode. |
Reimplemented from kge::sn::SceneNode.
void kge::sn::TileTerrain::Blend | ( | int | Col, |
int | Row | ||
) |
Blend the tile stored in the given position and their same tiles attached to it.
Decal* kge::sn::TileTerrain::CreateDecal | ( | int | sizeX, |
int | sizeY, | ||
gfx::Texture * | pTex | ||
) |
Create a decal and return its pointer.
|
virtual |
Creates the terrain shader code.
Reimplemented in kge::sn::TileTerrain2.
|
virtual |
Draw the node with/without its Materials and Transforms.
WithMaterial | Draw it with its own materials or not? |
WithMaterial | Draw it with its own Transformations or not? |
Implements kge::sn::SceneNode.
void kge::sn::TileTerrain::EnableWater | ( | bool | Enable, |
const gfx::Colorf & | cStart = gfx::Colorf(255, 255, 255) , |
||
const gfx::Colorf & | cEnd = gfx::Colorf(0, 229, 255) |
||
) |
Enables the under water vertex coloring effect.
void kge::sn::TileTerrain::Fill | ( | int | Col, |
int | Row, | ||
int | TileID | ||
) |
Fill the terrain with the given tile ID.
|
protected |
|
protected |
|
inline |
Return the number of AABB that splited the terrain.
Definition at line 195 of file TileTerrain.h.
|
inline |
Returns the AABBs array pointer.
Definition at line 198 of file TileTerrain.h.
int kge::sn::TileTerrain::GetBlendMap | ( | u8 * | pBlendMap | ) |
Returns blend map size if you pass NULL and set the pointer otherwise.
|
inline |
Returns the columns count.
Definition at line 235 of file TileTerrain.h.
|
inline |
Returns the DynamicTriangleMesh pointer.
Definition at line 186 of file TileTerrain.h.
float kge::sn::TileTerrain::GetHeight | ( | float | x, |
float | z | ||
) |
Returns the terrain height at the given grid position.
|
inline |
Returns the terrain indexes count.
Definition at line 183 of file TileTerrain.h.
|
inline |
Returns the terrain indexes.
Definition at line 180 of file TileTerrain.h.
|
inlinevirtual |
Get the terrain material.
Reimplemented from kge::sn::SceneNode.
Definition at line 216 of file TileTerrain.h.
|
inlinevirtual |
Get the count of materials this terrain has. always returns 1.
Reimplemented from kge::sn::SceneNode.
Definition at line 213 of file TileTerrain.h.
|
inline |
Returns the terrain position vertices.
Definition at line 150 of file TileTerrain.h.
|
inline |
Returns the rows count.
Definition at line 238 of file TileTerrain.h.
math::Vector2I kge::sn::TileTerrain::GetTileByFaceID | ( | int | FaceID | ) |
Gets the column number and row number by Face index.
int kge::sn::TileTerrain::GetTiles | ( | int * | pTiles1, |
int * | pTiles2 | ||
) |
Returns the tile count if you pass the NULL and set them otherwise.
|
inline |
Returns the tile texture pointer then you can modify it directly.
Definition at line 105 of file TileTerrain.h.
|
inline |
Returns the number of ... in U.
Definition at line 201 of file TileTerrain.h.
|
inline |
Returns the number of ... in V.
Definition at line 204 of file TileTerrain.h.
void kge::sn::TileTerrain::GetVertexColors | ( | ul32 * | pVertexColor | ) |
Copy the vertex colors to the pointer.
|
inline |
Returns the count of the vertexes.
Definition at line 177 of file TileTerrain.h.
void kge::sn::TileTerrain::GetYs | ( | float * | inArray | ) |
Create an array of Y position vertices and return.
void kge::sn::TileTerrain::OnLost | ( | ) |
void kge::sn::TileTerrain::OnReset | ( | ) |
Refills vertex and index buffers after reseting device.
|
virtual |
Karhaee ke bad az render bayad anjam beshe.
Implements kge::sn::SceneNode.
|
virtual |
Karhayee ke Ghabl az render bayad anjam shvad. Mesle colision detection.
Implements kge::sn::SceneNode.
void kge::sn::TileTerrain::ReceiveShadow | ( | const char * | Code, |
math::Matrix * | shadowmat | ||
) |
Sets the shadow receiver params.
|
virtual |
Creates a tile based terrain with the given size.
Reimplemented in kge::sn::TileTerrain2.
void kge::sn::TileTerrain::RecreateShaders | ( | ) |
void kge::sn::TileTerrain::RemoveDecal | ( | Decal * | pDecal | ) |
Empty space in vertex buffer.
|
virtual |
void kge::sn::TileTerrain::RenderDecals | ( | ) |
Render decals.
void kge::sn::TileTerrain::SetBlendMap | ( | u8 * | pBlendMap | ) |
Sets the blend map.
|
inline |
Sets the Blend Map.
Definition at line 229 of file TileTerrain.h.
void kge::sn::TileTerrain::SetCaustics | ( | gfx::Texture ** | ppTextures, |
int | TexturesCount, | ||
int | speed = 100 |
||
) |
Enable and sets the caustics textures.
void kge::sn::TileTerrain::SetDecal | ( | float | fx, |
float | fy, | ||
Decal * | pDecal | ||
) |
Sets the decal on position.
|
protected |
void kge::sn::TileTerrain::SetDynamicTriangleMesh | ( | ph::DynamicTriangleMesh * | pDTM | ) |
Returns the DynamicTriangleMesh pointer and send updates to it if needed.
void kge::sn::TileTerrain::SetHeight | ( | int | IndexID, |
float | h | ||
) |
Sets the terrain height by the index id.
void kge::sn::TileTerrain::SetHeight | ( | int | Col, |
int | Row, | ||
float | h | ||
) |
Sets the terrain height by the tile position.
void kge::sn::TileTerrain::SetHeightAdd | ( | int | IndexID, |
float | h | ||
) |
Adds the terrain height by the index id.
void kge::sn::TileTerrain::SetHeightAdd | ( | int | Col, |
int | Row, | ||
float | h | ||
) |
Adds the terrain height by the tile position.
void kge::sn::TileTerrain::SetNormalMapTileTexture | ( | gfx::TileTexture * | pTileTex | ) |
Sets the tile texture.
|
protectedvirtual |
|
virtual |
Sets the tile in the terrain.
Reimplemented in kge::sn::TileTerrain2.
|
protected |
void kge::sn::TileTerrain::SetTiles | ( | u32 | tileID | ) |
Sets the tiles.
void kge::sn::TileTerrain::SetTiles | ( | int * | pTiles1, |
int * | pTiles2 | ||
) |
Sets the tiles.
void kge::sn::TileTerrain::SetTileTexture | ( | gfx::TileTexture * | pTileTex | ) |
Sets the tile texture.
void kge::sn::TileTerrain::SetVertexColor | ( | int | IndexID, |
gfx::Color | c | ||
) |
Sets the terrain color by the index id.
void kge::sn::TileTerrain::SetVertexColor | ( | int | Col, |
int | Row, | ||
gfx::Color | c | ||
) |
Sets the terrain color by the tile position.
void kge::sn::TileTerrain::SetVertexColors | ( | ul32 * | pVertexColor | ) |
Copy the vertex colors from the pointer.
void kge::sn::TileTerrain::SetYs | ( | float * | pHeights | ) |
Sets the heights.
void kge::sn::TileTerrain::Smooth | ( | int | Col, |
int | Row | ||
) |
Smooths the tile height.
void kge::sn::TileTerrain::SmoothOneNode | ( | int | Col, |
int | Row | ||
) |
Smooths one node height.
void kge::sn::TileTerrain::UpdateNormals | ( | ) |
Recalculate the terrain normals.
|
inlineprotectedvirtual |
Reimplemented in kge::sn::TileTerrain2.
Definition at line 371 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 318 of file TileTerrain.h.
|
protected |
Definition at line 337 of file TileTerrain.h.
|
protected |
Normal lines color.
Definition at line 277 of file TileTerrain.h.
|
protected |
Definition at line 337 of file TileTerrain.h.
|
protected |
Definition at line 289 of file TileTerrain.h.
|
protected |
Tile width and height size.
Definition at line 289 of file TileTerrain.h.
|
protected |
Definition at line 289 of file TileTerrain.h.
|
protected |
Definition at line 289 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Count.
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
|
protected |
Definition at line 295 of file TileTerrain.h.
Definition at line 360 of file TileTerrain.h.
|
protected |
Definition at line 334 of file TileTerrain.h.
|
protected |
Definition at line 286 of file TileTerrain.h.
|
protected |
Definition at line 308 of file TileTerrain.h.
|
protected |
Definition at line 355 of file TileTerrain.h.
|
protected |
Dynamic Triangle Mesh class pointer.
Definition at line 345 of file TileTerrain.h.
|
protected |
Indices.
Definition at line 280 of file TileTerrain.h.
|
protected |
Material.
Definition at line 348 of file TileTerrain.h.
|
protected |
Definition at line 271 of file TileTerrain.h.
|
protected |
Definition at line 341 of file TileTerrain.h.
|
protected |
Normal lines.
Definition at line 274 of file TileTerrain.h.
|
protected |
Definition at line 269 of file TileTerrain.h.
|
protected |
Definition at line 330 of file TileTerrain.h.
|
protected |
Vertices.
Definition at line 268 of file TileTerrain.h.
|
protected |
Definition at line 351 of file TileTerrain.h.
gfx::Shader * kge::sn::TileTerrain::m_pPshader |
Definition at line 256 of file TileTerrain.h.
|
protected |
Definition at line 327 of file TileTerrain.h.
|
protected |
Shadow code.
Definition at line 326 of file TileTerrain.h.
|
protected |
Definition at line 333 of file TileTerrain.h.
|
protected |
Terrain Texture ID for storing the tile data.
Definition at line 332 of file TileTerrain.h.
|
protected |
Tile infos.
Definition at line 283 of file TileTerrain.h.
|
protected |
Definition at line 283 of file TileTerrain.h.
|
protected |
Definition at line 285 of file TileTerrain.h.
|
protected |
Tile texture pointer.
Definition at line 341 of file TileTerrain.h.
|
protected |
Decal shader.
Definition at line 351 of file TileTerrain.h.
gfx::Shader* kge::sn::TileTerrain::m_pVshader |
Shaders.
Definition at line 256 of file TileTerrain.h.
|
protected |
Definition at line 357 of file TileTerrain.h.
|
protected |
Definition at line 356 of file TileTerrain.h.
|
protected |
Definition at line 311 of file TileTerrain.h.
|
protected |
Definition at line 311 of file TileTerrain.h.
|
protected |
Definition at line 311 of file TileTerrain.h.
|
protected |
Definition at line 311 of file TileTerrain.h.
|
protected |
Definition at line 311 of file TileTerrain.h.
|
protected |
Terrain data.
Definition at line 262 of file TileTerrain.h.
|
protected |
Visible parts.
Definition at line 265 of file TileTerrain.h.