diff --git a/Debug/grk-cw9.exe b/Debug/grk-cw9.exe index 0844d2c..78e7309 100644 Binary files a/Debug/grk-cw9.exe and b/Debug/grk-cw9.exe differ diff --git a/Debug/grk-cw9.pdb b/Debug/grk-cw9.pdb index 7dbb16a..2924afe 100644 Binary files a/Debug/grk-cw9.pdb and b/Debug/grk-cw9.pdb differ diff --git a/cw 9/Debug/Box.obj b/cw 9/Debug/Box.obj index 4339345..8b508e3 100644 Binary files a/cw 9/Debug/Box.obj and b/cw 9/Debug/Box.obj differ diff --git a/cw 9/Debug/Camera.obj b/cw 9/Debug/Camera.obj index 32b1476..df5313c 100644 Binary files a/cw 9/Debug/Camera.obj and b/cw 9/Debug/Camera.obj differ diff --git a/cw 9/Debug/Render_Utils.obj b/cw 9/Debug/Render_Utils.obj index 3b97c1a..a6d66ef 100644 Binary files a/cw 9/Debug/Render_Utils.obj and b/cw 9/Debug/Render_Utils.obj differ diff --git a/cw 9/Debug/SOIL.obj b/cw 9/Debug/SOIL.obj index 6a8425c..4f55593 100644 Binary files a/cw 9/Debug/SOIL.obj and b/cw 9/Debug/SOIL.obj differ diff --git a/cw 9/Debug/Shader_Loader.obj b/cw 9/Debug/Shader_Loader.obj index a110311..2ac1e05 100644 Binary files a/cw 9/Debug/Shader_Loader.obj and b/cw 9/Debug/Shader_Loader.obj differ diff --git a/cw 9/Debug/Texture.obj b/cw 9/Debug/Texture.obj index ad6d3ef..8025fe9 100644 Binary files a/cw 9/Debug/Texture.obj and b/cw 9/Debug/Texture.obj differ diff --git a/cw 9/Debug/grk-cw9.exe.recipe b/cw 9/Debug/grk-cw9.exe.recipe index 74c2664..8d3768d 100644 --- a/cw 9/Debug/grk-cw9.exe.recipe +++ b/cw 9/Debug/grk-cw9.exe.recipe @@ -2,7 +2,7 @@ - C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\Debug\grk-cw9.exe + C:\Users\walcz\Desktop\GRK_Project2\Debug\grk-cw9.exe diff --git a/cw 9/Debug/grk-cw9.log b/cw 9/Debug/grk-cw9.log index 6e50456..2406ca0 100644 --- a/cw 9/Debug/grk-cw9.log +++ b/cw 9/Debug/grk-cw9.log @@ -1,65 +1 @@ - main.cpp -C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(242,30): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(259,17): warning C4101: 'data': unreferenced local variable -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(284,38): warning C4305: '=': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(313,16): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(507,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(523,98): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(526,68): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(587,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(588,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(589,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(592,31): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(593,25): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(648,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(649,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(650,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(653,31): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(654,25): warning C4305: 'initializing': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(730,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(738,108): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(746,87): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(746,223): warning C4305: 'argument': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(749,59): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(750,37): warning C4305: 'argument': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(782,2): warning C4305: 'argument': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(875,108): warning C4305: 'argument': truncation from 'double' to 'T' - with - [ - T=float - ] -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(1112,21): warning C4305: '-=': truncation from 'double' to 'float' -C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(1114,21): warning C4305: '+=': truncation from 'double' to 'float' -Box.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification -LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library - grk-cw9.vcxproj -> C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\Debug\grk-cw9.exe + grk-cw9.vcxproj -> C:\Users\walcz\Desktop\GRK_Project2\Debug\grk-cw9.exe diff --git a/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog index b36515d..b50a84d 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog index 7e6465b..aa4f2cb 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog index 2ac8ac7..7100417 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate b/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate index 7532145..23b2b4f 100644 --- a/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate +++ b/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate @@ -1,2 +1,2 @@ PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.30.30705:TargetPlatformVersion=10.0.19041.0: -Debug|Win32|C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\| +Debug|Win32|C:\Users\walcz\Desktop\GRK_Project2\| diff --git a/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog index d96ec4e..a2ab311 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog index ca2d226..1cc712c 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog index 369ee51..84f5c62 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog differ diff --git a/cw 9/Debug/image_DXT.obj b/cw 9/Debug/image_DXT.obj index d1c4f61..aa3157d 100644 Binary files a/cw 9/Debug/image_DXT.obj and b/cw 9/Debug/image_DXT.obj differ diff --git a/cw 9/Debug/image_helper.obj b/cw 9/Debug/image_helper.obj index 42cfa2f..9ee32a0 100644 Binary files a/cw 9/Debug/image_helper.obj and b/cw 9/Debug/image_helper.obj differ diff --git a/cw 9/Debug/main.obj b/cw 9/Debug/main.obj index 514d869..c82690f 100644 Binary files a/cw 9/Debug/main.obj and b/cw 9/Debug/main.obj differ diff --git a/cw 9/Debug/stb_image_aug.obj b/cw 9/Debug/stb_image_aug.obj index fd04a2e..8e190ee 100644 Binary files a/cw 9/Debug/stb_image_aug.obj and b/cw 9/Debug/stb_image_aug.obj differ diff --git a/cw 9/src/ex_9_1.hpp b/cw 9/src/ex_9_1.hpp index ca5d491..d205f90 100644 --- a/cw 9/src/ex_9_1.hpp +++ b/cw 9/src/ex_9_1.hpp @@ -210,6 +210,11 @@ glm::vec3 bubbleOriginalLocation[bubbleQuantity]; bool bubbleZdir[bubbleQuantity]; bool bubbleXdir[bubbleQuantity]; +CONST int bubblenumber = 1; +glm::vec3 bubbleLocationInRoom[bubblenumber]; +glm::vec3 bubbleOriginalLocationInRoom[bubblenumber]; +bool bubbleZdirInRoom[bubblenumber]; +bool bubbleXdirInRoom[bubblenumber]; @@ -243,6 +248,8 @@ float lastTime = -1.f; float deltaTime = 0.f; void bubbleManager(); +void bubbleManagerInRoom(); + unsigned int loadSkybox(std::vector faces) { @@ -637,14 +644,78 @@ void bubbleMovement(int i) { } +void bubbleMovementInRoom(int i) { + + float bubbleWobblingDivider = 100; + + int x = floor(bubbleLocationInRoom[i].x); + int y = floor(bubbleLocationInRoom[i].y); + int z = floor(bubbleLocationInRoom[i].z); + + + float bubbleWobbling = 0.0005; + float bubbleDown = 0.05; + + //printf(xDir ? "true\n" : "false\n"); + //printf(zDir ? "true\n" : "false\n"); + + if (bubbleLocationInRoom[i].x >= bubbleOriginalLocationInRoom[i].x + bubbleWobbling * bubbleWobblingDivider) { + + bubbleXdirInRoom[i] = false; + //printf("herex1\n"); + } + else if (bubbleLocationInRoom[i].x < bubbleOriginalLocationInRoom[i].x - bubbleWobbling * bubbleWobblingDivider) { + bubbleXdirInRoom[i] = true; + //printf("herex2\n"); + } + + if (bubbleLocationInRoom[i].z >= bubbleOriginalLocationInRoom[i].z + bubbleWobbling * bubbleWobblingDivider) { + bubbleZdirInRoom[i] = false; + } + else if (bubbleLocationInRoom[i].z < bubbleOriginalLocationInRoom[i].z - bubbleWobbling * bubbleWobblingDivider) { + bubbleZdir[i] = true; + } + bubbleZdirInRoom[i] = false; + bubbleXdirInRoom[i] = false; + + if (bubbleXdirInRoom[i]) { + bubbleLocation[i].x += bubbleWobbling; + } + else { + bubbleLocationInRoom[i].x -= bubbleWobbling; + } + + if (bubbleZdirInRoom[i]) { + bubbleLocation[i].z += bubbleWobbling; + } + else { + bubbleLocationInRoom[i].z -= bubbleWobbling; + } + //if (y <= -10.0) { + // bubbleLocationInRoom[i].y = 10.0; + //} + //if (x > (-1.0 + 0.5) && x <= (-1.0 - 0.5) && z > (-1.2 + 0.5) && z <= (-1.2 - 0.5) && y > (1.0 + 2.36)) { + //bubbleLocationInRoom[i].y = 4.0; + + //} + if (x <= (-1.0 + 2.9) && x > (-1.0 - 2.9) && z <= (-1.2 + 3.2) && z > (-1.2 - 3.2) && y <= (1.0 + 2.36)) { + if (x > (0 + 0.01) || x <= (0 - 0.01) || z > (0 + 0.01) || z <= (0 - 0.01) || y > 2 || y <= 0) + { + bubbleLocationInRoom[i].y = 3; + } + } + + + bubbleLocationInRoom[i].y -= bubbleDown; + + +} void bubbleManager() { - - for (int i = 0; i < bubbleQuantity; i++) { bubbleMovement(i); - + glm::mat4 modelMatrix = glm::translate(bubbleLocation[i]); // Scaling models glm::vec3 scale = glm::vec3(0.01, 0.04, 0.02); @@ -653,16 +724,34 @@ void bubbleManager() { drawObjectTex(bubbleContext, modelMatrix, 0, 0, texture::water); //drawBubbleColor(bubbleContext, modelMatrix, glm::vec3(.3f, .55f, 0.96f)); // srand(time(NULL)); + float MAX_NUM = 20.0; - //bubbleLocation[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + bubbleLocation[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; bubbleLocation[i].y = (((float)rand() / (float)(RAND_MAX)) * 10) - 5; - //bubbleLocation[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + bubbleLocation[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; bubbleOriginalLocation[i] = bubbleLocation[i]; bubbleZdir[i] = true; bubbleXdir[i] = false; + + } +} + +void bubbleManagerInRoom() { + for (int j = 0;j < bubblenumber; j++) { + bubbleMovementInRoom(j); + + glm::mat4 modelMatrix = glm::translate(bubbleLocationInRoom[j]); + // Scaling models + glm::vec3 scale = glm::vec3(0.01, 0.04, 0.02); + modelMatrix = glm::scale(modelMatrix, scale); + //glUseProgram(programTex); + drawObjectTex(bubbleContext, modelMatrix, 0, 0, texture::water); + //drawBubbleColor(bubbleContext, modelMatrix, glm::vec3(.3f, .55f, 0.96f)); + // srand(time(NULL)); + } } @@ -781,6 +870,7 @@ void renderScene(GLFWwindow* window) Core::DrawContext(models::testContext);*/ bubbleManager(); + bubbleManagerInRoom(); glUseProgram(0); glfwSwapBuffers(window); } @@ -1040,6 +1130,18 @@ void processInput(GLFWwindow* window) bubbleXdir[i] = false; } } + if (glfwGetKey(window, GLFW_KEY_B) == GLFW_PRESS) { + for (int j = 0; j < bubblenumber;j++) { + bubbleLocationInRoom[j].x = (float)rand() / (float)(RAND_MAX); + bubbleLocationInRoom[j].z = (float)rand() / (float)(RAND_MAX); + bubbleLocationInRoom[j].y = (int)rand() % (int)(3.0 - 2.5 + 1) + 2.5; + + bubbleOriginalLocationInRoom[j] = bubbleLocationInRoom[j]; + + bubbleZdirInRoom[j] = true; + bubbleXdirInRoom[j] = false; + } + } cameraDir = spaceshipDir; cameraPos = newSpaceshipPos - 0.5 * spaceshipDir + glm::vec3(0, 1, 0) * 0.2f;