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>2011-05-06 18:27:55 +0000
committerStijn Buys <ingar@osirion.org>2011-05-06 18:27:55 +0000
commit50947891a97f19fa11f9f073c8988156f9655d97 (patch)
tree2373dd39d70edd7995210aabb6973315465ba737 /src/render
parente7a0b54c4717afdfa12a8847d5bc72b7b68290b4 (diff)
Support for func_rotate and func_move collision meshes.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index c19dc39..46f62ca 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -671,14 +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::application()->time()) * group->speed());
+ const float rotation_angle = math::degrees360f((group->engine() ? enginetime : core::game()->time()) * group->speed());
gl::rotate(-rotation_angle, group->movement());
} 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 * freq) * 0.5f + 0.5f;
+ translation *= sinf((group->engine() ? enginetime : core::game()->time()) * M_PI * freq) * 0.5f + 0.5f;
gl::translate(translation);
}
@@ -950,6 +950,15 @@ void draw_model_axis(const core::Entity *entity)
void draw_pass_model_fragments()
{
+ /*
+ * FIXME
+ * For moving and rotating fragmentgroups, the enginetime must match
+ * the time used by core:: to calculate the rotation or movement
+ * of the asssociated collision models.
+ * Currently, enginetime is client-side only, and there is no way
+ * to sync core and render movement of fragmentgroups without sacrificing
+ * the functionality of the FragmentGroup::engine() flag.
+ */
for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) {
core::Entity *entity = (*it);