Using variable to store tinyusdz repo, moved include from hpp to cpp file, minor syntax change
This commit is contained in:
6
3rdParty/tinyusdz/CMakeLists.txt
vendored
6
3rdParty/tinyusdz/CMakeLists.txt
vendored
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "MeshLoader.hpp"
|
||||
#include "Scene/Geometry.hpp"
|
||||
#include "Base/Logger.hpp"
|
||||
#if __has_include("assimp/Importer.hpp")
|
||||
#include <assimp/Importer.hpp>
|
||||
@@ -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;
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Scene/Geometry.hpp"
|
||||
#include <string>
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user