2022-05-29 13:23:08 +00:00
|
|
|
#include "Util.h"
|
|
|
|
|
2022-10-22 22:14:47 +00:00
|
|
|
/*
|
|
|
|
* void PrintSceneTree(Node& node, int depth) {
|
2022-05-29 13:23:08 +00:00
|
|
|
// Indent name based on depth
|
|
|
|
std::cout << " ";
|
|
|
|
for (int i = 0; i < depth; i++) {
|
|
|
|
std::cout << "-";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << " " << node.name << std::endl;
|
|
|
|
|
|
|
|
depth++;
|
|
|
|
for (auto child : node.children) {
|
|
|
|
PrintSceneTree(*child, depth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glm::mat4 CalculateModelMat(Transform& transform) {
|
|
|
|
|
|
|
|
glm::mat4 tran = glm::translate(glm::mat4(), transform.Position);
|
|
|
|
glm::mat4 scale = glm::scale(glm::mat4(), transform.Scale);
|
|
|
|
glm::mat4 rot =
|
|
|
|
glm::rotate(glm::mat4(), glm::radians(transform.Rotation.x), glm::vec3(1.0f, 0.0f, 0.0f)) *
|
|
|
|
glm::rotate(glm::mat4(), glm::radians(transform.Rotation.y), glm::vec3(0.0f, 1.0f, 0.0f)) *
|
|
|
|
glm::rotate(glm::mat4(), glm::radians(transform.Rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
|
|
|
|
|
|
|
|
|
|
|
|
return tran * rot * scale;
|
|
|
|
}
|
|
|
|
|
2022-10-22 22:14:47 +00:00
|
|
|
*/
|
|
|
|
|