Adding / organizing the workspace into multple seperate projects

This commit is contained in:
2022-10-22 14:58:55 +02:00
parent 29e715b92a
commit 955eeabb48
18 changed files with 116 additions and 38 deletions

32
SandboxApp/src/Util.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "Util.h"
void PrintSceneTree(Node& node, int depth) {
// 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;
}