Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-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());