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/draw.cc')
-rw-r--r--src/render/draw.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 339f127..e800d62 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -584,23 +584,19 @@ void draw_model_fragments(model::Model *model,
if (group->transform()) {
gl::push();
- //gl::translate(group->location());
- // FIXME this will go wrong if a Rotate group is imported as submodel
+
+ gl::translate(group->location());
+
if (group->type() == model::FragmentGroup::Rotate) {
- gl::translate(group->location());
float rotation_angle = math::degrees360f(core::application()->time() * group->speed());
gl::rotate(-rotation_angle, group->axis().forward());
- gl::translate(group->location()* -1.0f);
- } else {
- float s = group->scale();
- if (s == 0.0f)
- s = 1.0f;
- gl::scale(s, s, s);
- gl::translate(group->location() / s);
+ } else {
+ gl::multmatrix(group->axis());
}
-
-
+ const float s = group->scale();
+ if (s)
+ gl::scale(s, s, s);
}
for (model::FragmentGroup::iterator fit = group->begin(); fit != group->end(); fit++) {