projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
backup - missing some
[demo]
/
src
/
terrain.cc
diff --git
a/src/terrain.cc
b/src/terrain.cc
index
0f10074
..
89caa6e
100644
(file)
--- a/
src/terrain.cc
+++ b/
src/terrain.cc
@@
-58,8
+58,8
@@
bool Terrain::generate(const TerrainParams ¶ms)
data.yoffs = (float)i / (float)params.ytiles;
gen_heightfield(tile.mesh, txsz, tysz, params.max_height,
data.yoffs = (float)i / (float)params.ytiles;
gen_heightfield(tile.mesh, txsz, tysz, params.max_height,
- params.tile_usub, params.tile_vsub, calc_height,
- (void*)&data);
+ params.tile_usub, params.tile_vsub, calc_height,
+ (void *)&data);
float xoffs = j * txsz - params.xsz / 2.0 + txsz / 2.0;
float yoffs = i * tysz - params.ysz / 2.0 + tysz / 2.0;
float xoffs = j * txsz - params.xsz / 2.0 + txsz / 2.0;
float yoffs = i * tysz - params.ysz / 2.0 + tysz / 2.0;
@@
-70,10
+70,10
@@
bool Terrain::generate(const TerrainParams ¶ms)
tiles.push_back(tile);
tiles.push_back(tile);
-/*
- the terrain scene stores objects only
- no need to fill the mat, mesh std::vectors
-*/
+ /*
+ the terrain scene stores objects only
+ no need to fill the mat, mesh std::vectors
+ */
Object *o = new Object;
o->mesh = tile.mesh;
o->material = &material;
Object *o = new Object;
o->mesh = tile.mesh;
o->material = &material;
@@
-123,7
+123,7
@@
float Terrain::get_height(float u, float v) const
static float calc_height(float u, float v, void *ptr)
{
static float calc_height(float u, float v, void *ptr)
{
- GenData *data = (GenData*)ptr;
+ GenData *data = (GenData *)ptr;
const TerrainParams *tp = data->tp;
u = u / tp->xtiles + data->xoffs;
const TerrainParams *tp = data->tp;
u = u / tp->xtiles + data->xoffs;