Compare commits
8 Commits
havok
...
Sound+Particles
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f617727a4 | |||
| 9a7d0463a0 | |||
| 7b5e0045f6 | |||
| 75a19fbfe0 | |||
| 36ecbf8b73 | |||
| d3dca03f47 | |||
| 83e28d48f8 | |||
| b4cec1747e |
+6
-3
@@ -673,9 +673,11 @@ void GameWorld::CreateGate(EntityID parent, glm::vec3 position, glm::quat orient
|
|||||||
|
|
||||||
EntityID GameWorld::CreateTower(EntityID parent, glm::vec3 pos, int teamID)
|
EntityID GameWorld::CreateTower(EntityID parent, glm::vec3 pos, int teamID)
|
||||||
{
|
{
|
||||||
auto towerBase = CreateEntity(parent);
|
auto parentTransform = GetComponent<Components::Transform>(parent);
|
||||||
|
|
||||||
|
auto towerBase = CreateEntity();
|
||||||
auto transform = AddComponent<Components::Transform>(towerBase);
|
auto transform = AddComponent<Components::Transform>(towerBase);
|
||||||
transform->Position = pos;
|
transform->Position = parentTransform->Orientation * pos;
|
||||||
|
|
||||||
auto towerComponent = AddComponent<Components::Tower>(towerBase);
|
auto towerComponent = AddComponent<Components::Tower>(towerBase);
|
||||||
|
|
||||||
@@ -1415,7 +1417,8 @@ void GameWorld::CreateBase(glm::quat orientation, int teamID)
|
|||||||
CreateTower(base, glm::vec3(273.01227f, 40.30102f, -62.82098f), teamID);
|
CreateTower(base, glm::vec3(273.01227f, 40.30102f, -62.82098f), teamID);
|
||||||
CreateTower(base, glm::vec3(357.36978f, 40.43885f, -62.82098f), teamID);
|
CreateTower(base, glm::vec3(357.36978f, 40.43885f, -62.82098f), teamID);
|
||||||
CreateTower(base, glm::vec3(357.36978f, 40.43885f, 32.99123f), teamID);
|
CreateTower(base, glm::vec3(357.36978f, 40.43885f, 32.99123f), teamID);
|
||||||
CreateTower(base, glm::vec3(119.64996f, 28.90156f, 16.63123f), teamID);
|
|
||||||
|
CreateTower(base, glm::vec3(119.64996f, 28.90156f, -16.63123f), teamID);
|
||||||
CreateTower(base, glm::vec3(119.05541f, 29.54314f, 18.33529f), teamID);
|
CreateTower(base, glm::vec3(119.05541f, 29.54314f, 18.33529f), teamID);
|
||||||
|
|
||||||
CreateGarage(base, glm::vec3(323.2f, 41.4f, -10.2f), glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0)), teamID);
|
CreateGarage(base, glm::vec3(323.2f, 41.4f, -10.2f), glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0)), teamID);
|
||||||
|
|||||||
@@ -902,13 +902,23 @@ bool Systems::PhysicsSystem::OnDead( const Events::Dead &e )
|
|||||||
m_World->RemoveComponent<Components::Camera>(camera);
|
m_World->RemoveComponent<Components::Camera>(camera);
|
||||||
auto transform = m_World->GetComponent<Components::Transform>(e.Entity);
|
auto transform = m_World->GetComponent<Components::Transform>(e.Entity);
|
||||||
transform->Position = glm::vec3(0, -10000.f, 0);
|
transform->Position = glm::vec3(0, -10000.f, 0);
|
||||||
m_RigidBodies[e.Entity]->setPosition(hkVector4(0, -10000, 0));
|
//m_RigidBodies[e.Entity]->setPosition(hkVector4(0, -10000, 0));
|
||||||
|
|
||||||
/*m_Vehicles.erase(e.Entity);
|
/*m_Vehicles.erase(e.Entity);
|
||||||
m_RigidBodyEntities.erase(m_RigidBodies[e.Entity]);
|
m_RigidBodyEntities.erase(m_RigidBodies[e.Entity]);
|
||||||
m_RigidBodies.erase(e.Entity);*/
|
m_RigidBodies.erase(e.Entity);*/
|
||||||
|
|
||||||
m_World->RemoveComponent<Components::TankSteering>(e.Entity);
|
auto jeep = m_World->GetComponent<Components::JeepSteering>(e.Entity);
|
||||||
|
if(jeep)
|
||||||
|
{
|
||||||
|
m_World->RemoveComponent<Components::JeepSteering>(e.Entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto tank = m_World->GetComponent<Components::TankSteering>(e.Entity);
|
||||||
|
if(tank)
|
||||||
|
{
|
||||||
|
m_World->RemoveComponent<Components::TankSteering>(e.Entity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
#include "Events/EnterTrigger.h"
|
#include "Events/EnterTrigger.h"
|
||||||
#include "Events/JeepSteer.h"
|
#include "Events/JeepSteer.h"
|
||||||
#include "Events/Dead.h"
|
#include "Events/Dead.h"
|
||||||
|
#include "Components/JeepSteering.h"
|
||||||
|
|
||||||
namespace Systems
|
namespace Systems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,12 +30,13 @@ void Systems::TankSteeringSystem::Update(double dt)
|
|||||||
|
|
||||||
void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto pEmitter = m_World->GetComponent<Components::ParticleEmitter>(entity);
|
auto pEmitter = m_World->GetComponent<Components::ParticleEmitter>(entity);
|
||||||
if(pEmitter)
|
if(pEmitter)
|
||||||
{
|
{auto tankTransform = m_World->GetComponent<Components::Transform>(parent);
|
||||||
if(!m_World->GetComponent<Components::TankSteering>(parent))
|
if(!m_World->GetComponent<Components::TankSteering>(parent))
|
||||||
return;
|
return;
|
||||||
auto tankTransform = m_World->GetComponent<Components::Transform>(parent);
|
|
||||||
glm::vec2 velXZ = glm::vec2(tankTransform->Velocity.x, tankTransform->Velocity.z);
|
glm::vec2 velXZ = glm::vec2(tankTransform->Velocity.x, tankTransform->Velocity.z);
|
||||||
float speedMPDT = glm::length(velXZ);
|
float speedMPDT = glm::length(velXZ);
|
||||||
if(speedMPDT < 1)
|
if(speedMPDT < 1)
|
||||||
@@ -56,6 +57,18 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto vehicleComp = m_World->GetComponent<Components::Vehicle>(entity);
|
||||||
|
if(vehicleComp)
|
||||||
|
{
|
||||||
|
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||||
|
if(transform->Position.y < 0)
|
||||||
|
{
|
||||||
|
Events::Dead e;
|
||||||
|
e.Entity = entity;
|
||||||
|
EventBroker->Publish(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto tankSteeringComponent = m_World->GetComponent<Components::TankSteering>(entity);
|
auto tankSteeringComponent = m_World->GetComponent<Components::TankSteering>(entity);
|
||||||
if(!tankSteeringComponent)
|
if(!tankSteeringComponent)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "Events/PlaySFX.h"
|
#include "Events/PlaySFX.h"
|
||||||
#include "Events/PlayBGM.h"
|
#include "Events/PlayBGM.h"
|
||||||
|
#include "Events/Dead.h"
|
||||||
|
|
||||||
#include "Events/Damage.h"
|
#include "Events/Damage.h"
|
||||||
#include "Components/Vehicle.h"
|
#include "Components/Vehicle.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user