diff --git a/assets b/assets index 588da9c..cc30e5f 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 588da9ca0d0e6a3dd08f4373e03468f79082b359 +Subproject commit cc30e5fb5c32068ef973a15d0142899c0d3b9cf4 diff --git a/src/Components/SpawnPoint.h b/src/Components/SpawnPoint.h index c29230d..74aaaf9 100644 --- a/src/Components/SpawnPoint.h +++ b/src/Components/SpawnPoint.h @@ -8,6 +8,8 @@ namespace Components struct SpawnPoint : Component { + EntityID Player; + virtual SpawnPoint* Clone() const override { return new SpawnPoint(*this); } }; diff --git a/src/GameWorld.cpp b/src/GameWorld.cpp index ed130c7..a7b15bd 100755 --- a/src/GameWorld.cpp +++ b/src/GameWorld.cpp @@ -789,14 +789,295 @@ EntityID GameWorld::CreateJeep(int playerID) return jeep; } -EntityID GameWorld::CreateGarage(glm::vec3 position, glm::quat orientation, int playerID) +void GameWorld::CreateTerrain() { - auto garage = CreateEntity(); - auto transform = AddComponent(garage); - transform->Position = position; + { + auto road_middle = CreateEntity(); + auto transform = AddComponent(road_middle); + auto model = AddComponent(road_middle); + model->ModelFile = "Models/TerrainFiveIstles/Roads/MiddleRoad.obj"; + auto physics = AddComponent(road_middle); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto groundshape = CreateEntity(road_middle); + auto transformshape = AddComponent(groundshape); + auto meshShape = AddComponent(groundshape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/MiddleRoad.obj"; + + + CommitEntity(groundshape); + CommitEntity(road_middle); + } + + + + { + /*auto water = CreateEntity(); + auto transform = AddComponent(water); + transform->Position = glm::vec3(0, -35, 0); + transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); + transform->Scale = glm::vec3(5000.f, 10.f, 5000.f); + auto model = AddComponent(water); + model->ModelFile = "Models/Placeholders/PhysicsTest/Cube.obj"; + auto blendmap = AddComponent(water); + blendmap->TextureRed = "Textures/Skybox/Sky34/bottom.jpg"; + blendmap->TextureGreen = "Textures/Skybox/Sky34/bottom.jpg"; + blendmap->TextureBlue = "Textures/Skybox/Sky34/bottom.jpg"; + blendmap->TextureRepeats = 1.f; + + auto physics = AddComponent(water); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + { + + auto groundshape = CreateEntity(water); + auto box = AddComponent(groundshape); + box->Depth = 250.f; + box->Height = 5.f; + box->Width = 250.f; + + + CommitEntity(groundshape); + } + CommitEntity(water);*/ + } + + { + auto ground_middle = CreateEntity(); + auto transform = AddComponent(ground_middle); + auto model = AddComponent(ground_middle); + model->ModelFile = "Models/TerrainFiveIstles/Middle.obj"; + auto blendmap = AddComponent(ground_middle); + blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; + blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; + blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; + blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; + blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; + blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; + blendmap->TextureRepeats = 30.f; + + auto physics = AddComponent(ground_middle); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto groundshape = CreateEntity(ground_middle); + auto transformshape = AddComponent(groundshape); + auto meshShape = AddComponent(groundshape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Middle.obj"; + + + CommitEntity(groundshape); + CommitEntity(ground_middle); + } + + CreateBase(glm::quat(), 1); + CreateBase(glm::quat(glm::vec3(0, glm::pi(), 0)), 2); + + { + auto tree = CreateEntity(); + auto transform = AddComponent(tree); + transform->Position = glm::vec3(0, -10, 0); + + auto physics = AddComponent(tree); + physics->Mass = 100.f; + physics->MotionType = Components::Physics::MotionTypeEnum::Keyframed; + physics->CollisionEvent = false; + //physics->LinearDamping = 3.f; + physics->CalculateCenterOfMass = true; + + { + auto stem = CreateEntity(tree); + auto transform = AddComponent(stem); + transform->Position = glm::vec3(0, -2.40906f, 0); + auto model = AddComponent(stem); + model->ModelFile = "Models/Tree/Stem/Stem.obj"; + } + + { + auto leafs = CreateEntity(tree); + auto transform = AddComponent(leafs); + transform->Position = glm::vec3(0, -2.45511f, 0); + auto model = AddComponent(leafs); + model->ModelFile = "Models/Tree/Leafs/Leafs.obj"; + model->Transparent = true; + CommitEntity(leafs); + } + + { + auto shape = CreateEntity(tree); + auto transform = AddComponent(shape); + transform->Position = glm::vec3(0.f, 0.f, 0.f); + auto mesh = AddComponent(shape); + mesh->ResourceName = "Models/Tree/Collision/Collision.obj"; + + CommitEntity(shape); + } + + + /*{ + auto shape = CreateEntity(tree); + auto transform = AddComponent(shape); + auto box = AddComponent(shape); + transform->Position = glm::vec3(0.f, 0, 0.f); + box->Width = 0.296f; + box->Height = 2.511f; + box->Depth = 0.296f; + + CommitEntity(shape); + } + + { + auto shape = CreateEntity(tree); + auto transform = AddComponent(shape); + auto sphere = AddComponent(shape); + transform->Position = glm::vec3(0, 2.04506f, 0.f); + sphere->Radius = 1.389f; + + CommitEntity(shape); + }*/ + + CommitEntity(tree); + } +} + +void GameWorld::CreateBase(glm::quat orientation, int playerID) +{ + auto base = CreateEntity(); + auto transform = AddComponent(base); transform->Orientation = orientation; - auto player = AddComponent(garage); - player->ID = playerID; + + { + auto ground_small = CreateEntity(base); + auto transform = AddComponent(ground_small); + auto model = AddComponent(ground_small); + model->ModelFile = "Models/TerrainFiveIstles/Small.obj"; + auto blendmap = AddComponent(ground_small); + blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; + blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; + blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; + blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; + blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; + blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; + blendmap->TextureRepeats = 30.f; + + auto physics = AddComponent(ground_small); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto groundshape = CreateEntity(ground_small); + auto transformshape = AddComponent(groundshape); + auto meshShape = AddComponent(groundshape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Small.obj"; + CommitEntity(groundshape); + + CommitEntity(ground_small); + } + + { + auto road_small = CreateEntity(base); + auto transform = AddComponent(road_small); + auto model = AddComponent(road_small); + model->ModelFile = "Models/TerrainFiveIstles/Roads/SmallRoad.obj"; + auto physics = AddComponent(road_small); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto groundshape = CreateEntity(road_small); + auto transformshape = AddComponent(groundshape); + auto meshShape = AddComponent(groundshape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/SmallRoad.obj"; + + + CommitEntity(groundshape); + CommitEntity(road_small); + } + + { + auto terrain_base = CreateEntity(base); + auto transform = AddComponent(terrain_base); + auto model = AddComponent(terrain_base); + model->ModelFile = "Models/TerrainFiveIstles/Base.obj"; + auto blendmap = AddComponent(terrain_base); + blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; + blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; + blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; + blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; + blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; + blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; + blendmap->TextureRepeats = 30.f; + + auto physics = AddComponent(terrain_base); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto shape = CreateEntity(terrain_base); + auto transformshape = AddComponent(shape); + auto meshShape = AddComponent(shape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Base.obj"; + + + CommitEntity(shape); + CommitEntity(terrain_base); + } + + { + auto ground_base = CreateEntity(base); + auto transform = AddComponent(ground_base); + auto model = AddComponent(ground_base); + model->ModelFile = "Models/TerrainFiveIstles/BaseGround.obj"; + auto physics = AddComponent(ground_base); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto shape = CreateEntity(ground_base); + auto transformshape = AddComponent(shape); + auto meshShape = AddComponent(shape); + meshShape->ResourceName = "Models/TerrainFiveIstles/BaseGround.obj"; + + CommitEntity(shape); + CommitEntity(ground_base); + } + + { + auto road_base = CreateEntity(base); + auto transform = AddComponent(road_base); + auto model = AddComponent(road_base); + model->ModelFile = "Models/TerrainFiveIstles/Roads/BaseRoad.obj"; + auto physics = AddComponent(road_base); + physics->Mass = 10; + physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; + physics->CollisionLayer = 1; + + auto groundshape = CreateEntity(road_base); + auto transformshape = AddComponent(groundshape); + auto meshShape = AddComponent(groundshape); + meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/BaseRoad.obj"; + + + CommitEntity(groundshape); + CommitEntity(road_base); + } + + CreateGarage(base, glm::vec3(323.2f, 41.4f, -10.2f), glm::quat(glm::vec3(0, glm::pi() / 2.f, 0)), playerID); +} +EntityID GameWorld::CreateGarage(EntityID parent, glm::vec3 Position, glm::quat orientation, int playerID) +{ + auto garage = CreateEntity(parent); + auto transform = AddComponent(garage); + transform->Position = Position; + transform->Orientation = orientation; + + auto player = CreateEntity(garage); + auto playerComponent = AddComponent(player); + playerComponent->ID = playerID; auto ElevatorBase = CreateEntity(garage); { @@ -909,6 +1190,7 @@ EntityID GameWorld::CreateGarage(glm::vec3 position, glm::quat orientation, int auto transform = AddComponent(spawnPoint); transform->Position.y = 1.f; auto spawnPointComponent = AddComponent(spawnPoint); + spawnPointComponent->Player = player; } CommitEntity(spawnPoint); } @@ -960,264 +1242,3 @@ EntityID GameWorld::CreateGarage(glm::vec3 position, glm::quat orientation, int return garage; } - -void GameWorld::CreateTerrain() -{ - { - auto road_middle = CreateEntity(); - auto transform = AddComponent(road_middle); - auto model = AddComponent(road_middle); - model->ModelFile = "Models/TerrainFiveIstles/Roads/MiddleRoad.obj"; - auto physics = AddComponent(road_middle); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(road_middle); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/MiddleRoad.obj"; - - - CommitEntity(groundshape); - CommitEntity(road_middle); - } - - - - { - /*auto water = CreateEntity(); - auto transform = AddComponent(water); - transform->Position = glm::vec3(0, -35, 0); - transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); - transform->Scale = glm::vec3(5000.f, 10.f, 5000.f); - auto model = AddComponent(water); - model->ModelFile = "Models/Placeholders/PhysicsTest/Cube.obj"; - auto blendmap = AddComponent(water); - blendmap->TextureRed = "Textures/Skybox/Sky34/bottom.jpg"; - blendmap->TextureGreen = "Textures/Skybox/Sky34/bottom.jpg"; - blendmap->TextureBlue = "Textures/Skybox/Sky34/bottom.jpg"; - blendmap->TextureRepeats = 1.f; - - auto physics = AddComponent(water); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - { - - auto groundshape = CreateEntity(water); - auto box = AddComponent(groundshape); - box->Depth = 250.f; - box->Height = 5.f; - box->Width = 250.f; - - - CommitEntity(groundshape); - } - CommitEntity(water);*/ - } - - { - auto ground_middle = CreateEntity(); - auto transform = AddComponent(ground_middle); - auto model = AddComponent(ground_middle); - model->ModelFile = "Models/TerrainFiveIstles/Middle.obj"; - auto blendmap = AddComponent(ground_middle); - blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; - blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; - blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; - blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; - blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; - blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; - blendmap->TextureRepeats = 30.f; - - auto physics = AddComponent(ground_middle); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(ground_middle); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Middle.obj"; - - - CommitEntity(groundshape); - CommitEntity(ground_middle); - } - - CreateBase(glm::quat()); - CreateBase(glm::quat(glm::vec3(0, glm::pi(), 0))); - - { - auto tree = CreateEntity(); - auto transform = AddComponent(tree); - transform->Position = glm::vec3(0, -10, 0); - - auto physics = AddComponent(tree); - physics->Mass = 100.f; - physics->MotionType = Components::Physics::MotionTypeEnum::Keyframed; - physics->CollisionEvent = false; - //physics->LinearDamping = 3.f; - physics->CalculateCenterOfMass = true; - - { - auto stem = CreateEntity(tree); - auto transform = AddComponent(stem); - transform->Position = glm::vec3(0, -2.40906f, 0); - auto model = AddComponent(stem); - model->ModelFile = "Models/Tree/Stem/Stem.obj"; - } - - { - auto leafs = CreateEntity(tree); - auto transform = AddComponent(leafs); - transform->Position = glm::vec3(0, -2.45511f, 0); - auto model = AddComponent(leafs); - model->ModelFile = "Models/Tree/Leafs/Leafs.obj"; - model->Transparent = true; - CommitEntity(leafs); - } - - { - auto shape = CreateEntity(tree); - auto transform = AddComponent(shape); - transform->Position = glm::vec3(0.f, 0.f, 0.f); - auto mesh = AddComponent(shape); - mesh->ResourceName = "Models/Tree/Collision/Collision.obj"; - - CommitEntity(shape); - } - - - /*{ - auto shape = CreateEntity(tree); - auto transform = AddComponent(shape); - auto box = AddComponent(shape); - transform->Position = glm::vec3(0.f, 0, 0.f); - box->Width = 0.296f; - box->Height = 2.511f; - box->Depth = 0.296f; - - CommitEntity(shape); - } - - { - auto shape = CreateEntity(tree); - auto transform = AddComponent(shape); - auto sphere = AddComponent(shape); - transform->Position = glm::vec3(0, 2.04506f, 0.f); - sphere->Radius = 1.389f; - - CommitEntity(shape); - }*/ - - CommitEntity(tree); - } -} - -void GameWorld::CreateBase(glm::quat orientation) -{ - { - auto ground_small = CreateEntity(); - auto transform = AddComponent(ground_small); - transform->Orientation = orientation; - auto model = AddComponent(ground_small); - model->ModelFile = "Models/TerrainFiveIstles/Small.obj"; - auto blendmap = AddComponent(ground_small); - blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; - blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; - blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; - blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; - blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; - blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; - blendmap->TextureRepeats = 30.f; - - auto physics = AddComponent(ground_small); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(ground_small); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Small.obj"; - CommitEntity(groundshape); - - CommitEntity(ground_small); - } - - { - auto ground_base = CreateEntity(); - auto transform = AddComponent(ground_base); - transform->Orientation = orientation; - auto model = AddComponent(ground_base); - model->ModelFile = "Models/TerrainFiveIstles/Base.obj"; - auto blendmap = AddComponent(ground_base); - blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; - blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; - blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; - blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; - blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; - blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; - blendmap->TextureRepeats = 30.f; - - auto physics = AddComponent(ground_base); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(ground_base); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Base.obj"; - - - CommitEntity(groundshape); - CommitEntity(ground_base); - } - - { - auto road_base = CreateEntity(); - auto transform = AddComponent(road_base); - transform->Orientation = orientation; - auto model = AddComponent(road_base); - model->ModelFile = "Models/TerrainFiveIstles/Roads/BaseRoad.obj"; - auto physics = AddComponent(road_base); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(road_base); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/BaseRoad.obj"; - - - CommitEntity(groundshape); - CommitEntity(road_base); - } - - { - auto road_small = CreateEntity(); - auto transform = AddComponent(road_small); - transform->Orientation = orientation; - auto model = AddComponent(road_small); - model->ModelFile = "Models/TerrainFiveIstles/Roads/SmallRoad.obj"; - auto physics = AddComponent(road_small); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(road_small); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Roads/SmallRoad.obj"; - - - CommitEntity(groundshape); - CommitEntity(road_small); - } - - CreateGarage(glm::vec3(323.2f, 41.4f, -10.2f), glm::quat(glm::vec3(0, glm::pi(), 0)), 1); // glm::vec3(0, glm::pi()/2.f, 0) -} \ No newline at end of file diff --git a/src/GameWorld.h b/src/GameWorld.h index 66dde65..20b3e98 100755 --- a/src/GameWorld.h +++ b/src/GameWorld.h @@ -82,9 +82,9 @@ private: void AddTankWheelPair(EntityID tankEntity, glm::vec3 position, int axleID, bool steering); EntityID CreateJeep(int playerID); EntityID CreateWall(glm::vec3 pos, glm::quat orientation); - EntityID CreateGarage(glm::vec3 Position, glm::quat orientation, int playerID); + EntityID CreateGarage(EntityID parent, glm::vec3 Position, glm::quat orientation, int playerID); void CreateTerrain(); - void CreateBase(glm::quat orientation); + void CreateBase(glm::quat orientation, int playerID); std::vector m_WallDebrisTemplates; }; diff --git a/src/Systems/PhysicsSystem.cpp b/src/Systems/PhysicsSystem.cpp index 1e8e2dd..3db178b 100644 --- a/src/Systems/PhysicsSystem.cpp +++ b/src/Systems/PhysicsSystem.cpp @@ -300,7 +300,7 @@ void Systems::PhysicsSystem::UpdateEntity(double dt, EntityID entity, EntityID p auto absoluteTransformParent = m_World->GetSystem()->AbsoluteTransform(parent); transformComponent->Position -= absoluteTransformParent.Position; transformComponent->Position = transformComponent->Position * absoluteTransformParent.Orientation; - transformComponent->Orientation = absoluteTransformParent.Orientation * glm::inverse(transformComponent->Orientation); + transformComponent->Orientation = glm::inverse(absoluteTransformParent.Orientation) * transformComponent->Orientation; } } diff --git a/src/Systems/TankSteeringSystem.cpp b/src/Systems/TankSteeringSystem.cpp index e140f49..4bd4c91 100644 --- a/src/Systems/TankSteeringSystem.cpp +++ b/src/Systems/TankSteeringSystem.cpp @@ -300,11 +300,11 @@ bool Systems::TankSteeringSystem::OnSpawnVehicle(const Events::SpawnVehicle &eve return false; } - for (auto &spawnPointComponent : *spawnPointComponents) + for (auto &component : *spawnPointComponents) { - auto spawnPoint = spawnPointComponent->Entity; - auto spawnPointBaseParent = m_World->GetEntityBaseParent(spawnPoint); - auto playerComponent = m_World->GetComponent(spawnPointBaseParent); + auto spawnPoint = component->Entity; + auto spawnPointComponent = std::dynamic_pointer_cast(component); + auto playerComponent = m_World->GetComponent(spawnPointComponent->Player); if (!playerComponent || playerComponent->ID != event.PlayerID) continue;