Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-04 11:39:24 +0000
committerStijn Buys <ingar@osirion.org>2008-05-04 11:39:24 +0000
commit33e45d8052b385aa8b1fce68122c8d11f50e7e42 (patch)
treea1a92304f5be2bb322d4d491e737972eb9dd9dfc /src/model/model.cc
parent6155d32aa9e5fc2e5548fcc863a64d442cf5770a (diff)
better target_engine rendering
Diffstat (limited to 'src/model/model.cc')
-rw-r--r--src/model/model.cc40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/model/model.cc b/src/model/model.cc
index b3c8b03..8c853f8 100644
--- a/src/model/model.cc
+++ b/src/model/model.cc
@@ -41,16 +41,6 @@ Triangle::~Triangle()
{
}
-
-/* ---------- core::Engine ------------------------------------------ */
-
-Engine::Engine(math::Vector3f const & location) :
- engine_location(location)
-{}
-
-Engine::~Engine()
-{}
-
/* ---------- core::Model ------------------------------------------ */
std::map<std::string, Model*> Model::registry;
@@ -101,7 +91,8 @@ Model::Model(std::string const & name) :
float class_angle = 0;
math::Color class_color;
unsigned int class_spawnflags = 0;
- float class_light = 100;
+ float class_light = 0.0f;
+ float class_radius = 0.0f;
float class_frequency = 1.0f;
float class_offset = 0;
float class_time = 0.0f;
@@ -124,7 +115,8 @@ Model::Model(std::string const & name) :
class_origin = math::Vector3f(0,0,0);
class_color = math::Color(1, 1, 1);
class_spawnflags = 0;
- class_light = 100;
+ class_light = 0.0f;
+ class_radius = 0.0f;
class_offset = 0;
class_frequency = 1.0f;
class_time = 0.0f;
@@ -153,12 +145,19 @@ Model::Model(std::string const & name) :
brush_detail = false;
} else if ((level == 1) && (class_name == "target_engine")) {
- //con_debug << " engine at " << class_origin << "\n";
- add_engine(new Engine(class_origin * model_scale));
+ model::Engine *engine = new Engine(class_origin * model_scale);
+ if (class_radius)
+ engine->engine_radius = class_radius / 100.0f;
+ add_engine(engine);
+
} else if ((level == 1) && (class_name == "light")) {
Light *light = new Light(class_origin * model_scale, class_color, (class_spawnflags & 1) == 1);
- light->light_radius = class_light / 100.0f;
- light->light_offset = class_offset;
+ if (class_light)
+ light->light_radius = class_light / 100.0f;
+ else if (class_radius)
+ light->light_radius = class_radius / 100.0f;
+ if (class_offset > 0)
+ light->light_offset = class_offset;
if (class_frequency > 0 )
light->light_frequency = class_frequency;
if (class_time > 0 )
@@ -244,6 +243,15 @@ Model::Model(std::string const & name) :
std::istringstream is(tmp);
is >> class_light;
+ } else if (firstword == "\"radius\"") {
+ std::string tmp;
+ char c;
+ while ((linestream.get(c)) && (c != '"'));
+ while ((linestream.get(c)) && (c != '"'))
+ tmp += c;
+ std::istringstream is(tmp);
+ is >> class_radius;
+
} else if (firstword == "\"frequency\"") {
std::string tmp;
char c;