Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2015-02-01 22:18:19 +0000
committerStijn Buys <ingar@osirion.org>2015-02-01 22:18:19 +0000
commit924c366a6ae1747f8cd75403d9028a1a07fe8bb3 (patch)
treedba50e426d5b901cf254edc3a2cb1db8d67e6700 /src/model
parent6898ad148be30c3c9ec7912ef914a085438ce206 (diff)
Corrected a bug where submodel tags where not rotated according to the submodel axis.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/mapfile.cc3
-rw-r--r--src/model/tags.h10
2 files changed, 13 insertions, 0 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc
index 9cdb23e..05cea2a 100644
--- a/src/model/mapfile.cc
+++ b/src/model/mapfile.cc
@@ -2075,6 +2075,7 @@ Model * MapFile::load(std::string const &name)
for (Model::Flares::const_iterator flit = submodel_model->flares().begin(); flit != submodel_model->flares().end(); ++flit) {
tag_flare = new Flare(*(*flit));
tag_flare->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_flare->location() - submodel_model->origin()) * tag_submodel->scale());
+ tag_flare->set_axis(tag_submodel->axis() * tag_flare->axis());
tag_flare->set_radius(tag_flare->radius() * tag_submodel->scale());
model->add_flare(tag_flare);
}
@@ -2083,6 +2084,7 @@ Model * MapFile::load(std::string const &name)
for (Model::ParticleSystems::const_iterator pit = submodel_model->particles().begin(); pit != submodel_model->particles().end(); ++pit) {
tag_particles = new Particles(*(*pit));
tag_particles->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_particles->location() - submodel_model->origin()) * tag_submodel->scale());
+ tag_particles->set_axis(tag_submodel->axis() * tag_particles->axis());
tag_particles->set_scale(tag_particles->scale() * tag_submodel->scale());
model->add_particles(tag_particles);
}
@@ -2098,6 +2100,7 @@ Model * MapFile::load(std::string const &name)
for (Model::Slots::const_iterator slit = submodel_model->slots().begin(); slit != submodel_model->slots().end(); ++slit) {
tag_slot = new Slot(*(*slit));
tag_slot->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_slot->location() - submodel_model->origin()) * tag_submodel->scale());
+ tag_slot->set_axis(tag_submodel->axis() * tag_slot->axis());
model->add_slot(tag_slot);
}
}
diff --git a/src/model/tags.h b/src/model/tags.h
index 775dc73..7e4a9de 100644
--- a/src/model/tags.h
+++ b/src/model/tags.h
@@ -376,6 +376,11 @@ public:
{
flare_cull = cull;
}
+
+ inline void set_axis(const math::Axis& axis)
+ {
+ flare_axis.assign(axis);
+ }
/* ---- actors --------------------------------------------- */
@@ -521,6 +526,11 @@ public:
particles_has_color = true;
}
+ inline void set_axis(const math::Axis& axis)
+ {
+ particles_axis.assign(axis);
+ }
+
/* ---- actors --------------------------------------------- */
/**