2008-09-27 16:46:05 +00:00
|
|
|
/*
|
2012-02-03 03:38:30 +00:00
|
|
|
Open Asset Import Library (assimp)
|
2008-09-27 16:46:05 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
2012-02-03 03:38:30 +00:00
|
|
|
Copyright (c) 2006-2012, assimp team
|
2008-09-27 16:46:05 +00:00
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use of this software in source and binary forms,
|
|
|
|
with or without modification, are permitted provided that the
|
|
|
|
following conditions are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer.
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer in the documentation and/or other
|
|
|
|
materials provided with the distribution.
|
|
|
|
|
2012-02-03 03:38:30 +00:00
|
|
|
* Neither the name of the assimp team, nor the names of its
|
2008-09-27 16:46:05 +00:00
|
|
|
contributors may be used to endorse or promote products
|
|
|
|
derived from this software without specific prior
|
2012-02-03 03:38:30 +00:00
|
|
|
written permission of the assimp team.
|
2008-09-27 16:46:05 +00:00
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AI_PROCESS_HELPER_H_INCLUDED
|
|
|
|
#define AI_PROCESS_HELPER_H_INCLUDED
|
|
|
|
|
2012-02-03 17:04:06 +00:00
|
|
|
#include "../include/assimp/postprocess.h"
|
2015-04-15 19:22:26 +00:00
|
|
|
#include "../include/assimp/anim.h"
|
|
|
|
#include "../include/assimp/mesh.h"
|
|
|
|
#include "../include/assimp/material.h"
|
|
|
|
#include "../include/assimp/DefaultLogger.hpp"
|
|
|
|
#include "../include/assimp/scene.h"
|
2008-09-27 16:46:05 +00:00
|
|
|
|
2008-09-30 20:20:56 +00:00
|
|
|
#include "SpatialSort.h"
|
|
|
|
#include "BaseProcess.h"
|
2009-04-24 20:53:24 +00:00
|
|
|
#include "ParsingUtils.h"
|
2008-09-30 20:20:56 +00:00
|
|
|
|
2015-04-15 19:22:26 +00:00
|
|
|
#include <list>
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Some extensions to std namespace. Mainly std::min and std::max for all
|
|
|
|
// flat data types in the aiScene. They're used to quickly determine the
|
|
|
|
// min/max bounds of data arrays.
|
|
|
|
#ifdef __cplusplus
|
|
|
|
namespace std {
|
|
|
|
|
|
|
|
// std::min for aiVector3D
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiVector3t<TReal> min (const ::aiVector3t<TReal>& a, const ::aiVector3t<TReal>& b) {
|
|
|
|
return ::aiVector3t<TReal> (min(a.x,b.x),min(a.y,b.y),min(a.z,b.z));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
// std::max for aiVector3t<TReal>
|
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiVector3t<TReal> max (const ::aiVector3t<TReal>& a, const ::aiVector3t<TReal>& b) {
|
|
|
|
return ::aiVector3t<TReal> (max(a.x,b.x),max(a.y,b.y),max(a.z,b.z));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
// std::min for aiVector2t<TReal>
|
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiVector2t<TReal> min (const ::aiVector2t<TReal>& a, const ::aiVector2t<TReal>& b) {
|
|
|
|
return ::aiVector2t<TReal> (min(a.x,b.x),min(a.y,b.y));
|
2011-05-13 00:52:50 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
// std::max for aiVector2t<TReal>
|
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiVector2t<TReal> max (const ::aiVector2t<TReal>& a, const ::aiVector2t<TReal>& b) {
|
|
|
|
return ::aiVector2t<TReal> (max(a.x,b.x),max(a.y,b.y));
|
2011-05-13 00:52:50 +00:00
|
|
|
}
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// std::min for aiColor4D
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiColor4t<TReal> min (const ::aiColor4t<TReal>& a, const ::aiColor4t<TReal>& b) {
|
|
|
|
return ::aiColor4t<TReal> (min(a.r,b.r),min(a.g,b.g),min(a.b,b.b),min(a.a,b.a));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// std::max for aiColor4D
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiColor4t<TReal> max (const ::aiColor4t<TReal>& a, const ::aiColor4t<TReal>& b) {
|
|
|
|
return ::aiColor4t<TReal> (max(a.r,b.r),max(a.g,b.g),max(a.b,b.b),max(a.a,b.a));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
|
|
|
|
// std::min for aiQuaterniont<TReal>
|
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiQuaterniont<TReal> min (const ::aiQuaterniont<TReal>& a, const ::aiQuaterniont<TReal>& b) {
|
|
|
|
return ::aiQuaterniont<TReal> (min(a.w,b.w),min(a.x,b.x),min(a.y,b.y),min(a.z,b.z));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
// std::max for aiQuaterniont<TReal>
|
|
|
|
template <typename TReal>
|
|
|
|
inline ::aiQuaterniont<TReal> max (const ::aiQuaterniont<TReal>& a, const ::aiQuaterniont<TReal>& b) {
|
|
|
|
return ::aiQuaterniont<TReal> (max(a.w,b.w),max(a.x,b.x),max(a.y,b.y),max(a.z,b.z));
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// std::min for aiVectorKey
|
|
|
|
inline ::aiVectorKey min (const ::aiVectorKey& a, const ::aiVectorKey& b) {
|
|
|
|
return ::aiVectorKey (min(a.mTime,b.mTime),min(a.mValue,b.mValue));
|
|
|
|
}
|
|
|
|
|
|
|
|
// std::max for aiVectorKey
|
|
|
|
inline ::aiVectorKey max (const ::aiVectorKey& a, const ::aiVectorKey& b) {
|
|
|
|
return ::aiVectorKey (max(a.mTime,b.mTime),max(a.mValue,b.mValue));
|
|
|
|
}
|
|
|
|
|
|
|
|
// std::min for aiQuatKey
|
|
|
|
inline ::aiQuatKey min (const ::aiQuatKey& a, const ::aiQuatKey& b) {
|
|
|
|
return ::aiQuatKey (min(a.mTime,b.mTime),min(a.mValue,b.mValue));
|
|
|
|
}
|
|
|
|
|
|
|
|
// std::max for aiQuatKey
|
|
|
|
inline ::aiQuatKey max (const ::aiQuatKey& a, const ::aiQuatKey& b) {
|
|
|
|
return ::aiQuatKey (max(a.mTime,b.mTime),max(a.mValue,b.mValue));
|
|
|
|
}
|
|
|
|
|
|
|
|
// std::min for aiVertexWeight
|
|
|
|
inline ::aiVertexWeight min (const ::aiVertexWeight& a, const ::aiVertexWeight& b) {
|
|
|
|
return ::aiVertexWeight (min(a.mVertexId,b.mVertexId),min(a.mWeight,b.mWeight));
|
|
|
|
}
|
|
|
|
|
|
|
|
// std::max for aiVertexWeight
|
|
|
|
inline ::aiVertexWeight max (const ::aiVertexWeight& a, const ::aiVertexWeight& b) {
|
|
|
|
return ::aiVertexWeight (max(a.mVertexId,b.mVertexId),max(a.mWeight,b.mWeight));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end namespace std
|
|
|
|
#endif // !! C++
|
|
|
|
|
2008-09-27 16:46:05 +00:00
|
|
|
namespace Assimp {
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Start points for ArrayBounds<T> for all supported Ts
|
|
|
|
template <typename T>
|
|
|
|
struct MinMaxChooser;
|
|
|
|
|
|
|
|
template <> struct MinMaxChooser<float> {
|
|
|
|
void operator ()(float& min,float& max) {
|
2011-05-13 00:52:50 +00:00
|
|
|
max = -1e10f;
|
|
|
|
min = 1e10f;
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}};
|
|
|
|
template <> struct MinMaxChooser<double> {
|
|
|
|
void operator ()(double& min,double& max) {
|
2011-05-13 00:52:50 +00:00
|
|
|
max = -1e10;
|
|
|
|
min = 1e10;
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}};
|
|
|
|
template <> struct MinMaxChooser<unsigned int> {
|
|
|
|
void operator ()(unsigned int& min,unsigned int& max) {
|
|
|
|
max = 0;
|
|
|
|
min = (1u<<(sizeof(unsigned int)*8-1));
|
|
|
|
}};
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename T> struct MinMaxChooser< aiVector3t<T> > {
|
|
|
|
void operator ()(aiVector3t<T>& min,aiVector3t<T>& max) {
|
|
|
|
max = aiVector3t<T>(-1e10f,-1e10f,-1e10f);
|
|
|
|
min = aiVector3t<T>( 1e10f, 1e10f, 1e10f);
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}};
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename T> struct MinMaxChooser< aiVector2t<T> > {
|
|
|
|
void operator ()(aiVector2t<T>& min,aiVector2t<T>& max) {
|
|
|
|
max = aiVector2t<T>(-1e10f,-1e10f);
|
|
|
|
min = aiVector2t<T>( 1e10f, 1e10f);
|
2011-05-13 00:52:50 +00:00
|
|
|
}};
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename T> struct MinMaxChooser< aiColor4t<T> > {
|
|
|
|
void operator ()(aiColor4t<T>& min,aiColor4t<T>& max) {
|
|
|
|
max = aiColor4t<T>(-1e10f,-1e10f,-1e10f,-1e10f);
|
|
|
|
min = aiColor4t<T>( 1e10f, 1e10f, 1e10f, 1e10f);
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}};
|
|
|
|
|
2012-02-02 02:07:43 +00:00
|
|
|
template <typename T> struct MinMaxChooser< aiQuaterniont<T> > {
|
|
|
|
void operator ()(aiQuaterniont<T>& min,aiQuaterniont<T>& max) {
|
|
|
|
max = aiQuaterniont<T>(-1e10f,-1e10f,-1e10f,-1e10f);
|
|
|
|
min = aiQuaterniont<T>( 1e10f, 1e10f, 1e10f, 1e10f);
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
}};
|
|
|
|
|
|
|
|
template <> struct MinMaxChooser<aiVectorKey> {
|
|
|
|
void operator ()(aiVectorKey& min,aiVectorKey& max) {
|
|
|
|
MinMaxChooser<double>()(min.mTime,max.mTime);
|
|
|
|
MinMaxChooser<aiVector3D>()(min.mValue,max.mValue);
|
|
|
|
}};
|
|
|
|
template <> struct MinMaxChooser<aiQuatKey> {
|
|
|
|
void operator ()(aiQuatKey& min,aiQuatKey& max) {
|
|
|
|
MinMaxChooser<double>()(min.mTime,max.mTime);
|
|
|
|
MinMaxChooser<aiQuaternion>()(min.mValue,max.mValue);
|
|
|
|
}};
|
|
|
|
|
|
|
|
template <> struct MinMaxChooser<aiVertexWeight> {
|
|
|
|
void operator ()(aiVertexWeight& min,aiVertexWeight& max) {
|
|
|
|
MinMaxChooser<unsigned int>()(min.mVertexId,max.mVertexId);
|
|
|
|
MinMaxChooser<float>()(min.mWeight,max.mWeight);
|
|
|
|
}};
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
2009-04-02 15:16:01 +00:00
|
|
|
/** @brief Find the min/max values of an array of Ts
|
|
|
|
* @param in Input array
|
|
|
|
* @param size Numebr of elements to process
|
|
|
|
* @param[out] min minimum value
|
|
|
|
* @param[out] max maximum value
|
|
|
|
*/
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
template <typename T>
|
|
|
|
inline void ArrayBounds(const T* in, unsigned int size, T& min, T& max)
|
|
|
|
{
|
|
|
|
MinMaxChooser<T> ()(min,max);
|
|
|
|
for (unsigned int i = 0; i < size;++i) {
|
|
|
|
min = std::min(in[i],min);
|
|
|
|
max = std::max(in[i],max);
|
|
|
|
}
|
|
|
|
}
|
2009-02-02 20:29:27 +00:00
|
|
|
|
2009-04-24 20:53:24 +00:00
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
/** Little helper function to calculate the quadratic difference
|
|
|
|
* of two colours.
|
|
|
|
* @param pColor1 First color
|
|
|
|
* @param pColor2 second color
|
2011-04-15 15:09:53 +00:00
|
|
|
* @return Quadratic color difference */
|
2009-02-02 20:29:27 +00:00
|
|
|
inline float GetColorDifference( const aiColor4D& pColor1, const aiColor4D& pColor2)
|
|
|
|
{
|
2011-04-15 15:09:53 +00:00
|
|
|
const aiColor4D c (pColor1.r - pColor2.r, pColor1.g - pColor2.g, pColor1.b - pColor2.b, pColor1.a - pColor2.a);
|
2009-02-02 20:29:27 +00:00
|
|
|
return c.r*c.r + c.g*c.g + c.b*c.b + c.a*c.a;
|
|
|
|
}
|
2008-09-30 20:20:56 +00:00
|
|
|
|
2011-04-15 15:09:53 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
/** @brief Extract single strings from a list of identifiers
|
|
|
|
* @param in Input string list.
|
|
|
|
* @param out Receives a list of clean output strings
|
|
|
|
* @sdee #AI_CONFIG_PP_OG_EXCLUDE_LIST */
|
|
|
|
void ConvertListToStrings(const std::string& in, std::list<std::string>& out);
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2009-04-02 15:16:01 +00:00
|
|
|
/** @brief Compute the AABB of a mesh after applying a given transform
|
|
|
|
* @param mesh Input mesh
|
|
|
|
* @param[out] min Receives minimum transformed vertex
|
|
|
|
* @param[out] max Receives maximum transformed vertex
|
2011-04-15 15:09:53 +00:00
|
|
|
* @param m Transformation matrix to be applied */
|
|
|
|
void FindAABBTransformed (const aiMesh* mesh, aiVector3D& min, aiVector3D& max, const aiMatrix4x4& m);
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
2009-04-02 15:16:01 +00:00
|
|
|
/** @brief Helper function to determine the 'real' center of a mesh
|
|
|
|
*
|
|
|
|
* That is the center of its axis-aligned bounding box.
|
|
|
|
* @param mesh Input mesh
|
|
|
|
* @param[out] min Minimum vertex of the mesh
|
|
|
|
* @param[out] max maximum vertex of the mesh
|
2011-04-15 15:09:53 +00:00
|
|
|
* @param[out] out Center point */
|
|
|
|
void FindMeshCenter (aiMesh* mesh, aiVector3D& out, aiVector3D& min, aiVector3D& max);
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Helper function to determine the 'real' center of a mesh after applying a given transform
|
2011-04-15 15:09:53 +00:00
|
|
|
void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out, aiVector3D& min,aiVector3D& max, const aiMatrix4x4& m);
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Helper function to determine the 'real' center of a mesh
|
2011-04-15 15:09:53 +00:00
|
|
|
void FindMeshCenter (aiMesh* mesh, aiVector3D& out);
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Helper function to determine the 'real' center of a mesh after applying a given transform
|
2011-04-15 15:09:53 +00:00
|
|
|
void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out,const aiMatrix4x4& m);
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Compute a good epsilon value for position comparisons on a mesh
|
2011-04-15 15:09:53 +00:00
|
|
|
float ComputePositionEpsilon(const aiMesh* pMesh);
|
2008-09-27 16:46:05 +00:00
|
|
|
|
|
|
|
|
2010-01-28 21:17:25 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Compute a good epsilon value for position comparisons on a array of meshes
|
2011-04-15 15:09:53 +00:00
|
|
|
float ComputePositionEpsilon(const aiMesh* const* pMeshes, size_t num);
|
2010-01-28 21:17:25 +00:00
|
|
|
|
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Compute an unique value for the vertex format of a mesh
|
2011-04-15 15:09:53 +00:00
|
|
|
unsigned int GetMeshVFormatUnique(const aiMesh* pcMesh);
|
2009-02-02 20:29:27 +00:00
|
|
|
|
|
|
|
|
2011-04-15 15:09:53 +00:00
|
|
|
// defs for ComputeVertexBoneWeightTable()
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
typedef std::pair <unsigned int,float> PerVertexWeight;
|
|
|
|
typedef std::vector <PerVertexWeight> VertexWeightTable;
|
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-09-30 20:20:56 +00:00
|
|
|
// Compute a per-vertex bone weight table
|
2011-04-15 15:09:53 +00:00
|
|
|
VertexWeightTable* ComputeVertexBoneWeightTable(const aiMesh* pMesh);
|
2008-09-30 20:20:56 +00:00
|
|
|
|
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-11-16 21:56:45 +00:00
|
|
|
// Get a string for a given aiTextureType
|
2011-04-15 15:09:53 +00:00
|
|
|
const char* TextureTypeToString(aiTextureType in);
|
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-11-16 21:56:45 +00:00
|
|
|
// Get a string for a given aiTextureMapping
|
2011-04-15 15:09:53 +00:00
|
|
|
const char* MappingTypeToString(aiTextureMapping in);
|
|
|
|
|
|
|
|
|
|
|
|
// flags for MakeSubmesh()
|
|
|
|
#define AI_SUBMESH_FLAGS_SANS_BONES 0x1
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Split a mesh given a list of faces to be contained in the sub mesh
|
|
|
|
aiMesh* MakeSubmesh(const aiMesh *superMesh, const std::vector<unsigned int> &subMeshFaces, unsigned int subFlags);
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// Utility postprocess step to share the spatial sort tree between
|
|
|
|
// all steps which use it to speedup its computations.
|
2008-09-27 16:46:05 +00:00
|
|
|
class ComputeSpatialSortProcess : public BaseProcess
|
|
|
|
{
|
|
|
|
bool IsActive( unsigned int pFlags) const
|
|
|
|
{
|
|
|
|
return NULL != shared && 0 != (pFlags & (aiProcess_CalcTangentSpace |
|
|
|
|
aiProcess_GenNormals | aiProcess_JoinIdenticalVertices));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Execute( aiScene* pScene)
|
|
|
|
{
|
2010-07-09 17:49:29 +00:00
|
|
|
typedef std::pair<SpatialSort, float> _Type;
|
|
|
|
DefaultLogger::get()->debug("Generate spatially-sorted vertex cache");
|
2008-09-27 16:46:05 +00:00
|
|
|
|
|
|
|
std::vector<_Type>* p = new std::vector<_Type>(pScene->mNumMeshes);
|
|
|
|
std::vector<_Type>::iterator it = p->begin();
|
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
for (unsigned int i = 0; i < pScene->mNumMeshes; ++i, ++it) {
|
2008-09-27 16:46:05 +00:00
|
|
|
aiMesh* mesh = pScene->mMeshes[i];
|
|
|
|
_Type& blubb = *it;
|
|
|
|
blubb.first.Fill(mesh->mVertices,mesh->mNumVertices,sizeof(aiVector3D));
|
|
|
|
blubb.second = ComputePositionEpsilon(mesh);
|
|
|
|
}
|
|
|
|
|
|
|
|
shared->AddProperty(AI_SPP_SPATIAL_SORT,p);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-02-02 20:29:27 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
|
|
|
// ... and the same again to cleanup the whole stuff
|
2008-09-27 16:46:05 +00:00
|
|
|
class DestroySpatialSortProcess : public BaseProcess
|
|
|
|
{
|
|
|
|
bool IsActive( unsigned int pFlags) const
|
|
|
|
{
|
|
|
|
return NULL != shared && 0 != (pFlags & (aiProcess_CalcTangentSpace |
|
|
|
|
aiProcess_GenNormals | aiProcess_JoinIdenticalVertices));
|
|
|
|
}
|
|
|
|
|
2011-06-09 14:29:32 +00:00
|
|
|
void Execute( aiScene* /*pScene*/)
|
2008-09-27 16:46:05 +00:00
|
|
|
{
|
|
|
|
shared->RemoveProperty(AI_SPP_SPATIAL_SORT);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-04-15 15:09:53 +00:00
|
|
|
|
|
|
|
|
2009-01-08 22:44:07 +00:00
|
|
|
} // ! namespace Assimp
|
2008-09-27 16:46:05 +00:00
|
|
|
#endif // !! AI_PROCESS_HELPER_H_INCLUDED
|