From f35e3781a120937fcf00bacd35f8e891ae630a4a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 21 Dec 2008 13:35:47 +0000 Subject: full direction. pitch and roll control for fx_flare, fx_particles and func_rotate --- src/render/draw.cc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/render/draw.cc') diff --git a/src/render/draw.cc b/src/render/draw.cc index e094a44..02f2a7d 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -582,17 +582,8 @@ void draw_model_fragments(core::Entity *entity) if (group->type() == model::FragmentGroup::Rotate) { gl::push(); gl::translate(group->location()); - float rotation_angle = math::degrees360f(core::application()->time() * group->speed()); - - if (group->angle() == model::ANGLEUP) { - gl::rotate(rotation_angle, math::Vector3f::Zaxis()); - } else if (group->angle() == model::ANGLEDOWN) { - gl::rotate(-rotation_angle, math::Vector3f::Zaxis()); - } else { - gl::rotate(rotation_angle, math::Vector3f::Xaxis()); - } - + gl::rotate(-rotation_angle, group->axis().forward()); gl::translate(group->location()* -1.0f); } @@ -831,10 +822,7 @@ void draw_pass_model_fx(float elapsed) t = (core::application()->time() + ext_render(entity)->fuzz() - flare->offset()) * flare->frequency(); if ((thrust > 0 ) && ((!flare->strobe()) || (( t - floorf(t)) <= flare->time()))) { - flare_axis.assign(entity->axis()); - if (flare->angle()) - flare_axis.change_direction(flare->angle()); - + flare_axis.assign(entity->axis() * flare->axis()); location.assign(entity->location() + (entity->axis() * flare->location())); light_size = 0.0625 * flare->radius(); -- cgit v1.2.3