tower destroy debris

This commit is contained in:
Tleety
2014-06-05 06:13:51 +02:00
parent 8f1f87512f
commit 3f6933da76
7 changed files with 337 additions and 717 deletions
+48
View File
@@ -100,6 +100,51 @@ void GameWorld::Initialize()
EventBroker->Publish(e);
}
#pragma region Tower_Debris_Template
{
auto debri = CreateEntity();
AddComponent<Components::Template>(debri);
auto transform = AddComponent<Components::Transform>(debri);
transform->Position = glm::vec3(0.f, 4.12801f, 1.18125f);
auto model = AddComponent<Components::Model>(debri);
model->ModelFile = "Models/Turret/Gun/Gun.obj";
auto physics = AddComponent<Components::Physics>(debri);
physics->MotionType = Components::Physics::MotionTypeEnum::Dynamic;
physics->Mass = 200.f;
physics->Restitution = .04f;
physics->Friction = 0.9f;
auto shape = CreateEntity(debri);
auto shapetransform = AddComponent<Components::Transform>(shape);
auto shapemesh = AddComponent<Components::MeshShape>(shape);
shapemesh->ResourceName = "Models/Turret/Gun/Gun.obj";
m_TowerDebrisTemplates.push_back(debri);
}
{
auto debri = CreateEntity();
AddComponent<Components::Template>(debri);
auto transform = AddComponent<Components::Transform>(debri);
transform->Position = glm::vec3(0.f, 5.889f-0.92791f, 0.f);
auto model = AddComponent<Components::Model>(debri);
model->ModelFile = "Models/Turret/GunRotation/GunRotation.obj";
auto physics = AddComponent<Components::Physics>(debri);
physics->MotionType = Components::Physics::MotionTypeEnum::Dynamic;
physics->Mass = 200.f;
physics->Restitution = .04f;
physics->Friction = 0.9f;
auto shape = CreateEntity(debri);
auto shapetransform = AddComponent<Components::Transform>(shape);
auto shapemesh = AddComponent<Components::MeshShape>(shape);
shapemesh->ResourceName = "Models/Turret/GunRotation/GunRotation.obj";
m_TowerDebrisTemplates.push_back(debri);
}
#pragma endregion
#pragma region Wall_Debris_Template
{
@@ -749,6 +794,9 @@ EntityID GameWorld::CreateTower(EntityID parent, glm::vec3 pos, int teamID)
turretComponent->ShotTemplate = m_ShotTemplate;
turretComponent->ShotSpeed = 40.f;
auto debrisComponent = AddComponent<Components::TowerDebris>(towerBase);
debrisComponent->TowerDebrisIDs = m_TowerDebrisTemplates;
CommitEntity(towerBase);
return towerBase;