glTF2 Importer Update.

Vertex weights are now correctly assigned for skinned meshes. Portions of the vertex weight fix were taken from: https://github.com/ConfettiFX/The-Forge/blob/master/Common_3/ThirdParty/OpenSource/assimp/4.1.0/code/glTF2Importer.cpp#L823-L860.
Inverse bind matrices have been adjusted to be consistent with the other importers.
All nodes, joints and meshes are now named so T3D can cross reference when loading animations.
All T3D specific changes have been bracketed in //T3D_CHANGE_BEGIN and //T3D_CHANGE_END tags to make them easier to find when the assimp library is updated.
This commit is contained in:
OTHGMars 2019-04-25 15:41:01 -04:00
parent a4a97cc3d3
commit 6be2989bbc
3 changed files with 112 additions and 36 deletions

View file

@ -405,8 +405,10 @@ inline void Buffer::Read(Value& obj, Asset& r)
inline bool Buffer::LoadFromStream(IOStream& stream, size_t length, size_t baseOffset)
{
byteLength = length ? length : stream.FileSize();
//T3D_CHANGE_BEGIN
if ((byteLength + baseOffset) > stream.FileSize())
byteLength = stream.FileSize() - baseOffset;
//T3D_CHANGE_END
if (baseOffset) {
stream.Seek(baseOffset, aiOrigin_SET);