diff --git a/src/GUI/GameFrame.h b/src/GUI/GameFrame.h index c09239f..b0d446a 100644 --- a/src/GUI/GameFrame.h +++ b/src/GUI/GameFrame.h @@ -26,12 +26,14 @@ public: vp1->X = 0; vp1->Width = this->Width / 2.f; //new PlayerHUD(vp1, "PlayerHUD", m_World, 1); - auto vehicleSelection = new VehicleSelection(vp1, "VehicleSelection", m_World, 1); + new VehicleSelection(vp1, "VehicleSelection", m_World, 1); vp2 = new Viewport(worldFrame, "Viewport2", m_World); vp2->X = vp1->Right(); vp2->Width = this->Width / 2.f; //new PlayerHUD(vp2, "PlayerHUD", m_World, 2); + new VehicleSelection(vp2, "VehicleSelection", m_World, 2); + m_FreeCamViewport = new Viewport(worldFrame, "ViewportFreeCam", m_World); m_FreeCamViewport->Hide(); diff --git a/src/GameWorld.cpp b/src/GameWorld.cpp index 698e6f6..6490f44 100755 --- a/src/GameWorld.cpp +++ b/src/GameWorld.cpp @@ -91,322 +91,7 @@ void GameWorld::Initialize() EventBroker->Publish(e); } - { - auto road_base = CreateEntity(); - auto transform = AddComponent(road_base); - transform->Position = glm::vec3(0, -50, 0); - 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_middle = CreateEntity(); - auto transform = AddComponent(road_middle); - transform->Position = glm::vec3(0, -50, 0); - 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 road_small = CreateEntity(); - auto transform = AddComponent(road_small); - transform->Position = glm::vec3(0, -50, 0); - 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 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); - transform->Position = glm::vec3(0, -50, 0); - transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); - 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); - } - - { - auto ground_small = CreateEntity(); - auto transform = AddComponent(ground_small); - transform->Position = glm::vec3(0, -50, 0); - transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); - 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_small_mirrored = CreateEntity(); - auto transform = AddComponent(ground_small_mirrored); - transform->Position = glm::vec3(0, -50, 0); - transform->Orientation = glm::angleAxis(glm::radians(180.f), glm::vec3(0, 1, 0)); - auto model = AddComponent(ground_small_mirrored); - model->ModelFile = "Models/TerrainFiveIstles/Small.obj"; - auto blendmap = AddComponent(ground_small_mirrored); - 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_mirrored); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(ground_small_mirrored); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Small.obj"; - - - CommitEntity(groundshape); - CommitEntity(ground_small_mirrored); - } - - { - auto ground_base = CreateEntity(); - auto transform = AddComponent(ground_base); - transform->Position = glm::vec3(0, -50, 0); - transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); - 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 ground_base_mirrored = CreateEntity(); - auto transform = AddComponent(ground_base_mirrored); - transform->Position = glm::vec3(0, -50, 0); - transform->Orientation = glm::angleAxis(glm::radians(180.f), glm::vec3(0, 1, 0)); - auto model = AddComponent(ground_base_mirrored); - model->ModelFile = "Models/TerrainFiveIstles/Base.obj"; - auto blendmap = AddComponent(ground_base_mirrored); - 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_mirrored); - physics->Mass = 10; - physics->MotionType = Components::Physics::MotionTypeEnum::Fixed; - physics->CollisionLayer = 1; - - auto groundshape = CreateEntity(ground_base_mirrored); - auto transformshape = AddComponent(groundshape); - auto meshShape = AddComponent(groundshape); - meshShape->ResourceName = "Models/TerrainFiveIstles/Base.obj"; - - - CommitEntity(groundshape); - CommitEntity(ground_base_mirrored); - } - - { - 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); - } + //CreateTerrain(); #pragma region Wall_Debris_Template @@ -616,7 +301,8 @@ void GameWorld::Initialize() EventBroker->Publish(e); }*/ - CreateGarage(glm::vec3(-3.93076, 0, 0), 1); + CreateGarage(glm::vec3(323.2f, 41.4f, -10.2f), glm::quat(), 1); // glm::vec3(0, glm::pi()/2.f, 0) + CreateGarage(glm::vec3(-323.2f, 41.4f, -10.2f), glm::quat(), 2); // glm::vec3(0, -glm::pi()/2.f, 0) { auto flag = CreateEntity(); @@ -1104,11 +790,12 @@ EntityID GameWorld::CreateJeep(int playerID) return jeep; } -EntityID GameWorld::CreateGarage(glm::vec3 Position, int playerID) +EntityID GameWorld::CreateGarage(glm::vec3 position, glm::quat orientation, int playerID) { auto garage = CreateEntity(); auto transform = AddComponent(garage); - transform->Position = Position; + transform->Position = position; + transform->Orientation = orientation; auto player = AddComponent(garage); player->ID = playerID; @@ -1273,4 +960,263 @@ EntityID GameWorld::CreateGarage(glm::vec3 Position, int playerID) } 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()/2.f, 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); + } } \ No newline at end of file diff --git a/src/GameWorld.h b/src/GameWorld.h index 52bdb91..66dde65 100755 --- a/src/GameWorld.h +++ b/src/GameWorld.h @@ -82,7 +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, int playerID); + EntityID CreateGarage(glm::vec3 Position, glm::quat orientation, int playerID); + void CreateTerrain(); + void CreateBase(glm::quat orientation); std::vector m_WallDebrisTemplates; }; diff --git a/src/Systems/PhysicsSystem.cpp b/src/Systems/PhysicsSystem.cpp index cba6c39..465e498 100644 --- a/src/Systems/PhysicsSystem.cpp +++ b/src/Systems/PhysicsSystem.cpp @@ -80,7 +80,7 @@ void Systems::PhysicsSystem::Initialize() worldInfo.m_broadPhaseBorderBehaviour = hkpWorldCinfo::BROADPHASE_BORDER_FIX_ENTITY; // You must specify the size of the broad phase - objects should not be simulated outside this region - worldInfo.setBroadPhaseWorldSize(500.0f); + worldInfo.setBroadPhaseWorldSize(1000.0f); m_PhysicsWorld = new hkpWorld(worldInfo); // When the simulation type is SIMULATION_TYPE_MULTITHREADED, in the debug build, the sdk performs checks