Optimized ParticleSystem. Still can't see particles though D:
This commit is contained in:
+46
-46
@@ -745,29 +745,29 @@ EntityID GameWorld::CreateTank(int playerID)
|
||||
}
|
||||
CommitEntity(wheel);
|
||||
|
||||
auto entity = CreateEntity(tank);
|
||||
auto transformComponent = AddComponent<Components::Transform>(entity);
|
||||
transformComponent->Position = glm::vec3(2, -1.7, 2.0);
|
||||
transformComponent->Scale = glm::vec3(3, 3, 3);
|
||||
transformComponent->Orientation = glm::angleAxis(glm::pi<float>() / 2, glm::vec3(1, 0, 0));
|
||||
auto emitterComponent = AddComponent<Components::ParticleEmitter>(entity);
|
||||
emitterComponent->SpawnCount = 2;
|
||||
emitterComponent->SpawnFrequency = 0.005;
|
||||
emitterComponent->SpreadAngle = glm::pi<float>();
|
||||
emitterComponent->UseGoalVelocity = false;
|
||||
emitterComponent->LifeTime = 0.5;
|
||||
//emitterComponent->AngularVelocitySpectrum.push_back(glm::pi<float>() / 100);
|
||||
emitterComponent->ScaleSpectrum.push_back(glm::vec3(0.05));
|
||||
CommitEntity(entity);
|
||||
|
||||
auto particleEntity = CreateEntity(entity);
|
||||
auto TEMP = AddComponent<Components::Transform>(particleEntity);
|
||||
TEMP->Scale = glm::vec3(0);
|
||||
auto spriteComponent = AddComponent<Components::Sprite>(particleEntity);
|
||||
spriteComponent->SpriteFile = "Models/Textures/Sprites/Dust.png";
|
||||
emitterComponent->ParticleTemplate = particleEntity;
|
||||
|
||||
CommitEntity(particleEntity);
|
||||
// auto entity = CreateEntity(tank);
|
||||
// auto transformComponent = AddComponent<Components::Transform>(entity);
|
||||
// transformComponent->Position = glm::vec3(2, -1.7, 2.0);
|
||||
// transformComponent->Scale = glm::vec3(3, 3, 3);
|
||||
// transformComponent->Orientation = glm::angleAxis(glm::pi<float>() / 2, glm::vec3(1, 0, 0));
|
||||
// auto emitterComponent = AddComponent<Components::ParticleEmitter>(entity);
|
||||
// emitterComponent->SpawnCount = 2;
|
||||
// emitterComponent->SpawnFrequency = 0.005;
|
||||
// emitterComponent->SpreadAngle = glm::pi<float>();
|
||||
// emitterComponent->UseGoalVelocity = false;
|
||||
// emitterComponent->LifeTime = 0.5;
|
||||
// //emitterComponent->AngularVelocitySpectrum.push_back(glm::pi<float>() / 100);
|
||||
// emitterComponent->ScaleSpectrum.push_back(glm::vec3(0.05));
|
||||
// CommitEntity(entity);
|
||||
//
|
||||
// auto particleEntity = CreateEntity(entity);
|
||||
// auto TEMP = AddComponent<Components::Transform>(particleEntity);
|
||||
// TEMP->Scale = glm::vec3(0);
|
||||
// auto spriteComponent = AddComponent<Components::Sprite>(particleEntity);
|
||||
// spriteComponent->SpriteFile = "Models/Textures/Sprites/Dust.png";
|
||||
// emitterComponent->ParticleTemplate = particleEntity;
|
||||
//
|
||||
// CommitEntity(particleEntity);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -830,29 +830,29 @@ EntityID GameWorld::CreateTank(int playerID)
|
||||
CommitEntity(wheel);
|
||||
#pragma endregion
|
||||
|
||||
auto entity = CreateEntity(tank);
|
||||
auto transformComponent = AddComponent<Components::Transform>(entity);
|
||||
transformComponent->Position = glm::vec3(-2, -1.7, 2.0);
|
||||
transformComponent->Scale = glm::vec3(3, 3, 3);
|
||||
transformComponent->Orientation = glm::angleAxis(glm::pi<float>() / 2, glm::vec3(1, 0, 0));
|
||||
auto emitterComponent = AddComponent<Components::ParticleEmitter>(entity);
|
||||
emitterComponent->SpawnCount = 2;
|
||||
emitterComponent->SpawnFrequency = 0.005;
|
||||
emitterComponent->SpreadAngle = glm::pi<float>();
|
||||
emitterComponent->UseGoalVelocity = false;
|
||||
emitterComponent->LifeTime = 0.5;
|
||||
//emitterComponent->AngularVelocitySpectrum.push_back(glm::pi<float>() / 100);
|
||||
emitterComponent->ScaleSpectrum.push_back(glm::vec3(0.05));
|
||||
CommitEntity(entity);
|
||||
|
||||
auto particleEntity = CreateEntity(entity);
|
||||
auto TEMP = AddComponent<Components::Transform>(particleEntity);
|
||||
TEMP->Scale = glm::vec3(0);
|
||||
auto spriteComponent = AddComponent<Components::Sprite>(particleEntity);
|
||||
spriteComponent->SpriteFile = "Models/Textures/Sprites/Dust.png";
|
||||
emitterComponent->ParticleTemplate = particleEntity;
|
||||
|
||||
CommitEntity(particleEntity);
|
||||
// auto entity = CreateEntity(tank);
|
||||
// auto transformComponent = AddComponent<Components::Transform>(entity);
|
||||
// transformComponent->Position = glm::vec3(-2, -1.7, 2.0);
|
||||
// transformComponent->Scale = glm::vec3(3, 3, 3);
|
||||
// transformComponent->Orientation = glm::angleAxis(glm::pi<float>() / 2, glm::vec3(1, 0, 0));
|
||||
// auto emitterComponent = AddComponent<Components::ParticleEmitter>(entity);
|
||||
// emitterComponent->SpawnCount = 2;
|
||||
// emitterComponent->SpawnFrequency = 0.005;
|
||||
// emitterComponent->SpreadAngle = glm::pi<float>();
|
||||
// emitterComponent->UseGoalVelocity = false;
|
||||
// emitterComponent->LifeTime = 0.5;
|
||||
// //emitterComponent->AngularVelocitySpectrum.push_back(glm::pi<float>() / 100);
|
||||
// emitterComponent->ScaleSpectrum.push_back(glm::vec3(0.05));
|
||||
// CommitEntity(entity);
|
||||
//
|
||||
// auto particleEntity = CreateEntity(entity);
|
||||
// auto TEMP = AddComponent<Components::Transform>(particleEntity);
|
||||
// TEMP->Scale = glm::vec3(0);
|
||||
// auto spriteComponent = AddComponent<Components::Sprite>(particleEntity);
|
||||
// spriteComponent->SpriteFile = "Models/Textures/Sprites/Dust.png";
|
||||
// emitterComponent->ParticleTemplate = particleEntity;
|
||||
//
|
||||
// CommitEntity(particleEntity);
|
||||
}
|
||||
|
||||
CommitEntity(tank);
|
||||
|
||||
Reference in New Issue
Block a user