mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-17 21:53:47 +00:00
Updated assimp to latest
This commit is contained in:
parent
25ce4477ce
commit
161bf7f83b
461 changed files with 34662 additions and 30165 deletions
|
|
@ -3,7 +3,8 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
Copyright (c) 2006-2019, assimp team
|
||||
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -50,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// internal headers
|
||||
#include "MS3DLoader.h"
|
||||
#include "StreamReader.h"
|
||||
#include <assimp/StreamReader.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
|
@ -141,7 +142,7 @@ void MS3DImporter :: ReadComments(StreamReaderLE& stream, std::vector<T>& outp)
|
|||
stream >> index >> clength;
|
||||
|
||||
if(index >= outp.size()) {
|
||||
DefaultLogger::get()->warn("MS3D: Invalid index in comment section");
|
||||
ASSIMP_LOG_WARN("MS3D: Invalid index in comment section");
|
||||
}
|
||||
else if (clength > stream.GetRemainingSize()) {
|
||||
throw DeadlyImportError("MS3D: Failure reading comment, length field is out of range");
|
||||
|
|
@ -180,8 +181,7 @@ void MS3DImporter :: CollectChildJoints(const std::vector<TempJoint>& joints,
|
|||
ch->mParent = nd;
|
||||
|
||||
ch->mTransformation = aiMatrix4x4::Translation(joints[i].position,aiMatrix4x4()=aiMatrix4x4())*
|
||||
// XXX actually, I don't *know* why we need the inverse here. Probably column vs. row order?
|
||||
aiMatrix4x4().FromEulerAnglesXYZ(joints[i].rotation).Transpose();
|
||||
aiMatrix4x4().FromEulerAnglesXYZ(joints[i].rotation);
|
||||
|
||||
const aiMatrix4x4 abs = absTrafo*ch->mTransformation;
|
||||
for(unsigned int a = 0; a < mScene->mNumMeshes; ++a) {
|
||||
|
|
@ -348,9 +348,6 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
|
|||
stream.CopyAndAdvance(j.parentName,32);
|
||||
j.parentName[32] = '\0';
|
||||
|
||||
// DefaultLogger::get()->debug(j.name);
|
||||
// DefaultLogger::get()->debug(j.parentName);
|
||||
|
||||
ReadVector(stream,j.rotation);
|
||||
ReadVector(stream,j.position);
|
||||
|
||||
|
|
@ -385,7 +382,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
|
|||
}
|
||||
|
||||
const std::string& s = std::string(reinterpret_cast<char*>(stream.GetPtr()),len);
|
||||
DefaultLogger::get()->debug("MS3D: Model comment: " + s);
|
||||
ASSIMP_LOG_DEBUG_F("MS3D: Model comment: ", s);
|
||||
}
|
||||
|
||||
if(stream.GetRemainingSize() > 4 && inrange((stream >> subversion,subversion),1u,3u)) {
|
||||
|
|
@ -407,7 +404,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
|
|||
// 2 ------------ convert to proper aiXX data structures -----------------------------------
|
||||
|
||||
if (need_default && materials.size()) {
|
||||
DefaultLogger::get()->warn("MS3D: Found group with no material assigned, spawning default material");
|
||||
ASSIMP_LOG_WARN("MS3D: Found group with no material assigned, spawning default material");
|
||||
// if one of the groups has no material assigned, but there are other
|
||||
// groups with materials, a default material needs to be added (
|
||||
// scenepreprocessor adds a default material only if nummat==0).
|
||||
|
|
@ -641,11 +638,8 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
|
|||
aiQuatKey& q = nd->mRotationKeys[nd->mNumRotationKeys++];
|
||||
|
||||
q.mTime = (*rot).time*animfps;
|
||||
|
||||
// XXX it seems our matrix&quaternion code has faults in its conversion routines --
|
||||
// aiQuaternion(x,y,z) seems to besomething different as quat(matrix.fromeuler(x,y,z)).
|
||||
q.mValue = aiQuaternion(aiMatrix3x3(aiMatrix4x4().FromEulerAnglesXYZ((*rot).value)*
|
||||
aiMatrix4x4().FromEulerAnglesXYZ((*it).rotation)).Transpose());
|
||||
q.mValue = aiQuaternion(aiMatrix3x3(aiMatrix4x4().FromEulerAnglesXYZ((*it).rotation)*
|
||||
aiMatrix4x4().FromEulerAnglesXYZ((*rot).value)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue