diff options
| author | s-ol <s+removethis@s-ol.nu> | 2021-04-09 12:59:54 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2021-04-12 12:12:40 +0000 |
| commit | 08dd1a975a33aec9dc6f18568b0d014551983b66 (patch) | |
| tree | d80edfa837137e10e3a7ac626cccfc81c650e924 /AssetLoader/interface/GLTFLoader.h | |
| parent | implement loading GLTF files from memory (diff) | |
| download | DiligentTools-gltf-c-api.tar.gz DiligentTools-gltf-c-api.zip | |
Give access to individual node transformsgltf-c-api
Diffstat (limited to 'AssetLoader/interface/GLTFLoader.h')
| -rw-r--r-- | AssetLoader/interface/GLTFLoader.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/AssetLoader/interface/GLTFLoader.h b/AssetLoader/interface/GLTFLoader.h index 402559e..9aba237 100644 --- a/AssetLoader/interface/GLTFLoader.h +++ b/AssetLoader/interface/GLTFLoader.h @@ -46,9 +46,22 @@ DILIGENT_BEGIN_NAMESPACE(GLTF) #if DILIGENT_CPP_INTERFACE class ResourceManager; + + struct GLTF_Transform; #else struct ResourceManager; typedef struct ResourceManager ResourceManager; + + struct GLTF_Transform + { + float Translation[3]; + float _pad0; + float Scale[3]; + float _pad1; + float Rotation[4]; + float Matrix[4*4]; + }; + typedef struct GLTF_Transform GLTF_Transform; #endif struct GLTF_ResourceCacheUseInfo @@ -169,6 +182,14 @@ DILIGENT_BEGIN_INTERFACE1(IGLTFModel) VIRTUAL ITexture* METHOD(GetTexture)(THIS_ Uint32 Index) PURE; + VIRTUAL bool METHOD(GetNodeIndex)(THIS_ const char* Name, Uint32* Idx) CONST PURE; + + VIRTUAL void METHOD(GetNodeTransform)(THIS_ Uint32 Idx, GLTF_Transform* Transform) PURE; + + VIRTUAL void METHOD(SetNodeTransform)(THIS_ Uint32 Idx, GLTF_Transform* Transform) PURE; + + VIRTUAL void METHOD(UpdateTransforms)(THIS) PURE; + VIRTUAL Uint32 METHOD(GetFirstIndexLocation)(THIS) CONST PURE; VIRTUAL Uint32 METHOD(GetBaseVertex)(THIS) CONST PURE; @@ -185,6 +206,10 @@ DILIGENT_END_INTERFACE # define IGLTFModel_Transform(This, ...) CALL_IFACE_METHOD(GLTF_Model, Transform, This, __VA_ARGS__) # define IGLTFModel_GetBuffer(This, ...) CALL_IFACE_METHOD(GLTF_Model, GetBuffer, This, __VA_ARGS__) # define IGLTFModel_GetTexture(This, ...) CALL_IFACE_METHOD(GLTF_Model, GetTexture, This, __VA_ARGS__) +# define IGLTFModel_GetNodeIndex(This, ...) CALL_IFACE_METHOD(GLTF_Model, GetNodeIndex, This, __VA_ARGS__) +# define IGLTFModel_GetNodeTransform(This, ...) CALL_IFACE_METHOD(GLTF_Model, GetNodeTransform, This, __VA_ARGS__) +# define IGLTFModel_SetNodeTransform(This, ...) CALL_IFACE_METHOD(GLTF_Model, SetNodeTransform, This, __VA_ARGS__) +# define IGLTFModel_UpdateTransforms(This) CALL_IFACE_METHOD(GLTF_Model, UpdateTransforms, This) # define IGLTFModel_GetFirstIndexLocation(This) CALL_IFACE_METHOD(GLTF_Model, GetFirstIndexLocation, This) # define IGLTFModel_GetBaseVertex(This) CALL_IFACE_METHOD(GLTF_Model, GetBaseVertex, This) |
