neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
gltf.hpp
Go to the documentation of this file.
1// gltf.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <vector>
24#include <variant>
25#include <optional>
26#include <string>
28
29namespace neogfx::file
30{
31 class gltf
32 {
33 public:
34 struct asset
35 {
36 std::string version;
37 std::optional<std::string> minVersion;
38 std::string generator;
39 std::string copyright;
40 };
42 typedef struct { vec3 translation; vec4 rotation; vec3 scale; } trs_transform;
43 typedef std::variant<matrix_transform, trs_transform> local_transform;
44 struct mesh
45 {
46
47 };
48 struct camera
49 {
50 };
51 struct node;
52 typedef std::vector<node*> nodes;
53 struct node
54 {
55 std::optional<std::string> name;
56 std::optional<nodes> children;
57 std::optional<local_transform> transform;
58 mesh const* mesh;
59 camera const* camera;
60 };
61 struct scene
62 {
64 };
65 typedef std::vector<scene> scenes;
66 public:
67 gltf(std::string const& aUri) {}
68 public:
70 std::shared_ptr<scene> displayScene;
71 };
72}
std::shared_ptr< scene > displayScene
Definition gltf.hpp:70
std::variant< matrix_transform, trs_transform > local_transform
Definition gltf.hpp:43
mat44 matrix_transform
Definition gltf.hpp:41
gltf(std::string const &aUri)
Definition gltf.hpp:67
std::vector< node * > nodes
Definition gltf.hpp:52
std::vector< scene > scenes
Definition gltf.hpp:65
std::optional< std::string > minVersion
Definition gltf.hpp:37
std::string copyright
Definition gltf.hpp:39
std::string generator
Definition gltf.hpp:38
std::string version
Definition gltf.hpp:36
camera const * camera
Definition gltf.hpp:59
std::optional< local_transform > transform
Definition gltf.hpp:57
std::optional< nodes > children
Definition gltf.hpp:56
mesh const * mesh
Definition gltf.hpp:58
std::optional< std::string > name
Definition gltf.hpp:55