Merge branch 'master' of github.com:sippeangelo/Return-to-the-Return-of-Return-Fire-2-Returngeance
This commit is contained in:
@@ -11,6 +11,7 @@ namespace Events
|
||||
{
|
||||
CreateExplosion() :
|
||||
Color(glm::vec4(0)),
|
||||
usePointLight(false),
|
||||
UseGoalVector(false) {}
|
||||
|
||||
glm::vec3 Position;
|
||||
@@ -21,6 +22,7 @@ namespace Events
|
||||
glm::quat RelativeUpOrientation;
|
||||
float Speed;
|
||||
float SpreadAngle;
|
||||
float usePointLight;
|
||||
std::vector<float> ParticleScale;
|
||||
bool UseGoalVector;
|
||||
glm::vec3 GoalVelocity;
|
||||
|
||||
@@ -268,6 +268,13 @@ bool Systems::ParticleSystem::CreateExplosion(const Events::CreateExplosion &e)
|
||||
auto templateComponent = m_World->AddComponent<Components::Template>(particleEnt);
|
||||
auto TEMP = m_World->AddComponent<Components::Transform>(particleEnt);
|
||||
auto spriteComponent = m_World->AddComponent<Components::Sprite>(particleEnt);
|
||||
if(e.usePointLight)
|
||||
{
|
||||
auto light = m_World->AddComponent<Components::PointLight>(particleEnt);
|
||||
light->Diffuse = glm::vec3(231.f/255.f, 181.f/255.f, 48.f/255.f);
|
||||
light->Specular = glm::vec3(0.5f, 0.5f, 0.5f);
|
||||
light->Radius = 20.f;
|
||||
}
|
||||
spriteComponent->SpriteFile = e.spritePath;
|
||||
m_World->CommitEntity(particleEnt);
|
||||
emitter->ParticleTemplate = particleEnt;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Systems/TransformSystem.h"
|
||||
#include "Components/Transform.h"
|
||||
#include "Components/ParticleEmitter.h"
|
||||
#include "Components/PointLight.h"
|
||||
#include "Components/Particle.h"
|
||||
#include "Components/Sprite.h"
|
||||
#include "EventBroker.h"
|
||||
|
||||
@@ -252,6 +252,7 @@ bool Systems::TankSteeringSystem::OnCollision(const Events::Collision &e)
|
||||
e.Speed = 6;
|
||||
e.SpreadAngle = glm::pi<float>();
|
||||
e.spritePath = "Textures/Sprites/Blast1.png";
|
||||
e.usePointLight = true;
|
||||
e.Color = glm::vec4(2, 2, 2, 0.2);
|
||||
EventBroker->Publish(e);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user