Skip to content

Commit

Permalink
Object OldMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed May 5, 2024
1 parent 274af92 commit bad63e6
Show file tree
Hide file tree
Showing 45 changed files with 64 additions and 67 deletions.
11 changes: 0 additions & 11 deletions Drizzle3D/AppEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,4 @@ namespace Drizzle3D {

Drizzle3D_API EventType GetEventType() override { return EventType::AppRender; }
};

class ObjectColliderEvent : public Event {
public:
Drizzle3D_API ObjectColliderEvent(std::vector<std::string> col) : collided(col) {};

Drizzle3D_API std::vector<std::string> GetColliders() { return collided; }

Drizzle3D_API EventType GetEventType() override { return EventType::Collided; }
private:
std::vector<std::string> collided;
};
}
1 change: 1 addition & 0 deletions Drizzle3D/Drizzle3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<ClInclude Include="Material.h" />
<ClInclude Include="MouseCodes.h" />
<ClInclude Include="MouseEvent.h" />
<ClInclude Include="Object.h" />
<ClInclude Include="RenderingLayer.h" />
<ClInclude Include="Renderer2D.h" />
<ClInclude Include="ResourceManager.h" />
Expand Down
6 changes: 6 additions & 0 deletions Drizzle3D/Drizzle3D.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
<Filter Include="Source Files\Collision Detection">
<UniqueIdentifier>{76336790-ba92-4533-91f2-2883e3ab2e66}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Events\Object">
<UniqueIdentifier>{a959947f-5085-4240-adf6-a20f1de36bbc}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
Expand Down Expand Up @@ -290,5 +293,8 @@
<ClInclude Include="CollisionDetection.h">
<Filter>Source Files\Collision Detection</Filter>
</ClInclude>
<ClInclude Include="Object.h">
<Filter>Source Files\Events\Object</Filter>
</ClInclude>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Drizzle3D/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Drizzle3D {
AppTick, AppUpdate, AppRender,
KeyPressed, KeyReleased,
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled,
Collided
ObjectMoved
};

class Event {
Expand Down
18 changes: 18 additions & 0 deletions Drizzle3D/Object.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once
#include "Events.h"
#include <glm/glm.hpp>

namespace Drizzle3D {
class ObjectMovedEvent : public Event {
public:
Drizzle3D_API ObjectMovedEvent(glm::mat4 mM, glm::mat4 OldmM) : modelMatrix(mM), OldmodelMatrix(OldmM) {};

Drizzle3D_API glm::mat4 GetModelMatrix() { return modelMatrix; }
Drizzle3D_API glm::mat4 GetOldModelMatrix() { return OldmodelMatrix; }

Drizzle3D_API EventType GetEventType() override { return EventType::ObjectMoved; }
private:
glm::mat4 modelMatrix;
glm::mat4 OldmodelMatrix;
};
}
1 change: 1 addition & 0 deletions Drizzle3D/RenderingLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace Drizzle3D {
std::vector<float> vertices;
std::vector<unsigned int> indices;
glm::mat4 modelMatrix;
glm::mat4 OldmodelMatrix;
GLuint textureID = NULL;
GLuint mat = 0;
char* name = (char*)"PLZ_SPECIFY_A_NAME";
Expand Down
51 changes: 26 additions & 25 deletions Drizzle3D/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ namespace Drizzle3D {
std::unique_ptr<KeyPressedEvent> at = std::make_unique<KeyPressedEvent>((KeyCode)key);
dispatcher->AddEvent(std::move(at));
}
/*if (glfwGetKey(window, key) == GLFW_RELEASE) {
if (glfwGetKey(window, key) == GLFW_RELEASE) {
std::unique_ptr<KeyReleasedEvent> at = std::make_unique<KeyReleasedEvent>((KeyCode)key);
dispatcher->AddEvent(std::move(at));
}*/
}
}

int blef = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT);
Expand All @@ -116,79 +116,79 @@ namespace Drizzle3D {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>(((MouseCode)blef));
dispatcher->AddEvent(std::move(at));
}
/*else if (blef == GLFW_RELEASE) {
else if (blef == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)blef);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bmid == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bmid);
dispatcher->AddEvent(std::move(at));
}
/*else if (bmid == GLFW_RELEASE) {
else if (bmid == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bmid);
dispatcher->AddEvent(std::move(at));
}*/
}

