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.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index ecabe21..c19dc39 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -671,13 +671,14 @@ void draw_model_fragments(model::Model *model,
gl::scale(s, s, s);
if (group->type() == model::FragmentGroup::Rotate) {
- const float rotation_angle = math::degrees360f((group->engine() ? enginetime : core::game()->time()) * group->speed());
+ const float rotation_angle = math::degrees360f((group->engine() ? enginetime : core::application()->time()) * group->speed());
gl::rotate(-rotation_angle, group->movement());
- } else if (group->type() == model::FragmentGroup::Move ) {
- const float speed = group->distance() / group->speed(); // units per second
+ } else if (group->type() == model::FragmentGroup::Move ) {
+
+ const float freq = group->speed() / group->distance();
math::Vector3f translation(group->movement() * group->distance());
- translation *= sinf((group->engine() ? enginetime : core::application()->time()) * M_PI * speed) * 0.5f + 0.5f;
+ translation *= sinf((group->engine() ? enginetime : core::application()->time()) * M_PI * freq) * 0.5f + 0.5f;
gl::translate(translation);
}