Introduce Math.hpp and use typedef to make replacing glm with something else in the future simpler
This commit is contained in:
@@ -25,7 +25,7 @@ namespace openVulkanoCpp::Scene
|
||||
void Node::Init()
|
||||
{
|
||||
if (parent || scene || !children.empty() || !drawables.empty()) throw std::runtime_error("Node already initialized");
|
||||
localMat = worldMat = glm::mat4x4(1);
|
||||
localMat = worldMat = Math::Matrix4f(1);
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
@@ -79,13 +79,13 @@ namespace openVulkanoCpp::Scene
|
||||
Utils::Remove(drawables, drawable);
|
||||
}
|
||||
|
||||
void Node::SetMatrix(glm::mat4x4 mat)
|
||||
void Node::SetMatrix(const Math::Matrix4f& mat)
|
||||
{
|
||||
localMat = mat;
|
||||
UpdateWorldMatrix(parent ? parent->GetWorldMatrix() : glm::mat4x4(1));
|
||||
UpdateWorldMatrix(parent ? parent->GetWorldMatrix() : Math::Matrix4f(1));
|
||||
}
|
||||
|
||||
void Node::UpdateWorldMatrix(const glm::mat4x4& parentWorldMat)
|
||||
void Node::UpdateWorldMatrix(const Math::Matrix4f& parentWorldMat)
|
||||
{
|
||||
worldMat = parentWorldMat * localMat;
|
||||
for (const auto& node : children)
|
||||
|
||||
Reference in New Issue
Block a user