Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
ResourceManager.cpp File Reference
#include "stb_image.h"
#include "cgltf.h"
#include "ufbx.h"
#include "scenes/JSONUtils.hpp"
#include <filesystem>
#include <fstream>
#include "renderer/ResourceManager.hpp"
#include "renderer/VulkanRenderer.hpp"
#include "core/VulkanBuffer.hpp"
#include <iostream>
#include <sstream>
#include <glm/gtx/matrix_decompose.hpp>
#include <stdexcept>
#include <algorithm>
#include <glm/gtx/quaternion.hpp>
#include <cctype>

Macros

#define STB_IMAGE_IMPLEMENTATION
#define CGLTF_IMPLEMENTATION
#define GLM_ENABLE_EXPERIMENTAL
#define GLM_ENABLE_EXPERIMENTAL

Functions

static void transitionImageLayout (VulkanRenderer &renderer, VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout)
static void copyBufferToImage (VulkanRenderer &renderer, VkBuffer buffer, VkImage image, uint32_t width, uint32_t height)
static void createImage (VkDevice device, VkPhysicalDevice physicalDevice, uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage &image, VkDeviceMemory &imageMemory, ResourceManager &resManager)
static void traverseNodes (cgltf_data *data, cgltf_node *node, const glm::mat4 &parentTransform, Mesh &mesh, int targetPrimIndex, int &currentPrimIndex)
static glm::mat4 toGlmMatrix (const ufbx_matrix &m)
static Mesh loadFBXMesh (const std::string &path, VulkanRenderer &renderer, int primitiveIndex, std::unordered_map< std::string, Mesh > &meshCache)
static void countPrimsRecursive (cgltf_node *node, int &count)
static bool isRootMotionJoint (const SkeletonComponent &skeleton, int jointIndex)

Macro Definition Documentation

◆ CGLTF_IMPLEMENTATION

#define CGLTF_IMPLEMENTATION

◆ GLM_ENABLE_EXPERIMENTAL [1/2]

#define GLM_ENABLE_EXPERIMENTAL

◆ GLM_ENABLE_EXPERIMENTAL [2/2]

#define GLM_ENABLE_EXPERIMENTAL

◆ STB_IMAGE_IMPLEMENTATION

#define STB_IMAGE_IMPLEMENTATION

Function Documentation

◆ copyBufferToImage()

void copyBufferToImage ( VulkanRenderer & renderer,
VkBuffer buffer,
VkImage image,
uint32_t width,
uint32_t height )
static

◆ countPrimsRecursive()

void countPrimsRecursive ( cgltf_node * node,
int & count )
static

◆ createImage()

void createImage ( VkDevice device,
VkPhysicalDevice physicalDevice,
uint32_t width,
uint32_t height,
VkFormat format,
VkImageTiling tiling,
VkImageUsageFlags usage,
VkMemoryPropertyFlags properties,
VkImage & image,
VkDeviceMemory & imageMemory,
ResourceManager & resManager )
static

◆ isRootMotionJoint()

bool isRootMotionJoint ( const SkeletonComponent & skeleton,
int jointIndex )
static

◆ loadFBXMesh()

Mesh loadFBXMesh ( const std::string & path,
VulkanRenderer & renderer,
int primitiveIndex,
std::unordered_map< std::string, Mesh > & meshCache )
static

◆ toGlmMatrix()

glm::mat4 toGlmMatrix ( const ufbx_matrix & m)
static

◆ transitionImageLayout()

void transitionImageLayout ( VulkanRenderer & renderer,
VkImage image,
VkFormat format,
VkImageLayout oldLayout,
VkImageLayout newLayout )
static

◆ traverseNodes()

void traverseNodes ( cgltf_data * data,
cgltf_node * node,
const glm::mat4 & parentTransform,
Mesh & mesh,
int targetPrimIndex,
int & currentPrimIndex )
static