summaryrefslogtreecommitdiffstats
path: root/AssetLoader/interface
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-01-08 05:36:58 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-01-08 05:36:58 +0000
commita6339f1cb8757a1f349083e8c5e5ee2c2c342e5d (patch)
treee8471cbfb4ce195bd7e98aa29d3d26dc74f23c6e /AssetLoader/interface
parentUpdated more copyright notices (diff)
downloadDiligentTools-a6339f1cb8757a1f349083e8c5e5ee2c2c342e5d.tar.gz
DiligentTools-a6339f1cb8757a1f349083e8c5e5ee2c2c342e5d.zip
GLTF Loader: added camera loading
Diffstat (limited to 'AssetLoader/interface')
-rw-r--r--AssetLoader/interface/GLTFLoader.hpp50
1 files changed, 41 insertions, 9 deletions
diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp
index bdd8fc4..a6a9e0b 100644
--- a/AssetLoader/interface/GLTFLoader.hpp
+++ b/AssetLoader/interface/GLTFLoader.hpp
@@ -217,6 +217,37 @@ struct Skin
std::vector<Node*> Joints;
};
+struct Camera
+{
+ enum class Projection
+ {
+ Unknown,
+ Perspective,
+ Orthographic
+ } Type = Projection::Unknown;
+
+ std::string Name;
+
+ union
+ {
+ struct PerspectiveCamera
+ {
+ float AspectRatio = 0;
+ float YFov = 0;
+ float ZFar = 0;
+ float ZNear = 0;
+ } Perspective;
+ struct OrthographicCamera
+ {
+ float XMag;
+ float YMag;
+ float ZFar;
+ float ZNear;
+ } Orthographic;
+ };
+
+ float4x4 matrix;
+};
struct Node
{
@@ -226,15 +257,16 @@ struct Node
std::vector<std::unique_ptr<Node>> Children;
- float4x4 Matrix;
- std::unique_ptr<Mesh> pMesh;
- Skin* pSkin = nullptr;
- Int32 SkinIndex = -1;
- float3 Translation;
- float3 Scale = float3{1, 1, 1};
- Quaternion Rotation;
- BoundBox BVH;
- BoundBox AABB;
+ float4x4 Matrix;
+ std::unique_ptr<Mesh> pMesh;
+ std::unique_ptr<Camera> pCamera;
+ Skin* pSkin = nullptr;
+ Int32 SkinIndex = -1;
+ float3 Translation;
+ float3 Scale = float3{1, 1, 1};
+ Quaternion Rotation;
+ BoundBox BVH;
+ BoundBox AABB;
bool IsValidBVH = false;