-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directional, point and spot light rendering
- Loading branch information
Showing
11 changed files
with
147 additions
and
43 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
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
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,42 @@ | ||
#include "TransformComponent.h" | ||
|
||
#define GLM_ENABLE_EXPERIMENTAL | ||
#include <glm/gtc/matrix_transform.hpp> | ||
#include <glm/gtx/quaternion.hpp> | ||
|
||
namespace sl | ||
{ | ||
|
||
glm::vec3 TransformComponent::GetRotationDegrees() const | ||
{ | ||
return glm::degrees(m_rotation); | ||
} | ||
|
||
void TransformComponent::SetRotationDegrees(const glm::vec3 °rees) | ||
{ | ||
m_rotation = glm::radians(degrees); | ||
} | ||
|
||
glm::mat4 TransformComponent::GetTranslate() const | ||
{ | ||
return glm::translate(glm::mat4{ 1.0f }, m_position); | ||
} | ||
|
||
glm::mat4 TransformComponent::GetRotate() const | ||
{ | ||
return glm::toMat4(glm::quat(m_rotation)); | ||
} | ||
|
||
glm::mat4 TransformComponent::GetScale() const | ||
{ | ||
return glm::scale(glm::mat4{ 1.0f }, m_scale); | ||
} | ||
|
||
glm::mat4 TransformComponent::GetTransform() const | ||
{ | ||
return glm::translate(glm::mat4{ 1.0f }, m_position) * | ||
glm::toMat4(glm::quat(m_rotation)) * | ||
glm::scale(glm::mat4{ 1.0f }, m_scale); | ||
} | ||
|
||
} // namespace sl |
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