Added support for multiple emitters. (ParticleEmitter component now friend class to ParticleSystem)

This commit is contained in:
Stiffly
2014-04-25 00:24:13 +02:00
parent b07605594d
commit 166a9f48f1
4 changed files with 38 additions and 26 deletions
+16 -11
View File
@@ -77,7 +77,7 @@ void GameWorld::Initialize()
auto model = AddComponent<Components::Model>(ball, "Model");
model->ModelFile = "Models/Placeholders/PhysicsTest/Sphere.obj";
auto sphere = AddComponent<Components::Sphere>(ball, "Sphere");
sphere->Radius = 0.5;
sphere->Radius = 0.05;
auto physics = AddComponent<Components::Physics>(ball, "Physics");
physics->Mass = 1;
}
@@ -92,16 +92,21 @@ void GameWorld::Initialize()
}*/
{
// Particle emitter
auto ent = CreateEntity();
auto transform = AddComponent<Components::Transform>(ent, "Transform");
transform->Position = glm::vec3(0);
auto emitter = AddComponent<Components::ParticleEmitter>(ent, "ParticleEmitter");
emitter->LifeTime = 4;
emitter->SpawnCount = 1;
emitter->SpreadAngle = 35;
emitter->SpawnFrequency = 0.05;
//emitter->
for(int i = 0; i < 4 ; i++)
{
// Particle emitter
auto ent = CreateEntity();
auto transform = AddComponent<Components::Transform>(ent, "Transform");
transform->Position = glm::vec3(i * 10, 20, 0);
auto emitter = AddComponent<Components::ParticleEmitter>(ent, "ParticleEmitter");
emitter->LifeTime = 2;
emitter->SpawnCount = 1;
emitter->SpreadAngle = 35;
emitter->SpawnFrequency = 2;
auto model = AddComponent<Components::Model>(ent, "Model");
model->ModelFile = "Models/Placeholders/PhysicsTest/PointLight.obj";
//emitter->
}
}
}