Merge branch 'master' into ihsinme-patch-210
commit
5a7f212162
|
@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2020, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -52,8 +51,12 @@ void ScenePreprocessor::ProcessScene() {
|
||||||
ai_assert(scene != nullptr);
|
ai_assert(scene != nullptr);
|
||||||
|
|
||||||
// Process all meshes
|
// Process all meshes
|
||||||
for (unsigned int i = 0; i < scene->mNumMeshes; ++i)
|
for (unsigned int i = 0; i < scene->mNumMeshes; ++i) {
|
||||||
|
if (nullptr == scene->mMeshes[i]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ProcessMesh(scene->mMeshes[i]);
|
ProcessMesh(scene->mMeshes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
// - nothing to do for nodes for the moment
|
// - nothing to do for nodes for the moment
|
||||||
// - nothing to do for textures for the moment
|
// - nothing to do for textures for the moment
|
||||||
|
@ -61,8 +64,12 @@ void ScenePreprocessor::ProcessScene() {
|
||||||
// - nothing to do for cameras for the moment
|
// - nothing to do for cameras for the moment
|
||||||
|
|
||||||
// Process all animations
|
// Process all animations
|
||||||
for (unsigned int i = 0; i < scene->mNumAnimations; ++i)
|
for (unsigned int i = 0; i < scene->mNumAnimations; ++i) {
|
||||||
|
if (nullptr == scene->mAnimations[i]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ProcessAnimation(scene->mAnimations[i]);
|
ProcessAnimation(scene->mAnimations[i]);
|
||||||
|
}
|
||||||
|
|
||||||
// Generate a default material if none was specified
|
// Generate a default material if none was specified
|
||||||
if (!scene->mNumMaterials && scene->mNumMeshes) {
|
if (!scene->mNumMaterials && scene->mNumMeshes) {
|
||||||
|
|
|
@ -198,11 +198,9 @@ endif(MINGW)
|
||||||
|
|
||||||
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||||
|
|
||||||
IF(WIN32)
|
INSTALL( TARGETS zlibstatic
|
||||||
INSTALL( TARGETS zlibstatic
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||||
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
|
||||||
ENDIF()
|
|
||||||
|
|
|
@ -735,9 +735,9 @@ public:
|
||||||
* #GetTextureCount() can be used to determine the number of textures
|
* #GetTextureCount() can be used to determine the number of textures
|
||||||
* per texture type.
|
* per texture type.
|
||||||
* @param path Receives the path to the texture.
|
* @param path Receives the path to the texture.
|
||||||
* If the texture is embedded, receives a '*' followed by the id of
|
* Use aiScene::GetEmbeddedTexture() method to determine if returned path
|
||||||
* the texture (for the textures stored in the corresponding scene) which
|
* is an image file to be opened or a string key of embedded texture stored in the corresponding scene
|
||||||
* can be converted to an int using a function like atoi.
|
* (could be a '*' followed by the id of the texture in case of no name)
|
||||||
* NULL is a valid value.
|
* NULL is a valid value.
|
||||||
* @param mapping The texture mapping.
|
* @param mapping The texture mapping.
|
||||||
* NULL is allowed as value.
|
* NULL is allowed as value.
|
||||||
|
|
|
@ -305,9 +305,9 @@ struct aiString {
|
||||||
|
|
||||||
/** Copy a const char* to the aiString */
|
/** Copy a const char* to the aiString */
|
||||||
void Set(const char *sz) {
|
void Set(const char *sz) {
|
||||||
const ai_int32 len = (ai_uint32)::strlen(sz);
|
ai_int32 len = (ai_uint32)::strlen(sz);
|
||||||
if (len > (ai_int32)MAXLEN - 1) {
|
if (len > (ai_int32)MAXLEN - 1) {
|
||||||
return;
|
len = (ai_int32) MAXLEN - 1;
|
||||||
}
|
}
|
||||||
length = len;
|
length = len;
|
||||||
memcpy(data, sz, len);
|
memcpy(data, sz, len);
|
||||||
|
@ -321,7 +321,10 @@ struct aiString {
|
||||||
}
|
}
|
||||||
|
|
||||||
length = rOther.length;
|
length = rOther.length;
|
||||||
;
|
if (length >(MAXLEN - 1)) {
|
||||||
|
length = (ai_int32) MAXLEN - 1;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(data, rOther.data, length);
|
memcpy(data, rOther.data, length);
|
||||||
data[length] = '\0';
|
data[length] = '\0';
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2020, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -154,6 +152,9 @@ const aiVector3t<TReal>& aiVector3t<TReal>::operator *= (TReal f) {
|
||||||
template <typename TReal>
|
template <typename TReal>
|
||||||
AI_FORCE_INLINE
|
AI_FORCE_INLINE
|
||||||
const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) {
|
const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) {
|
||||||
|
if ( f == static_cast<TReal>(0.0)) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
const TReal invF = (TReal) 1.0 / f;
|
const TReal invF = (TReal) 1.0 / f;
|
||||||
x *= invF;
|
x *= invF;
|
||||||
y *= invF;
|
y *= invF;
|
||||||
|
|
Loading…
Reference in New Issue