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>2009-08-13 12:49:49 +0000
committerStijn Buys <ingar@osirion.org>2009-08-13 12:49:49 +0000
commita320e55dc1a17cef3923643277f1112f74251d70 (patch)
tree617768887dff8a2779ec22e3413486d9ef142f49 /src/render/draw.cc
parentd79f51d227cdc6ef71517ed2476041f3a9ed4d36 (diff)
documentation updates, win32 build fix, megatog's enginelight patch
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index da8c8d3..150356c 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -904,6 +904,17 @@ void draw_pass_model_fx(float elapsed)
for (model::Model::Lights::iterator lit = entity->model()->lights().begin(); lit != entity->model()->lights().end(); lit++) {
light = (*lit);
+ // engine flares
+ thrust = 1.0f;
+ if (light->engine() && ( entity->type() == core::Entity::Controlable)) {
+ core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity);
+ if ((ec->state() == core::Entity::ImpulseInitiate) || (ec->state() == core::Entity::Impulse)) {
+ thrust = 1.0f;
+ } else {
+ thrust = ec->thrust();
+ }
+ }
+
// strobe frequency
t = 1.0f;
if (light->strobe())
@@ -919,12 +930,17 @@ void draw_pass_model_fx(float elapsed)
gl::begin(gl::Quads);
}
+ // default alpha is 0.8
+ a = 0.8f;
if (light->entity()) {
color.assign(entity->color());
+ } else if (light->engine()) {
+ color.assign(entity->model()->enginecolor());
+ a *= thrust;
} else {
color.assign(light->color());
}
- color.a = 0.8;
+ color.a = a;
gl::color(color);
glTexCoord2f(0,1);
@@ -995,6 +1011,8 @@ void draw_pass_model_fx(float elapsed)
a = math::absf( dotproduct(flare_axis.forward(), Camera::axis().forward()));
if (a > 0.1f) {
+
+ // alpha decreases as the viewing angle increases
a = a - 0.1f;
if (flare->entity()) {
color.assign(entity->color());