Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/render/particlesystem.cc59
-rw-r--r--src/render/particlesystem.h2
2 files changed, 34 insertions, 27 deletions
diff --git a/src/render/particlesystem.cc b/src/render/particlesystem.cc
index 87cb7bc..7cf8f2f 100644
--- a/src/render/particlesystem.cc
+++ b/src/render/particlesystem.cc
@@ -108,7 +108,16 @@ ParticleSystem::ParticleSystem(const ParticleSystemScript *script, const core::E
ejector->get_radius_vec() *= entity->radius();
ejector->set_acceleration(ejector->acceleration() * entity->radius());
}
- }
+
+ if (modelclass && (modelclass->scale() != 1.0f)) {
+ ejector->get_speed_vec() *= modelclass->scale();
+ ejector->get_tailspeed_vec() *= modelclass->scale();
+ ejector->get_radius_vec() *= modelclass->scale();
+ ejector->set_acceleration(ejector->acceleration() * modelclass->scale());
+ }
+
+ }
+
}
}
@@ -148,33 +157,33 @@ void ParticleSystem::draw(const float seconds)
if (entity()) {
bool ejector_active = true;
+
+ if (ejector->impulse() || ejector->thrust()) {
+ ejector_active = false;
+ }
if (entity()->type() == core::Entity::Controlable) {
const core::EntityControlable *controlable = static_cast<const core::EntityControlable *>(entity());
-
- if (ejector->impulse() || ejector->thrust()) {
- ejector_active = false;
-
- switch (controlable->state()) {
- case core::Entity::Impulse:
- case core::Entity::ImpulseInitiate:
- if (ejector->impulse() || ejector->thrust()) {
+
+ switch (controlable->state()) {
+ case core::Entity::Impulse:
+ case core::Entity::ImpulseInitiate:
+ if (ejector->impulse()) {
+ ejector_active = true;
+ }
+ break;
+
+ case core::Entity::Normal:
+ if (ejector->thrust()) {
+ if (controlable->thrust() > 0.0f) {
ejector_active = true;
}
- break;
-
- case core::Entity::Normal:
- if (ejector->thrust()) {
- if (controlable->thrust() > 0.0f) {
- ejector_active = true;
- }
- }
- break;
-
- default:
- ejector_active = false;
- break;
- }
+ }
+ break;
+
+ default:
+ ejector_active = false;
+ break;
}
} else if (entity()->type() == core::Entity::Dynamic) {
@@ -183,10 +192,8 @@ void ParticleSystem::draw(const float seconds)
if (dynamic->state() == core::Entity::NoPower) {
ejector_active = false;
}
- }
-
+ }
ejector->enable(ejector_active);
-
}
(*it)->frame(seconds, current_location, current_axis * ejector->axis());
diff --git a/src/render/particlesystem.h b/src/render/particlesystem.h
index b3edce4..05bbe7d 100644
--- a/src/render/particlesystem.h
+++ b/src/render/particlesystem.h
@@ -50,7 +50,7 @@ public:
}
/**
- * @brief axisof the particlesystem
+ * @brief axis of the particlesystem
* */
inline const math::Axis &axis() const {
return particlesystem_axis;