From ba2ed53ae2f3e2705f5457362adb0e064a57f47f Mon Sep 17 00:00:00 2001 From: Vladyslav Baranovskyi Date: Fri, 30 Aug 2024 14:10:30 +0300 Subject: [PATCH] Using variable to store tinyusdz repo, moved include from hpp to cpp file, minor syntax change --- 3rdParty/tinyusdz/CMakeLists.txt | 6 +++++- openVulkanoCpp/Scene/MeshLoader.cpp | 9 +++++---- openVulkanoCpp/Scene/MeshLoader.hpp | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/3rdParty/tinyusdz/CMakeLists.txt b/3rdParty/tinyusdz/CMakeLists.txt index ec982ae..ac968c7 100644 --- a/3rdParty/tinyusdz/CMakeLists.txt +++ b/3rdParty/tinyusdz/CMakeLists.txt @@ -3,9 +3,13 @@ include(FetchContent) message("-- Building TinyUSDZ") +if(NOT DEFINED TINYUSDZ_REPO) + set(TINYUSDZ_REPO https://github.com/syoyo/tinyusdz.git) +endif () + FetchContent_Declare( tinyusdz - GIT_REPOSITORY https://github.com/syoyo/tinyusdz.git + GIT_REPOSITORY ${TINYUSDZ_REPO} GIT_TAG v0.8.0rc8 GIT_SHALLOW TRUE CMAKE_ARGS diff --git a/openVulkanoCpp/Scene/MeshLoader.cpp b/openVulkanoCpp/Scene/MeshLoader.cpp index 4cd6e9f..e86b62c 100644 --- a/openVulkanoCpp/Scene/MeshLoader.cpp +++ b/openVulkanoCpp/Scene/MeshLoader.cpp @@ -5,6 +5,7 @@ */ #include "MeshLoader.hpp" +#include "Scene/Geometry.hpp" #include "Base/Logger.hpp" #if __has_include("assimp/Importer.hpp") #include @@ -35,7 +36,7 @@ namespace namespace OpenVulkano::Scene { - void MeshLoader::parseAssimpFile(Geometry *geometry, const std::string& file) + void MeshLoader::ParseAssimpFile(Geometry *geometry, const std::string& file) { #ifdef ASSIMP_AVAILABLE Assimp::Importer importer; @@ -90,7 +91,7 @@ namespace OpenVulkano::Scene #endif } - void MeshLoader::parseUSDFile(Geometry *geometry, const std::string& file) + void MeshLoader::ParseUSDFile(Geometry *geometry, const std::string& file) { tinyusdz::Stage stage; std::string warning, err; @@ -156,11 +157,11 @@ namespace OpenVulkano::Scene if (ends_with(file, ".usd") || ends_with(file, ".usda") || ends_with(file, ".usdc") || ends_with(file, ".usdz")) { - parseUSDFile(geometry, file); + ParseUSDFile(geometry, file); } else { - parseAssimpFile(geometry, file); + ParseAssimpFile(geometry, file); } return geometry; diff --git a/openVulkanoCpp/Scene/MeshLoader.hpp b/openVulkanoCpp/Scene/MeshLoader.hpp index efefecd..1faece7 100644 --- a/openVulkanoCpp/Scene/MeshLoader.hpp +++ b/openVulkanoCpp/Scene/MeshLoader.hpp @@ -6,15 +6,15 @@ #pragma once -#include "Scene/Geometry.hpp" #include namespace OpenVulkano::Scene { + class Geometry; class MeshLoader { - static void parseAssimpFile(Geometry *geometry, const std::string& file); - static void parseUSDFile(Geometry *geometry, const std::string& file); + static void ParseAssimpFile(Geometry *geometry, const std::string& file); + static void ParseUSDFile(Geometry *geometry, const std::string& file); public: static Geometry* LoadFromFile(const std::string& file); };