mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-24 00: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
|
|
@ -2,7 +2,8 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
Copyright (c) 2006-2019, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -68,8 +69,7 @@ LazyObject::LazyObject(uint64_t id, const Element& element, const Document& doc)
|
|||
: doc(doc)
|
||||
, element(element)
|
||||
, id(id)
|
||||
, flags()
|
||||
{
|
||||
, flags() {
|
||||
// empty
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ LazyObject::~LazyObject()
|
|||
const Object* LazyObject::Get(bool dieOnError)
|
||||
{
|
||||
if(IsBeingConstructed() || FailedToConstruct()) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (object.get()) {
|
||||
|
|
@ -145,6 +145,12 @@ const Object* LazyObject::Get(bool dieOnError)
|
|||
if (!strcmp(classtag.c_str(),"Mesh")) {
|
||||
object.reset(new MeshGeometry(id,element,name,doc));
|
||||
}
|
||||
if (!strcmp(classtag.c_str(), "Shape")) {
|
||||
object.reset(new ShapeGeometry(id, element, name, doc));
|
||||
}
|
||||
if (!strcmp(classtag.c_str(), "Line")) {
|
||||
object.reset(new LineGeometry(id, element, name, doc));
|
||||
}
|
||||
}
|
||||
else if (!strncmp(obtype,"NodeAttribute",length)) {
|
||||
if (!strcmp(classtag.c_str(),"Camera")) {
|
||||
|
|
@ -170,6 +176,12 @@ const Object* LazyObject::Get(bool dieOnError)
|
|||
else if (!strcmp(classtag.c_str(),"Skin")) {
|
||||
object.reset(new Skin(id,element,doc,name));
|
||||
}
|
||||
else if (!strcmp(classtag.c_str(), "BlendShape")) {
|
||||
object.reset(new BlendShape(id, element, doc, name));
|
||||
}
|
||||
else if (!strcmp(classtag.c_str(), "BlendShapeChannel")) {
|
||||
object.reset(new BlendShapeChannel(id, element, doc, name));
|
||||
}
|
||||
}
|
||||
else if ( !strncmp( obtype, "Model", length ) ) {
|
||||
// FK and IK effectors are not supported
|
||||
|
|
@ -213,7 +225,7 @@ const Object* LazyObject::Get(bool dieOnError)
|
|||
|
||||
// note: the error message is already formatted, so raw logging is ok
|
||||
if(!DefaultLogger::isNullLogger()) {
|
||||
DefaultLogger::get()->error(ex.what());
|
||||
ASSIMP_LOG_ERROR(ex.what());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -344,14 +356,15 @@ void Document::ReadGlobalSettings()
|
|||
{
|
||||
const Scope& sc = parser.GetRootScope();
|
||||
const Element* const ehead = sc["GlobalSettings"];
|
||||
if(!ehead || !ehead->Compound()) {
|
||||
DOMWarning("no GlobalSettings dictionary found");
|
||||
|
||||
if ( nullptr == ehead || !ehead->Compound() ) {
|
||||
DOMWarning( "no GlobalSettings dictionary found" );
|
||||
globals.reset(new FileGlobalSettings(*this, std::make_shared<const PropertyTable>()));
|
||||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<const PropertyTable> props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true);
|
||||
std::shared_ptr<const PropertyTable> props = GetPropertyTable( *this, "", *ehead, *ehead->Compound(), true );
|
||||
|
||||
//double v = PropertyGet<float>( *props.get(), std::string("UnitScaleFactor"), 1.0 );
|
||||
|
||||
if(!props) {
|
||||
DOMError("GlobalSettings dictionary contains no property table");
|
||||
|
|
@ -539,7 +552,7 @@ const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|||
LazyObject* Document::GetObject(uint64_t id) const
|
||||
{
|
||||
ObjectMap::const_iterator it = objects.find(id);
|
||||
return it == objects.end() ? NULL : (*it).second;
|
||||
return it == objects.end() ? nullptr : (*it).second;
|
||||
}
|
||||
|
||||
#define MAX_CLASSNAMES 6
|
||||
|
|
@ -573,11 +586,11 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
|
|||
ai_assert( count != 0 );
|
||||
ai_assert( count <= MAX_CLASSNAMES);
|
||||
|
||||
size_t lenghts[MAX_CLASSNAMES];
|
||||
size_t lengths[MAX_CLASSNAMES];
|
||||
|
||||
const size_t c = count;
|
||||
for (size_t i = 0; i < c; ++i) {
|
||||
lenghts[ i ] = strlen(classnames[i]);
|
||||
lengths[ i ] = strlen(classnames[i]);
|
||||
}
|
||||
|
||||
std::vector<const Connection*> temp;
|
||||
|
|
@ -595,8 +608,8 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
|
|||
|
||||
for (size_t i = 0; i < c; ++i) {
|
||||
ai_assert(classnames[i]);
|
||||
if(static_cast<size_t>(std::distance(key.begin(),key.end())) == lenghts[i] && !strncmp(classnames[i],obtype,lenghts[i])) {
|
||||
obtype = NULL;
|
||||
if(static_cast<size_t>(std::distance(key.begin(),key.end())) == lengths[i] && !strncmp(classnames[i],obtype,lengths[i])) {
|
||||
obtype = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -619,10 +632,10 @@ std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t dest, const char* classname) const
|
||||
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t src, const char* classname) const
|
||||
{
|
||||
const char* arr[] = {classname};
|
||||
return GetConnectionsBySourceSequenced(dest, arr,1);
|
||||
return GetConnectionsBySourceSequenced(src, arr,1);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue