diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-18 13:50:47 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-18 13:50:47 +0000 |
commit | 847f84e1e3797277407bc34f5acc51b801b2bf29 (patch) | |
tree | 781edbf9e6663a4b6a8cfbaf173f43cfd83db62b /src/model | |
parent | 445f4a201f205763a2241d87ef81a99b5dd55d26 (diff) |
Unified radiant angles conversion into a single math::Axis.assign() method, corrected transformation order.
Removed unnecessary model::LIGHTSCALE constant, light and flare sizes are rescaled according to the global model::SCALE.
Added gl::depthfunc, enabled GL_LEQUAL while drawing lights and flares.
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/mapfile.cc | 17 | ||||
-rw-r--r-- | src/model/model.h | 3 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 560bbc1..b74cdbe 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -808,10 +808,7 @@ bool MapFile::got_key_axis(math::Axis &axis) std::istringstream str(value()); if (str >> pitch >> yaw >> roll) { - axis.clear(); - axis.change_pitch(-pitch); - axis.change_direction(yaw); - axis.change_roll(-roll); + axis.assign(yaw, pitch, roll); } else { unknown_value(); } @@ -820,7 +817,7 @@ bool MapFile::got_key_axis(math::Axis &axis) } else if (got_key_float("pitch", pitch)) { // TODO this warning should eventually disappear - unknown_error("'" + classname() + ":" + key() + "' has changed polarity"); + unknown_error("'" + classname() + ":" + key() + "' has switched sign"); axis.change_pitch(-pitch); return true; @@ -832,7 +829,7 @@ bool MapFile::got_key_axis(math::Axis &axis) } else if (got_key_float("roll", roll)) { // TODO this warning should eventually disappear - unknown_error("'" + classname() + ":" + key() + "' has changed polarity"); + unknown_error("'" + classname() + ":" + key() + "' has switched sign"); axis.change_roll(-roll); return true; @@ -1131,11 +1128,11 @@ Model * MapFile::load(std::string const &name) continue; } else if (mapfile.got_key_float("light", r)) { - tag_light->set_radius(r * LIGHTSCALE); + tag_light->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("radius", r)) { - tag_light->set_radius(r * LIGHTSCALE); + tag_light->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("frequency", r)) { @@ -1186,11 +1183,11 @@ Model * MapFile::load(std::string const &name) tag_flare->set_engine(spawnflag_isset(u, 4)); } else if (mapfile.got_key_float("light", r)) { - tag_flare->set_radius(r * LIGHTSCALE); + tag_flare->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("radius", r)) { - tag_flare->set_radius(r * LIGHTSCALE); + tag_flare->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("frequency", r)) { diff --git a/src/model/model.h b/src/model/model.h index 9495285..d3973c9 100644 --- a/src/model/model.h +++ b/src/model/model.h @@ -20,9 +20,8 @@ namespace model { -/// scaling factor when loading .map geometry +/// scaling factor when loading model geometry const float SCALE = 1.0f / 1024.0f; -const float LIGHTSCALE = 1.0f / 100.0f; const float ANGLEUP = -1.0f; const float ANGLEDOWN = -2.0f; |