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-11 12:40:08 +0000
committerStijn Buys <ingar@osirion.org>2009-08-11 12:40:08 +0000
commit95b3f5993151db7607f69132adc604e27e0f55ce (patch)
treecfe9204f1b0a6355ac211acda877170aaaf2600e /src/render
parent25bcd92706ce2cd6aee24cfb81e9ff2fd7dd4820 (diff)
implements misc_model rotation angle
Diffstat (limited to 'src/render')
-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++) {