Skip to content

Commit

Permalink
feat : add initial class for scene objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowapril committed Nov 4, 2023
1 parent cd2a626 commit 8fe3456
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 18 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ include_directories(Dependencies/src/vulkan/include)
include_directories(Dependencies/src/vma/src)
include_directories(Dependencies/src/glfw/include)
include_directories(Dependencies/src/glm)
include_directories(Dependencies/src/assimp/include)
include_directories(Dependencies/src/tinygltf)
include_directories(Dependencies/src/etc2comp/EtcLib/Etc)
include_directories(Dependencies/src/etc2comp/EtcLib/EtcCodec)
include_directories(Dependencies/src/glslang/glslang/Include)
Expand Down Expand Up @@ -103,16 +103,6 @@ set(GLFW_BUILD_DOCS OFF CACHE BOOL "")
set(GLFW_INSTALL OFF CACHE BOOL "")
add_subdirectory(Dependencies/src/glfw)

set(ASSIMP_NO_EXPORT ON CACHE BOOL "")
set(ASSIMP_BUILD_DRACO OFF CACHE BOOL "")
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "")
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "")
set(ASSIMP_INSTALL_PDB OFF CACHE BOOL "")
set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT OFF CACHE BOOL "")
set(ASSIMP_BUILD_OBJ_IMPORTER ON CACHE BOOL "")
set(ASSIMP_BUILD_GLTF_IMPORTER ON CACHE BOOL "")
add_subdirectory(Dependencies/src/assimp)

set(MESHOPT_BUILD_DEMO OFF CACHE BOOL "")
set(MESHOPT_BUILD_TOOLS OFF CACHE BOOL "")
set(MESHOPT_BUILD_SHARED_LIBS OFF CACHE BOOL "")
Expand Down Expand Up @@ -153,14 +143,10 @@ add_subdirectory(Dependencies/src/backward-cpp)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(TARGET glfw PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET assimp PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET EtcLib PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET EtcTool PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET meshoptimizer PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET volk PROPERTY FOLDER "ThirdPartyLibraries")
if(WIN32)
set_property(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs PROPERTY FOLDER "ThirdPartyLibraries")
endif()
set_property(TARGET uninstall PROPERTY FOLDER "ThirdPartyLibraries")
set_property(TARGET glslang PROPERTY FOLDER "ThirdPartyLibraries/glslang")
set_property(TARGET OGLCompiler PROPERTY FOLDER "ThirdPartyLibraries/glslang")
Expand Down
6 changes: 3 additions & 3 deletions Dependencies/bootstrap.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
}
},
{
"name": "assimp",
"name": "tinygltf",
"source": {
"type": "git",
"url": "https://github.com/assimp/assimp.git",
"revision": "a9f82dbe0b8a658003f93c7b5108ee4521458a18"
"url": "https://github.com/syoyo/tinygltf.git",
"revision": "v2.8.18"
}
},
{
Expand Down
14 changes: 14 additions & 0 deletions Includes/VoxFlow/Core/Scene/Material.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Author : snowapril

#ifndef VOX_FLOW_MATERIAL_HPP
#define VOX_FLOW_MATERIAL_HPP

namespace VoxFlow
{
class Material
{
public:
};
} // namespace VoxFlow

#endif // VOX_FLOW_MATERIAL_HPP
14 changes: 14 additions & 0 deletions Includes/VoxFlow/Core/Scene/PrimitiveBufferPool.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Author : snowapril

#ifndef VOX_FLOW_PRIMITIVE_BUFFER_POOL_HPP
#define VOX_FLOW_PRIMITIVE_BUFFER_POOL_HPP

namespace VoxFlow
{
class PrimitiveBufferPool
{
public:
};
} // namespace VoxFlow

#endif // VOX_FLOW_PRIMITIVE_BUFFER_POOL_HPP
14 changes: 14 additions & 0 deletions Includes/VoxFlow/Core/Scene/SceneObject.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Author : snowapril

#ifndef VOX_FLOW_SCENE_OBJECT_HPP
#define VOX_FLOW_SCENE_OBJECT_HPP

namespace VoxFlow
{
class SceneObject
{
public:
};
} // namespace VoxFlow

#endif // VOX_FLOW_SCENE_OBJECT_HPP
25 changes: 25 additions & 0 deletions Includes/VoxFlow/Core/Scene/SceneObjectLoader.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Author : snowapril

#ifndef VOX_FLOW_SCENE_OBJECT_LOADER_HPP
#define VOX_FLOW_SCENE_OBJECT_LOADER_HPP

#include <memory>
#include <string>

namespace VoxFlow
{
class SceneObject;

class SceneObjectLoader
{
public:
SceneObjectLoader();
~SceneObjectLoader();

public:
std::shared_ptr<SceneObject> loadSceneObjectGltf(const std::string& gltfPath);

};
}

#endif // VOX_FLOW_SCENE_OBJECT_LOADER_HPP
8 changes: 8 additions & 0 deletions Sources/VoxFlow/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ set(PUBLIC_HDRS
${PUBLIC_HDR_DIR}/VoxFlow/Core/Resources/RenderResourceGarbageCollector.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Resources/RenderResourceMemoryPool.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Resources/StagingBufferContext.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Scene/SceneObject.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Scene/SceneObjectLoader.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Scene/PrimitiveBufferPool.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Scene/Material.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Utils/BitwiseOperators.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Utils/ChromeTracer.hpp
${PUBLIC_HDR_DIR}/VoxFlow/Core/Utils/DebugUtil.hpp
Expand Down Expand Up @@ -139,6 +143,10 @@ set(SRCS
${SRC_DIR}/Core/Resources/RenderResourceMemoryPool.cpp
${SRC_DIR}/Core/Resources/StagingBufferContext.cpp
${SRC_DIR}/Core/Resources/StagingBuffer.cpp
${SRC_DIR}/Core/Scene/SceneObject.hpp
${SRC_DIR}/Core/Scene/SceneObjectLoader.hpp
${SRC_DIR}/Core/Scene/PrimitiveBufferPool.hpp
${SRC_DIR}/Core/Scene/Material.hpp
${SRC_DIR}/Core/Utils/ChromeTracer.cpp
${SRC_DIR}/Core/Utils/DecisionMaker.cpp
${SRC_DIR}/Core/Utils/DeviceInputSubscriber.cpp
Expand Down
7 changes: 7 additions & 0 deletions Sources/VoxFlow/Core/Scene/Material.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Author : snowapril

#include <VoxFlow/Core/Scene/Material.hpp>

namespace VoxFlow
{
} // namespace VoxFlow
7 changes: 7 additions & 0 deletions Sources/VoxFlow/Core/Scene/PrimitiveBufferPool.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Author : snowapril

#include <VoxFlow/Core/Scene/PrimitiveBufferPool.hpp>

namespace VoxFlow
{
} // namespace VoxFlow
7 changes: 7 additions & 0 deletions Sources/VoxFlow/Core/Scene/SceneObject.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Author : snowapril

#include <VoxFlow/Core/Scene/SceneObject.hpp>

namespace VoxFlow
{
} // namespace VoxFlow
12 changes: 12 additions & 0 deletions Sources/VoxFlow/Core/Scene/SceneObjectLoader.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Author : snowapril

#include <VoxFlow/Core/Scene/SceneObjectLoader.hpp>

#define TINYGLTF_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <tiny_gltf.h>

namespace VoxFlow
{
} // namespace VoxFlow

0 comments on commit 8fe3456

Please sign in to comment.