Skip to content

Commit a6c1813

Browse files
authored
Use gltf2cpp (#73)
* Remove NodeData::Type; support multiple attachments * Use gltf2cpp - Remove detail/gltf. - Cleanup src.zip.
1 parent d08aea1 commit a6c1813

File tree

8 files changed

+180
-911
lines changed

8 files changed

+180
-911
lines changed

lib/ext/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ add_library(${target_prefix}::stb-image ALIAS stb-image)
5050
add_subdirectory(src/djson)
5151

5252
add_subdirectory(src/fmt)
53+
54+
set(GLTF2CPP_DYNARRAY_DEBUG_VIEW ON)
55+
add_subdirectory(src/gltf2cpp)

lib/ext/src.zip

-13.2 MB
Binary file not shown.

lib/scene/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target_include_directories(${PROJECT_NAME}
2020
target_link_libraries(${PROJECT_NAME}
2121
PUBLIC
2222
${target_prefix}::vk
23-
djson::djson
23+
gltf2cpp::gltf2cpp
2424

2525
PRIVATE
2626
${target_prefix}::compile-options
@@ -47,9 +47,6 @@ target_sources(${PROJECT_NAME} PRIVATE
4747
include/${target_prefix}/scene/scene_resources.hpp
4848
include/${target_prefix}/scene/scene.hpp
4949

50-
src/detail/gltf.cpp
51-
src/detail/gltf.hpp
52-
5350
src/camera.cpp
5451
src/gltf_loader.cpp
5552
src/material.cpp

lib/scene/include/facade/scene/node_data.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <facade/util/transform.hpp>
3+
#include <optional>
34
#include <string>
45
#include <vector>
56

@@ -8,11 +9,6 @@ namespace facade {
89
/// \brief Scene Node data: shared between Scene and gltf::* (internal)
910
///
1011
struct NodeData {
11-
///
12-
/// \brief Node type.
13-
///
14-
enum class Type { eNone, eMesh, eCamera };
15-
1612
///
1713
/// \brief Name of the node.
1814
///
@@ -30,8 +26,12 @@ struct NodeData {
3026
///
3127
std::size_t index{};
3228
///
33-
/// \brief Type of the node.
29+
/// \brief Camera index.
30+
///
31+
std::optional<std::size_t> camera{};
32+
///
33+
/// \brief Mesh index.
3434
///
35-
Type type{};
35+
std::optional<std::size_t> mesh{};
3636
};
3737
} // namespace facade

0 commit comments

Comments
 (0)