From ee2f7fcecf8d22189cb6f78b73af9431dd3dfbfd Mon Sep 17 00:00:00 2001 From: Tleety Date: Sat, 31 May 2014 01:11:14 +0200 Subject: [PATCH] Added some water to see how it looks --- assets | 2 +- src/GameWorld.cpp | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/assets b/assets index 74035fa..e7ff07b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 74035fae2626e2e62f803cd7d9817d1e47353f69 +Subproject commit e7ff07be10092507ff1aff17a3041d4c00aa46e1 diff --git a/src/GameWorld.cpp b/src/GameWorld.cpp index 27fa9fd..c752f4e 100755 --- a/src/GameWorld.cpp +++ b/src/GameWorld.cpp @@ -98,6 +98,41 @@ void GameWorld::Initialize() // CommitEntity(ground); //} + { + 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/Ground/WaterPlain0017_6_S.jpg"; + blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; + blendmap->TextureGreen = "Textures/Ground/WaterPlain0017_6_S.jpg"; + blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; + blendmap->TextureBlue = "Textures/Ground/WaterPlain0017_6_S.png"; + blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; + blendmap->TextureRepeats = 400.f; + + auto physics = AddComponent(water); + physics->Mass = 10; + physics->Static = true; + 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); @@ -107,9 +142,9 @@ void GameWorld::Initialize() model->ModelFile = "Models/TerrainFiveIstles/Middle.obj"; auto blendmap = AddComponent(ground_middle); blendmap->TextureRed = "Textures/Ground/SoilBeach0087_11_S.jpg"; - blendmap->TextureBlueNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; + blendmap->TextureRedNormal = "Textures/Ground/SoilBeach0087_11_SNM.png"; blendmap->TextureGreen = "Textures/Ground/Grass0126_2_S.jpg"; - blendmap->TextureBlueNormal = "Textures/Ground/Grass0126_2_SNM.png"; + blendmap->TextureGreenNormal = "Textures/Ground/Grass0126_2_SNM.png"; blendmap->TextureBlue = "Textures/Ground/Cliffs2.png"; blendmap->TextureBlueNormal = "Textures/Ground/Cliffs2NM.png"; blendmap->TextureRepeats = 30.f;