#include <mod_sim_terrain_tile.hh>
Public Member Functions | |
| TileFactory (void) | |
| ~TileFactory () | |
| void | Populate (const BoxVolume &quadrantBoxVolume, SharedPtr< Heightmap > heightmap) |
Private Types | |
| enum | { TRI0_VIX0_LAT = 0, TRI0_VIX0_LON = 0, TRI0_VIX1_LAT = 1, TRI0_VIX1_LON = 0, TRI0_VIX2_LAT = 0, TRI0_VIX2_LON = 1, TRI1_VIX0_LAT = 1, TRI1_VIX0_LON = 0, TRI1_VIX1_LAT = 1, TRI1_VIX1_LON = 1, TRI1_VIX2_LAT = 0, TRI1_VIX2_LON = 1 } |
Private Member Functions | |
| void | Reset (void) |
| void | MakeTile (void) |
| void | MakeLocalVertexs (void) |
| void | MakeNormals (void) |
| void | MakeTexture (void) |
| void | MakeTriangles (void) |
| void | MakeTrianglesTexCoords (const fp worldLat, const fp worldLon) |
| void | MakeTileObject (void) |
| NormalVertex | ComputePolygonNormalOfTriangle0 (const fp worldLat, const fp worldLon) |
| NormalVertex | ComputePolygonNormalOfTriangle1 (const fp worldLat, const fp worldLon) |
| NormalVertex | ComputeVertexNormal (const fp worldLat, const fp worldLon) |
Private Attributes | |
| CLASS_VAR uint | msMedianHeight |
| median height tracked for every Heightmap | |
| TileArgs | mTileArgs |
| shptr< Heightmap > | mHeightmap |
| Heightmap correlating to box volume. | |
| fp | mWorldLat |
| fp | mWorldLon |
| corner of Tile in World Space | |
| WorldVertex | mPosition |
| TileGraph | mTileGraph |
Classes | |
| struct | TileArgs |
| struct | TileGraph |
/// /// 0 1 = 2 subdivisions per edge /// +--+--+ /// | /| /| /// |/ |/ | /// +--+--+ /// | /| /| /// |/ |/ | /// +--+--+ /// 0 1 2 = 3 vertexs per edge /// ///
anonymous enum [private] |
| mod_sim::TileFactory::TileFactory | ( | void | ) |
ctor/dtor. Init() substitutes.
| mod_sim::TileFactory::~TileFactory | ( | ) |
| void mod_sim::TileFactory::Populate | ( | const BoxVolume & | quadrantBoxVolume, | |
| SharedPtr< Heightmap > | heightmap | |||
| ) |
| void mod_sim::TileFactory::Reset | ( | void | ) | [private] |
Reset state to prepare for the building the next Tile. To be called at start of MakeTile().
| void mod_sim::TileFactory::MakeTile | ( | void | ) | [private] |
Inner-loop.
This is the inner-loop of that produces pairs of triangles of one Tile.
| mWorldLat,mWorldLon | (implied) |
| void mod_sim::TileFactory::MakeLocalVertexs | ( | void | ) | [private] |
Make nodes for local vertexs.
0 1 2 corner-relative tile coords -1 0 +1 center-relative tile coords +--+--+ subdivisionsEdge=2 | /| /| |/ |/ | +--+--+ | /| /| |/ |/ | +--+--+
| void mod_sim::TileFactory::MakeNormals | ( | void | ) | [private] |
Make nodes for polygon normals and vertex normals.
Two sets of polygon normals: ---------------------------- For a pair of triangles, mPolygonNormals0 and mPolygonNormals1 are two Array2D objects. They are catenated into one flat array. Therefore, the vixs of the second triangle begin at the middle of the flat array.
| void mod_sim::TileFactory::MakeTexture | ( | void | ) | [private] |
Make node for texture.
| void mod_sim::TileFactory::MakeTriangles | ( | void | ) | [private] |
Make nodes for triangles.
TileGraph::mLocalVertexs2D is needed here, not for the values but rather, for their indexs, to build vixs.
| void mod_sim::TileFactory::MakeTrianglesTexCoords | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | [private] |
Map texture coordinates of triangle to terrain colormap.
| void mod_sim::TileFactory::MakeTileObject | ( | void | ) | [private] |
Make a drawable Tile Object from Graph.
| NormalVertex mod_sim::TileFactory::ComputePolygonNormalOfTriangle0 | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | [private] |
Compute polygon normal (normal vector on polygon). That is, compute polygon normals of the 2 triangles of a LandTile.
vix3 __ vix2 |\ | vix0 |_\| vix1
| NormalVertex mod_sim::TileFactory::ComputePolygonNormalOfTriangle1 | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | [private] |
| NormalVertex mod_sim::TileFactory::ComputeVertexNormal | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | [private] |
Compute an average normal vector from 8 surrounding triangles contained in 4 surrounding quads. _____ |\ |\ | |_\._\| |\ |\ | |_\|_\|
uint mod_sim::TileFactory::msMedianHeight [private] |
median height tracked for every Heightmap
TileArgs mod_sim::TileFactory::mTileArgs [private] |
shptr<Heightmap> mod_sim::TileFactory::mHeightmap [private] |
Heightmap correlating to box volume.
fp mod_sim::TileFactory::mWorldLat [private] |
fp mod_sim::TileFactory::mWorldLon [private] |
corner of Tile in World Space
WorldVertex mod_sim::TileFactory::mPosition [private] |
TileGraph mod_sim::TileFactory::mTileGraph [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:31 2007