if (brig == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)brig);
dispatcher->AddEvent(std::move(at));
}
/*else if (brig == GLFW_RELEASE) {
else if (brig == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)brig);
dispatcher->AddEvent(std::move(at));
}*/
}

if (blas == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)blas);
dispatcher->AddEvent(std::move(at));
}
/*else if (blas == GLFW_RELEASE) {
else if (blas == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)blas);
dispatcher->AddEvent(std::move(at));
}*/
}

if (beig == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)beig);
dispatcher->AddEvent(std::move(at));
}
/*else if (beig == GLFW_RELEASE) {
else if (beig == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)beig);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bsev == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bsev);
dispatcher->AddEvent(std::move(at));
}
/*else if (bsev == GLFW_RELEASE) {
else if (bsev == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bsev);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bsix == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bsix);
dispatcher->AddEvent(std::move(at));
}
/*else if (bsix == GLFW_RELEASE) {
else if (bsix == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bsix);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bfiv == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bfiv);
dispatcher->AddEvent(std::move(at));
}
/*else if (bfiv == GLFW_RELEASE) {
else if (bfiv == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bfiv);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bfor == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bfor);
dispatcher->AddEvent(std::move(at));
}
/*else if (bfor == GLFW_RELEASE) {
else if (bfor == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bfor);
dispatcher->AddEvent(std::move(at));
}
Expand All @@ -197,28 +197,28 @@ namespace Drizzle3D {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)btre);
dispatcher->AddEvent(std::move(at));
}
/*else if (btre == GLFW_RELEASE) {
else if (btre == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)btre);
dispatcher->AddEvent(std::move(at));
}*/
}

if (btwo == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)btwo);
dispatcher->AddEvent(std::move(at));
}
/*else if (btwo == GLFW_RELEASE) {
else if (btwo == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)btwo);
dispatcher->AddEvent(std::move(at));
}*/
}

if (bone == GLFW_PRESS) {
std::unique_ptr<MouseButtonPressedEvent> at = std::make_unique<MouseButtonPressedEvent>((MouseCode)bone);
dispatcher->AddEvent(std::move(at));
}
/*else if (bone == GLFW_RELEASE) {
else if (bone == GLFW_RELEASE) {
std::unique_ptr<MouseButtonReleasedEvent> at = std::make_unique<MouseButtonReleasedEvent>((MouseCode)bone);
dispatcher->AddEvent(std::move(at));
}*/
}

// Check mouse movement
double mouseX, mouseY;
Expand All @@ -238,5 +238,6 @@ namespace Drizzle3D {
}

void Window::Render() {

}
}
Binary file modified Drizzle3D/x64/Debug/App.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Camera.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/CollisionDetection.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.ilk
Binary file not shown.
23 changes: 0 additions & 23 deletions Drizzle3D/x64/Debug/Drizzle3D.log
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
Scanning sources for module dependencies...
App.cpp
Camera.cpp
CollisionDetection.cpp
FirstPersonCamera.cpp
ImGuiLayer.cpp
Layer.cpp
Light.cpp
D:\Drizzle3D\Drizzle3D\Light.cpp(13,16): warning C4244: '=': conversion from 'float' to 'int', possible loss of data
main.cpp
Object.cpp
OpenGL.cpp
D:\Drizzle3D\Drizzle3D\OpenGL.cpp(184,59): warning C4267: 'argument': conversion from 'size_t' to 'GLsizei', possible loss of data
RenderingLayer.cpp
Renderer2D.cpp
Shader.cpp
Skybox.cpp
Vulkan.cpp
Window.cpp
Generating Code...
D:\Drizzle3D\Drizzle3D\RenderingLayer.cpp(192,1): warning C4715: 'Drizzle3D::RenderingLayer::GetTexture': not all control paths return a value
D:\Drizzle3D\Drizzle3D\Camera.cpp(46,1): warning C4715: 'Drizzle3D::RenderingLayer::ReturnActiveCamera': not all control paths return a value
D:\Drizzle3D\Drizzle3D\Camera.cpp(54,1): warning C4715: 'Drizzle3D::RenderingLayer::GetCameraFromID': not all control paths return a value
Creating library D:\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.lib and object D:\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Drizzle3D.vcxproj -> D:\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.dll
D:\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.dll
1 File(s) copied
Loading

0 comments on commit bad63e6

Please sign in to comment.