diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-12-03 19:51:18 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-12-03 19:51:18 +0000 |
| commit | de70a17fd3c169f2358d02ea83241b96f1040f5e (patch) | |
| tree | 22e0882f6e35cdf689601a37f9f9fa358b1f3fa3 /AssetLoader/interface | |
| parent | GLTF Loader: updated primitives handling (diff) | |
| download | DiligentTools-de70a17fd3c169f2358d02ea83241b96f1040f5e.tar.gz DiligentTools-de70a17fd3c169f2358d02ea83241b96f1040f5e.zip | |
GLTF loader: updated mesh BB handling
Diffstat (limited to 'AssetLoader/interface')
| -rw-r--r-- | AssetLoader/interface/GLTFLoader.hpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp index e86dec7..daa61e6 100644 --- a/AssetLoader/interface/GLTFLoader.hpp +++ b/AssetLoader/interface/GLTFLoader.hpp @@ -182,7 +182,12 @@ struct Mesh BoundBox BB; - bool IsValidBB = false; + // There may be no primitives in the mesh, in which + // case the bounding box will be invalid. + bool IsValidBB() const + { + return !Primitives.empty(); + } struct TransformData { @@ -193,7 +198,6 @@ struct Mesh TransformData Transforms; Mesh(IRenderDevice* pDevice, const float4x4& matrix); - void SetBoundingBox(const float3& min, const float3& max); }; @@ -216,15 +220,16 @@ struct Node std::vector<std::unique_ptr<Node>> Children; float4x4 Matrix; - std::unique_ptr<Mesh> _Mesh; - Skin* _Skin = nullptr; + std::unique_ptr<Mesh> Mesh; + Skin* Skin = nullptr; Int32 SkinIndex = -1; float3 Translation; float3 Scale = float3{1, 1, 1}; Quaternion Rotation; BoundBox BVH; BoundBox AABB; - bool IsValidBVH = false; + + bool IsValidBVH = false; float4x4 LocalMatrix() const; float4x4 GetMatrix() const; |
