-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working light and did some fixes (#70)
* Merged mesh factory branch to main * Working Vertex buffer class that replaces vk::VulkanModel to contains the vertices of the mesh * Working index buffers and added mesh class that contains both the vertex and index buffers * Working mesh class can also now load 3D models and work with new vertex and index buffers as well * Working diffuse shading and fake point lighting working, with some modifications to the renderer instead of taking a vector, it takes in an unordered_map for ease of use when rendering * Fixed error with float, small fix * Udating editor scene and a bit of the renderer --------- Co-authored-by: ZacharyH777 <[email protected]>
- Loading branch information
1 parent
cd93009
commit 403996f
Showing
7 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include <glm/glm.hpp> | ||
#include <glm/gtc/type_ptr.hpp> | ||
|
||
#define GLM_ENABLE_EXPERIMENTAL | ||
#include <glm/gtx/quaternion.hpp> | ||
|
||
namespace engine3d{ | ||
// glm::quat<glm::vec2> ToQuat() | ||
glm::vec4 ToQuat(glm::vec3 p_EulerAngles); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <Math/Math.hpp> | ||
|
||
namespace engine3d{ | ||
glm::vec4 ToQuat(glm::vec3 p_EulerAngles){ | ||
glm::vec4 quaternion; | ||
glm::vec3 c = glm::cos(p_EulerAngles * float(0.5)); | ||
glm::vec3 s = glm::sin(p_EulerAngles * float(0.5)); | ||
|
||
quaternion.w = c.x * c.y * c.z + s.x * s.y * s.z; | ||
quaternion.x = s.x * c.y * c.z - c.x * s.y * s.z; | ||
quaternion.y = c.x * s.y * c.z + s.x * c.y * s.z; | ||
quaternion.z = c.x * c.y * s.z - s.x * s.y * c.z; | ||
|
||
return quaternion; | ||
} | ||
}; |