Bläddra i källkod

Updated to Open Asset Import Library 3.0.

Lasse Öörni 13 år sedan
förälder
incheckning
eadca81cf4
100 ändrade filer med 2369 tillägg och 1350 borttagningar
  1. 1 1
      Docs/Urho3D.dox
  2. 2 2
      Readme.txt
  3. 88 47
      ThirdParty/Assimp/CMakeLists.txt
  4. 4 4
      ThirdParty/Assimp/code/3DSConverter.cpp
  5. 6 6
      ThirdParty/Assimp/code/3DSHelper.h
  6. 21 8
      ThirdParty/Assimp/code/3DSLoader.cpp
  7. 8 8
      ThirdParty/Assimp/code/3DSLoader.h
  8. 20 10
      ThirdParty/Assimp/code/ACLoader.cpp
  9. 8 8
      ThirdParty/Assimp/code/ACLoader.h
  10. 21 11
      ThirdParty/Assimp/code/ASELoader.cpp
  11. 8 8
      ThirdParty/Assimp/code/ASELoader.h
  12. 6 6
      ThirdParty/Assimp/code/ASEParser.cpp
  13. 7 7
      ThirdParty/Assimp/code/ASEParser.h
  14. 105 140
      ThirdParty/Assimp/code/Assimp.cpp
  15. 5 5
      ThirdParty/Assimp/code/AssimpCExport.cpp
  16. 4 4
      ThirdParty/Assimp/code/AssimpPCH.cpp
  17. 15 14
      ThirdParty/Assimp/code/AssimpPCH.h
  18. 21 6
      ThirdParty/Assimp/code/B3DImporter.cpp
  19. 8 8
      ThirdParty/Assimp/code/B3DImporter.h
  20. 25 5
      ThirdParty/Assimp/code/BVHLoader.cpp
  21. 7 11
      ThirdParty/Assimp/code/BVHLoader.h
  22. 41 10
      ThirdParty/Assimp/code/BaseImporter.cpp
  23. 21 17
      ThirdParty/Assimp/code/BaseImporter.h
  24. 10 10
      ThirdParty/Assimp/code/BaseProcess.cpp
  25. 5 5
      ThirdParty/Assimp/code/BaseProcess.h
  26. 4 4
      ThirdParty/Assimp/code/BlenderDNA.cpp
  27. 4 4
      ThirdParty/Assimp/code/BlenderDNA.h
  28. 4 4
      ThirdParty/Assimp/code/BlenderDNA.inl
  29. 4 4
      ThirdParty/Assimp/code/BlenderIntermediate.h
  30. 21 13
      ThirdParty/Assimp/code/BlenderLoader.cpp
  31. 5 31
      ThirdParty/Assimp/code/BlenderLoader.h
  32. 6 4
      ThirdParty/Assimp/code/BlenderModifier.cpp
  33. 4 4
      ThirdParty/Assimp/code/BlenderModifier.h
  34. 10 2
      ThirdParty/Assimp/code/BlenderScene.cpp
  35. 9 8
      ThirdParty/Assimp/code/BlenderScene.h
  36. 4 4
      ThirdParty/Assimp/code/BlobIOSystem.h
  37. 6 6
      ThirdParty/Assimp/code/ByteSwap.h
  38. 7 8
      ThirdParty/Assimp/code/CInterfaceIOWrapper.h
  39. 21 8
      ThirdParty/Assimp/code/COBLoader.cpp
  40. 5 5
      ThirdParty/Assimp/code/COBLoader.h
  41. 4 4
      ThirdParty/Assimp/code/COBScene.h
  42. 24 10
      ThirdParty/Assimp/code/CSMLoader.cpp
  43. 5 5
      ThirdParty/Assimp/code/CSMLoader.h
  44. 6 6
      ThirdParty/Assimp/code/CalcTangentsProcess.cpp
  45. 4 4
      ThirdParty/Assimp/code/CalcTangentsProcess.h
  46. 243 11
      ThirdParty/Assimp/code/ColladaExporter.cpp
  47. 40 5
      ThirdParty/Assimp/code/ColladaExporter.h
  48. 4 4
      ThirdParty/Assimp/code/ColladaHelper.h
  49. 183 128
      ThirdParty/Assimp/code/ColladaLoader.cpp
  50. 8 8
      ThirdParty/Assimp/code/ColladaLoader.h
  51. 40 28
      ThirdParty/Assimp/code/ColladaParser.cpp
  52. 4 4
      ThirdParty/Assimp/code/ColladaParser.h
  53. 8 8
      ThirdParty/Assimp/code/ComputeUVMappingProcess.cpp
  54. 5 5
      ThirdParty/Assimp/code/ComputeUVMappingProcess.h
  55. 4 4
      ThirdParty/Assimp/code/ConvertToLHProcess.cpp
  56. 5 5
      ThirdParty/Assimp/code/ConvertToLHProcess.h
  57. 4 4
      ThirdParty/Assimp/code/DXFHelper.h
  58. 32 17
      ThirdParty/Assimp/code/DXFLoader.cpp
  59. 7 7
      ThirdParty/Assimp/code/DXFLoader.h
  60. 4 4
      ThirdParty/Assimp/code/DeboneProcess.cpp
  61. 6 6
      ThirdParty/Assimp/code/DeboneProcess.h
  62. 4 4
      ThirdParty/Assimp/code/DefaultIOStream.cpp
  63. 5 5
      ThirdParty/Assimp/code/DefaultIOStream.h
  64. 4 4
      ThirdParty/Assimp/code/DefaultIOSystem.cpp
  65. 5 5
      ThirdParty/Assimp/code/DefaultIOSystem.h
  66. 4 4
      ThirdParty/Assimp/code/DefaultLogger.cpp
  67. 6 6
      ThirdParty/Assimp/code/DefaultProgressHandler.h
  68. 4 4
      ThirdParty/Assimp/code/Exceptional.h
  69. 11 4
      ThirdParty/Assimp/code/Exporter.cpp
  70. 2 2
      ThirdParty/Assimp/code/FileLogStream.h
  71. 62 14
      ThirdParty/Assimp/code/FileSystemFilter.h
  72. 4 4
      ThirdParty/Assimp/code/FindDegenerates.cpp
  73. 5 5
      ThirdParty/Assimp/code/FindDegenerates.h
  74. 4 4
      ThirdParty/Assimp/code/FindInstancesProcess.cpp
  75. 4 4
      ThirdParty/Assimp/code/FindInstancesProcess.h
  76. 4 4
      ThirdParty/Assimp/code/FindInvalidDataProcess.cpp
  77. 5 5
      ThirdParty/Assimp/code/FindInvalidDataProcess.h
  78. 4 4
      ThirdParty/Assimp/code/FixNormalsStep.cpp
  79. 4 4
      ThirdParty/Assimp/code/FixNormalsStep.h
  80. 6 6
      ThirdParty/Assimp/code/GenFaceNormalsProcess.cpp
  81. 5 5
      ThirdParty/Assimp/code/GenFaceNormalsProcess.h
  82. 17 12
      ThirdParty/Assimp/code/GenVertexNormalsProcess.cpp
  83. 5 5
      ThirdParty/Assimp/code/GenVertexNormalsProcess.h
  84. 5 5
      ThirdParty/Assimp/code/GenericProperty.h
  85. 6 6
      ThirdParty/Assimp/code/HMPFileData.h
  86. 19 6
      ThirdParty/Assimp/code/HMPLoader.cpp
  87. 10 10
      ThirdParty/Assimp/code/HMPLoader.h
  88. 6 6
      ThirdParty/Assimp/code/HalfLifeFileData.h
  89. 4 4
      ThirdParty/Assimp/code/Hash.h
  90. 66 64
      ThirdParty/Assimp/code/IFCCurve.cpp
  91. 675 236
      ThirdParty/Assimp/code/IFCGeometry.cpp
  92. 37 20
      ThirdParty/Assimp/code/IFCLoader.cpp
  93. 5 5
      ThirdParty/Assimp/code/IFCLoader.h
  94. 7 7
      ThirdParty/Assimp/code/IFCMaterial.cpp
  95. 14 14
      ThirdParty/Assimp/code/IFCProfile.cpp
  96. 4 4
      ThirdParty/Assimp/code/IFCReaderGen.cpp
  97. 4 4
      ThirdParty/Assimp/code/IFCReaderGen.h
  98. 63 63
      ThirdParty/Assimp/code/IFCUtil.cpp
  99. 47 33
      ThirdParty/Assimp/code/IFCUtil.h
  100. 2 2
      ThirdParty/Assimp/code/IFF.h

+ 1 - 1
Docs/Urho3D.dox

@@ -69,7 +69,7 @@ Urho3D uses the following third-party libraries:
 - GLee 5.4 (http://elf-stone.com/)
 - kNet (https://github.com/juj/kNet)
 - libcpuid 0.2.0 (http://libcpuid.sourceforge.net/)
-- Open Asset Import Library, svn rev 1102 (http://assimp.sourceforge.net/)
+- Open Asset Import Library 3.0 (http://assimp.sourceforge.net/)
 - pugixml 1.0 (http://pugixml.org/)
 - SDL 2.0 (http://www.libsdl.org/)
 - StanHull (http://codesuppository.blogspot.com/2006/03/john-ratcliffs-code-suppository-blog.html)

+ 2 - 2
Readme.txt

@@ -42,7 +42,7 @@ Urho3D uses the following third-party libraries:
 - GLee 5.4 (http://elf-stone.com/)
 - kNet (https://github.com/juj/kNet)
 - libcpuid 0.2.0 (http://libcpuid.sourceforge.net/)
-- Open Asset Import Library, svn rev 1102 (http://assimp.sourceforge.net/)
+- Open Asset Import Library 3.0 (http://assimp.sourceforge.net/)
 - pugixml 1.0 (http://pugixml.org/)
 - SDL 2.0 (http://www.libsdl.org/)
 - StanHull (http://codesuppository.blogspot.com/2006/03/
@@ -261,4 +261,4 @@ V1.21   - Bugfixes and code cleanup.
         - UI elements refactored to use attributes for serialization.
         - Animation state editing and animation trigger events.
         - Scene update time scale can be modified.
-        - Improved the delayed method call system.
+        - Improved the delayed method call system.

+ 88 - 47
ThirdParty/Assimp/CMakeLists.txt

@@ -6,12 +6,14 @@
 #    source groups and library command)
 #
 
+# Modified by Lasse Oorni for Urho3D
+
 INCLUDE_DIRECTORIES( include )
 INCLUDE_DIRECTORIES( code/BoostWorkaround )
 INCLUDE_DIRECTORIES( contrib/unzip )
 ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND )
-	
-SET( HEADER_PATH include )
+
+SET( HEADER_PATH include/assimp )
 
 SET( COMPILER_HEADERS
 	${HEADER_PATH}/Compiler/pushpack1.h
@@ -21,42 +23,45 @@ SET( COMPILER_HEADERS
 SOURCE_GROUP( Compiler FILES ${COMPILER_HEADERS})
 
 SET( PUBLIC_HEADERS
-	${HEADER_PATH}/aiAnim.h
-	${HEADER_PATH}/aiAssert.h
-	${HEADER_PATH}/aiCamera.h
-	${HEADER_PATH}/aiColor4D.h
-	${HEADER_PATH}/aiColor4D.inl
-	${HEADER_PATH}/aiConfig.h
-	${HEADER_PATH}/aiDefines.h
-	${HEADER_PATH}/aiFileIO.h
-	${HEADER_PATH}/aiLight.h
-	${HEADER_PATH}/aiMaterial.h
-	${HEADER_PATH}/aiMaterial.inl
-	${HEADER_PATH}/aiMatrix3x3.h
-	${HEADER_PATH}/aiMatrix3x3.inl
-	${HEADER_PATH}/aiMatrix4x4.h
-	${HEADER_PATH}/aiMatrix4x4.inl
-	${HEADER_PATH}/aiMesh.h
-	${HEADER_PATH}/aiPostProcess.h
-	${HEADER_PATH}/aiQuaternion.h
-	${HEADER_PATH}/aiScene.h
-	${HEADER_PATH}/aiTexture.h
-	${HEADER_PATH}/aiTypes.h
-	${HEADER_PATH}/aiVector2D.h
-	${HEADER_PATH}/aiVector3D.h
-	${HEADER_PATH}/aiVector3D.inl
-	${HEADER_PATH}/aiVersion.h
-	${HEADER_PATH}/assimp.h
-	${HEADER_PATH}/assimp.hpp
-	${HEADER_PATH}/DefaultLogger.h
-	${HEADER_PATH}/ProgressHandler.h
-	${HEADER_PATH}/IOStream.h
-	${HEADER_PATH}/IOSystem.h
-	${HEADER_PATH}/Logger.h
-	${HEADER_PATH}/LogStream.h
-	${HEADER_PATH}/NullLogger.h
-	${HEADER_PATH}/export.h
-	${HEADER_PATH}/export.hpp
+	${HEADER_PATH}/anim.h
+	${HEADER_PATH}/ai_assert.h
+	${HEADER_PATH}/camera.h
+	${HEADER_PATH}/color4.h
+	${HEADER_PATH}/color4.inl
+	${HEADER_PATH}/config.h
+	${HEADER_PATH}/defs.h
+	${HEADER_PATH}/cfileio.h
+	${HEADER_PATH}/light.h
+	${HEADER_PATH}/material.h
+	${HEADER_PATH}/material.inl
+	${HEADER_PATH}/matrix3x3.h
+	${HEADER_PATH}/matrix3x3.inl
+	${HEADER_PATH}/matrix4x4.h
+	${HEADER_PATH}/matrix4x4.inl
+	${HEADER_PATH}/mesh.h
+	${HEADER_PATH}/postprocess.h
+	${HEADER_PATH}/quaternion.h
+	${HEADER_PATH}/quaternion.inl
+	${HEADER_PATH}/scene.h
+	${HEADER_PATH}/texture.h
+	${HEADER_PATH}/types.h
+	${HEADER_PATH}/vector2.h
+	${HEADER_PATH}/vector2.inl
+	${HEADER_PATH}/vector3.h
+	${HEADER_PATH}/vector3.inl
+	${HEADER_PATH}/version.h
+	${HEADER_PATH}/cimport.h
+	${HEADER_PATH}/importerdesc.h
+	${HEADER_PATH}/Importer.hpp
+	${HEADER_PATH}/DefaultLogger.hpp
+	${HEADER_PATH}/ProgressHandler.hpp
+	${HEADER_PATH}/IOStream.hpp
+	${HEADER_PATH}/IOSystem.hpp
+	${HEADER_PATH}/Logger.hpp
+	${HEADER_PATH}/LogStream.hpp
+	${HEADER_PATH}/NullLogger.hpp
+	${HEADER_PATH}/cexport.h
+	${HEADER_PATH}/Exporter.hpp
 )
 
 SET( Core_SRCS
@@ -80,11 +85,11 @@ SET( Boost_SRCS
 SOURCE_GROUP(Boost FILES ${Boost_SRCS})
 
 SET( Logging_SRCS
-	${HEADER_PATH}/DefaultLogger.h
-	${HEADER_PATH}/IOStream.h
-	${HEADER_PATH}/LogStream.h
-	${HEADER_PATH}/Logger.h
-	${HEADER_PATH}/NullLogger.h
+	${HEADER_PATH}/DefaultLogger.hpp
+	${HEADER_PATH}/IOStream.hpp
+	${HEADER_PATH}/LogStream.hpp
+	${HEADER_PATH}/Logger.hpp
+	${HEADER_PATH}/NullLogger.hpp
 	code/Win32DebugLogStream.h
 	code/DefaultLogger.cpp
 	code/FileLogStream.h
@@ -326,9 +331,12 @@ SET( Obj_SRCS
 SOURCE_GROUP( Obj FILES ${Obj_SRCS})
 
 SET( Ogre_SRCS
-	code/OgreImporter.h
+	code/OgreImporter.hpp
+	code/OgreXmlHelper.hpp
 	code/OgreImporter.cpp
-	code/OgreImporterMaterial.cpp
+	code/OgreMaterial.cpp
+	code/OgreMesh.cpp
+	code/OgreSkeleton.cpp
 )
 SOURCE_GROUP( Ogre FILES ${Ogre_SRCS})
 
@@ -337,6 +345,8 @@ SET( Ply_SRCS
 	code/PlyLoader.h
 	code/PlyParser.cpp
 	code/PlyParser.h
+	code/PlyExporter.cpp
+	code/PlyExporter.h
 )
 SOURCE_GROUP( Ply FILES ${Ply_SRCS})
 
@@ -385,6 +395,13 @@ SET(IFC_SRCS
 )
 SOURCE_GROUP( IFC FILES ${IFC_SRCS})
 
+SET( XGL_SRCS
+	code/XGLLoader.cpp
+	code/XGLLoader.h
+)
+SOURCE_GROUP( XGL FILES ${XGL_SRCS})
+
+
 SET( PostProcessing_SRCS
 	code/CalcTangentsProcess.cpp
 	code/CalcTangentsProcess.h
@@ -524,6 +541,27 @@ SET( ConvertUTF_SRCS
 )
 SOURCE_GROUP( ConvertUTF FILES ${ConvertUTF_SRCS})
 
+SET( Clipper_SRCS
+	contrib/clipper/clipper.hpp
+	contrib/clipper/clipper.cpp
+)
+SOURCE_GROUP( Clipper FILES ${Clipper_SRCS})
+
+SET( Poly2Tri_SRCS
+	contrib/poly2tri/poly2tri/common/shapes.cc
+	contrib/poly2tri/poly2tri/common/shapes.h
+	contrib/poly2tri/poly2tri/common/utils.h
+	contrib/poly2tri/poly2tri/sweep/advancing_front.h
+	contrib/poly2tri/poly2tri/sweep/advancing_front.cc
+	contrib/poly2tri/poly2tri/sweep/cdt.cc
+	contrib/poly2tri/poly2tri/sweep/cdt.h
+	contrib/poly2tri/poly2tri/sweep/sweep.cc
+	contrib/poly2tri/poly2tri/sweep/sweep.h
+	contrib/poly2tri/poly2tri/sweep/sweep_context.cc
+	contrib/poly2tri/poly2tri/sweep/sweep_context.h
+)
+SOURCE_GROUP( Poly2Tri FILES ${Poly2Tri_SRCS})
+
 SET( unzip_SRCS
 	contrib/unzip/crypt.h
 	contrib/unzip/ioapi.c
@@ -561,7 +599,7 @@ if ( MSVC80 OR MSVC90 OR MSVC10 )
 	ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
 endif ( MSVC80 OR MSVC90 OR MSVC10 )
 
-SET ( SOURCE_FILES
+SET( SOURCE_FILES
 	# Assimp Files
 	${Core_SRCS}
 	${Common_SRCS}
@@ -607,14 +645,17 @@ SET ( SOURCE_FILES
 	${BLENDER_SRCS}
 	${NDO_SRCS}
 	${IFC_SRCS}
+	${XGL_SRCS}
 )
 
-SET ( CONTRIB_FILES	
+SET( CONTRIB_FILES
 	# Third-party libraries
 	${IrrXML_SRCS}
 	${ConvertUTF_SRCS}
 	${unzip_SRCS}
 	${zlib_SRCS}
+	${Poly2Tri_SRCS}
+	${Clipper_SRCS}
 	# Necessary to show the headers in the project when using the VC++ generator:
 	${Boost_SRCS}
 )

+ 4 - 4
ThirdParty/Assimp/code/3DSConverter.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 6 - 6
ThirdParty/Assimp/code/3DSHelper.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 namespace Assimp	{
 namespace D3DS	{
 
-#include "./../include/Compiler/pushpack1.h"
+#include "./../include/assimp/Compiler/pushpack1.h"
 
 // ---------------------------------------------------------------------------
 /** Discreet3DS class: Helper class for loading 3ds files. Defines chunks
@@ -352,7 +352,7 @@ struct Texture
 	int iUVSrc;
 };
 
-#include "./../include/Compiler/poppack1.h"
+#include "./../include/assimp/Compiler/poppack1.h"
 
 // ---------------------------------------------------------------------------
 /** Helper structure representing a 3ds material */

+ 21 - 8
ThirdParty/Assimp/code/3DSLoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -52,6 +52,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "3DSLoader.h"
 
 using namespace Assimp;
+
+static const aiImporterDesc desc = {
+	"Discreet 3DS Importer",
+	"",
+	"",
+	"Limited animation support",
+	aiImporterFlags_SupportBinaryFlavour,
+	0,
+	0,
+	0,
+	0,
+	"3ds prj" 
+};
+
 		
 // ------------------------------------------------------------------------------------------------
 // Begins a new parsing block
@@ -108,11 +122,10 @@ bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandle
 }
 
 // ------------------------------------------------------------------------------------------------
-// Get list of all extension supported by this loader
-void Discreet3DSImporter::GetExtensionList(std::set<std::string>& extensions)
+// Loader registry entry
+const aiImporterDesc* Discreet3DSImporter::GetInfo () const
 {
-	extensions.insert("3ds");
-	extensions.insert("prj");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------

+ 8 - 8
ThirdParty/Assimp/code/3DSLoader.h

@@ -1,9 +1,9 @@
 
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -19,10 +19,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_3DSIMPORTER_H_INC
 
 #include "BaseImporter.h"
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 
 struct aiNode;
 #include "3DSHelper.h"
@@ -85,10 +85,10 @@ public:
 protected:
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details
 	 */
-	void GetExtensionList(std::set<std::string>& extensions);
+	const aiImporterDesc* GetInfo () const;
 
 	// -------------------------------------------------------------------
 	/** Imports the given file into the given scene structure. 

+ 20 - 10
ThirdParty/Assimp/code/ACLoader.cpp

@@ -1,10 +1,10 @@
 
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -21,10 +21,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -54,6 +54,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+static const aiImporterDesc desc = {
+	"AC3D Importer",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportTextFlavour,
+	0,
+	0,
+	0,
+	0,
+	"ac acc ac3d"
+};
 
 // ------------------------------------------------------------------------------------------------
 // skip to the next token
@@ -100,7 +112,7 @@ using namespace Assimp;
 	for (unsigned int i = 0; i < num;++i) \
 	{ \
 		AI_AC_SKIP_TO_NEXT_TOKEN(); \
-		buffer = fast_atof_move(buffer,((float*)out)[i]); \
+		buffer = fast_atoreal_move<float>(buffer,((float*)out)[i]); \
 	}
 
 
@@ -136,12 +148,10 @@ bool AC3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 }
 
 // ------------------------------------------------------------------------------------------------
-// Get list of file extensions handled by this loader
-void AC3DImporter::GetExtensionList(std::set<std::string>& extensions)
+// Loader meta information
+const aiImporterDesc* AC3DImporter::GetInfo () const
 {
-	extensions.insert("ac");
-	extensions.insert("acc");
-	extensions.insert("ac3d");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------

+ 8 - 8
ThirdParty/Assimp/code/ACLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <vector>
 
 #include "BaseImporter.h"
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 
 namespace Assimp	{
 
@@ -183,9 +183,9 @@ public:
 protected:
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details */
-	void GetExtensionList(std::set<std::string>& extensions);
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details */
+	const aiImporterDesc* GetInfo () const;
 
 	// -------------------------------------------------------------------
 	/** Imports the given file into the given scene structure. 

+ 21 - 11
ThirdParty/Assimp/code/ASELoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -58,6 +58,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 using namespace Assimp;
 using namespace Assimp::ASE;
 
+static const aiImporterDesc desc = {
+	"ASE Importer",
+	"",
+	"",
+	"Similar to 3DS but text-encoded",
+	aiImporterFlags_SupportTextFlavour,
+	0,
+	0,
+	0,
+	0,
+	"ase ask" 
+};
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 ASEImporter::ASEImporter()
@@ -86,10 +99,10 @@ bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 }
 
 // ------------------------------------------------------------------------------------------------
-void ASEImporter::GetExtensionList(std::set<std::string>& extensions)
+// Loader meta information
+const aiImporterDesc* ASEImporter::GetInfo () const
 {
-	extensions.insert("ase");
-	extensions.insert("ask");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -1152,7 +1165,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
 
 		// copy vertex bones
 		if (!mesh.mBones.empty() && !mesh.mBoneVertices.empty())	{
-			std::vector<aiVertexWeight>* avBonesOut = new std::vector<aiVertexWeight>[mesh.mBones.size()];
+			std::vector<std::vector<aiVertexWeight> > avBonesOut( mesh.mBones.size() );
 
 			// find all vertex weights for this bone
 			unsigned int quak = 0;
@@ -1188,9 +1201,6 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
 					++pcBone;
 				}
 			}
-
-			// delete allocated storage
-			delete[] avBonesOut;
 		}
 	}
 }

+ 8 - 8
ThirdParty/Assimp/code/ASELoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_ASELOADER_H_INCLUDED
 
 #include "BaseImporter.h"
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 
 struct aiNode;
 #include "ASEParser.h"
@@ -75,10 +75,10 @@ public:
 protected:
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details
 	 */
-	void GetExtensionList(std::set<std::string>& extensions);
+	const aiImporterDesc* GetInfo () const;
 
 
 	// -------------------------------------------------------------------

+ 6 - 6
ThirdParty/Assimp/code/ASEParser.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -1614,7 +1614,7 @@ void Parser::ParseLV4MeshBonesVertices(unsigned int iNumVertices,ASE::Mesh& mesh
 
 					// then parse the vertex weight
 					if (!SkipSpaces(&filePtr))break;
-					filePtr = fast_atof_move(filePtr,pairOut.second);
+					filePtr = fast_atoreal_move<float>(filePtr,pairOut.second);
 
 					// -1 marks unused entries
 					if (-1 != pairOut.first)
@@ -2131,7 +2131,7 @@ void Parser::ParseLV4MeshFloat(float& fOut)
 		return;
 	}
 	// parse the first float
-	filePtr = fast_atof_move(filePtr,fOut);
+	filePtr = fast_atoreal_move<float>(filePtr,fOut);
 }
 // ------------------------------------------------------------------------------------------------
 void Parser::ParseLV4MeshLong(unsigned int& iOut)

+ 7 - 7
ThirdParty/Assimp/code/ASEParser.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -49,9 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <list>
 
 // public ASSIMP headers
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
+#include "../include/assimp/types.h"
+#include "../include/assimp/mesh.h"
+#include "../include/assimp/anim.h"
 
 // for some helper routines like IsSpace()
 #include "ParsingUtils.h"

+ 105 - 140
ThirdParty/Assimp/code/Assimp.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "AssimpPCH.h"
-#include "../include/assimp.h"
+#include "../include/assimp/cimport.h"
 
 #include "GenericProperty.h"
 #include "CInterfaceIOWrapper.h"
@@ -59,9 +59,8 @@ using namespace Assimp;
 
 namespace Assimp
 {
-
-	/** Stores the importer objects for all active import processes */
-	typedef std::map<const aiScene*, Assimp::Importer*> ImporterMap;
+	// underlying structure for aiPropertyStore
+	typedef BatchLoader::PropertyMap PropertyMap;
 
 	/** Stores the LogStream objects for all active C log streams */
 	struct mpred {
@@ -74,9 +73,6 @@ namespace Assimp
 	/** Stores the LogStream objects allocated by #aiGetPredefinedLogStream */
 	typedef std::list<Assimp::LogStream*> PredefLogStreamMap;
 
-	/** Local storage of all active import processes */
-	static ImporterMap gActiveImports;
-
 	/** Local storage of all active log streams */
 	static LogStreamMap gActiveLogStreams;
 
@@ -90,22 +86,13 @@ namespace Assimp
 	static aiBool gVerboseLogging = false;
 }
 
-/** Configuration properties */
-static ImporterPimpl::IntPropertyMap gIntProperties;
-static ImporterPimpl::FloatPropertyMap gFloatProperties;
-static ImporterPimpl::StringPropertyMap	gStringProperties;
 
 #ifdef AI_C_THREADSAFE
-/** Global mutex to manage the access to the importer map */
-static boost::mutex gMutex;
-
 /** Global mutex to manage the access to the logstream map */
 static boost::mutex gLogStreamMutex;
 #endif
 
 
-
-
 // ------------------------------------------------------------------------------------------------
 // Custom LogStream implementation for the C-API
 class LogToCallbackRedirector : public LogStream
@@ -147,7 +134,7 @@ private:
 void ReportSceneNotFoundError()
 {
 	DefaultLogger::get()->error("Unable to find the Assimp::Importer for this aiScene. "
-		"Are you playing fools with us? Don't mix cpp and c API. Thanks.");
+		"The C-API does not accept scenes produced by the C++ API and vice versa");
 
 	assert(false);
 }
@@ -160,8 +147,15 @@ const aiScene* aiImportFile( const char* pFile, unsigned int pFlags)
 }
 
 // ------------------------------------------------------------------------------------------------
-const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags, 
-	aiFileIO* pFS)
+const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags,  aiFileIO* pFS)
+{
+	return aiImportFileExWithProperties(pFile, pFlags, pFS, NULL);
+}
+
+// ------------------------------------------------------------------------------------------------
+const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags, 
+	aiFileIO* pFS,
+	const aiPropertyStore* props)
 {
 	ai_assert(NULL != pFile);
 
@@ -171,18 +165,14 @@ const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags,
 	// create an Importer for this file
 	Assimp::Importer* imp = new Assimp::Importer();
 
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-	// copy the global property lists to the Importer instance
-	imp->pimpl->mIntProperties = gIntProperties;
-	imp->pimpl->mFloatProperties = gFloatProperties;
-	imp->pimpl->mStringProperties = gStringProperties;
-
-#ifdef AI_C_THREADSAFE
-	lock.unlock();
-#endif
-
+	// copy properties
+	if(props) {
+		const PropertyMap* pp = reinterpret_cast<const PropertyMap*>(props);
+		ImporterPimpl* pimpl = imp->Pimpl();
+		pimpl->mIntProperties = pp->ints;
+		pimpl->mFloatProperties = pp->floats;
+		pimpl->mStringProperties = pp->strings;
+	}
 	// setup a custom IO system if necessary
 	if (pFS)	{
 		imp->SetIOHandler( new CIOSystemWrapper (pFS) );
@@ -191,12 +181,10 @@ const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags,
 	// and have it read the file
 	scene = imp->ReadFile( pFile, pFlags);
 
-	// if succeeded, place it in the collection of active processes
+	// if succeeded, store the importer in the scene and keep it alive
 	if( scene)	{
-#ifdef AI_C_THREADSAFE
-		lock.lock();
-#endif
-		gActiveImports[scene] = imp;
+		ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) );
+		priv->mOrigImporter = imp;
 	} 
 	else	{
 		// if failed, extract error code and destroy the import
@@ -215,6 +203,17 @@ const aiScene* aiImportFileFromMemory(
 	unsigned int pLength,
 	unsigned int pFlags,
 	const char* pHint)
+{
+	return aiImportFileFromMemoryWithProperties(pBuffer, pLength, pFlags, pHint, NULL);
+}
+
+// ------------------------------------------------------------------------------------------------
+const aiScene* aiImportFileFromMemoryWithProperties( 
+	const char* pBuffer,
+	unsigned int pLength,
+	unsigned int pFlags,
+	const char* pHint,
+	const aiPropertyStore* props)
 {
 	ai_assert(NULL != pBuffer && 0 != pLength);
 
@@ -224,27 +223,22 @@ const aiScene* aiImportFileFromMemory(
 	// create an Importer for this file
 	Assimp::Importer* imp = new Assimp::Importer();
 
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-	// copy the global property lists to the Importer instance
-	imp->pimpl->mIntProperties = gIntProperties;
-	imp->pimpl->mFloatProperties = gFloatProperties;
-	imp->pimpl->mStringProperties = gStringProperties;
-
-#ifdef AI_C_THREADSAFE
-	lock.unlock();
-#endif
+	// copy properties
+	if(props) {
+		const PropertyMap* pp = reinterpret_cast<const PropertyMap*>(props);
+		ImporterPimpl* pimpl = imp->Pimpl();
+		pimpl->mIntProperties = pp->ints;
+		pimpl->mFloatProperties = pp->floats;
+		pimpl->mStringProperties = pp->strings;
+	}
 
 	// and have it read the file from the memory buffer
 	scene = imp->ReadFileFromMemory( pBuffer, pLength, pFlags,pHint);
 
-	// if succeeded, place it in the collection of active processes
+	// if succeeded, store the importer in the scene and keep it alive
 	if( scene)	{
-#ifdef AI_C_THREADSAFE
-		lock.lock();
-#endif
-		gActiveImports[scene] = imp;
+		 ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) );
+		 priv->mOrigImporter = imp;
 	} 
 	else	{
 		// if failed, extract error code and destroy the import
@@ -265,22 +259,20 @@ void aiReleaseImport( const aiScene* pScene)
 	}
 
 	ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
 	
 	// find the importer associated with this data
-	ImporterMap::iterator it = gActiveImports.find( pScene);
-	// it should be there... else the user is playing fools with us
-	if( it == gActiveImports.end())	{
-		ReportSceneNotFoundError();
-		return;
+	const ScenePrivateData* priv = ScenePriv(pScene);
+	if( !priv || !priv->mOrigImporter)	{
+		delete pScene;
 	}
-
-	// kill the importer, the data dies with it
-	delete it->second;
-	gActiveImports.erase( it);
+	else {
+		// deleting the Importer also deletes the scene
+		// Note: the reason that this is not written as 'delete priv->mOrigImporter'
+		// is a suspected bug in gcc 4.4+ (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339)
+		Importer* importer = priv->mOrigImporter;
+		delete importer;
+	}
+	
 	ASSIMP_END_EXCEPTION_REGION(void);
 }
 
@@ -293,27 +285,17 @@ ASSIMP_API const aiScene* aiApplyPostProcessing(const aiScene* pScene,
 
 	ASSIMP_BEGIN_EXCEPTION_REGION();
 
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
 	// find the importer associated with this data
-	ImporterMap::iterator it = gActiveImports.find( pScene);
-	// it should be there... else the user is playing fools with us
-	if( it == gActiveImports.end())	{
+	const ScenePrivateData* priv = ScenePriv(pScene);
+	if( !priv || !priv->mOrigImporter)	{
 		ReportSceneNotFoundError();
 		return NULL;
 	}
-#ifdef AI_C_THREADSAFE
-	lock.unlock();
-#endif
-	sc = it->second->ApplyPostProcessing(pFlags);
-#ifdef AI_C_THREADSAFE
-	lock.lock();
-#endif
+
+	sc = priv->mOrigImporter->ApplyPostProcessing(pFlags);
+
 	if (!sc) {
-		// kill the importer, the data dies with it
-		delete it->second;
-		gActiveImports.erase( it);
+		aiReleaseImport(pScene);
 		return NULL;
 	}
 
@@ -435,15 +417,7 @@ aiBool aiIsExtensionSupported(const char* szExtension)
 	aiBool candoit=AI_FALSE;
 	ASSIMP_BEGIN_EXCEPTION_REGION();
 
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-
-	if (!gActiveImports.empty())	{
-		return ((*(gActiveImports.begin())).second->IsExtensionSupported( szExtension )) ? AI_TRUE : AI_FALSE;
-	}
-
-	// fixme: no need to create a temporary Importer instance just for that .. 
+	// FIXME: no need to create a temporary Importer instance just for that .. 
 	Assimp::Importer tmp;
 	candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE;
 
@@ -458,15 +432,7 @@ void aiGetExtensionList(aiString* szOut)
 	ai_assert(NULL != szOut);
 	ASSIMP_BEGIN_EXCEPTION_REGION();
 
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-
-	if (!gActiveImports.empty()) {
-		(*(gActiveImports.begin())).second->GetExtensionList(*szOut);
-		return;
-	}
-	// fixme: no need to create a temporary Importer instance just for that .. 
+	// FIXME: no need to create a temporary Importer instance just for that .. 
 	Assimp::Importer tmp;
 	tmp.GetExtensionList(*szOut);
 
@@ -479,63 +445,62 @@ void aiGetMemoryRequirements(const C_STRUCT aiScene* pIn,
 	C_STRUCT aiMemoryInfo* in)
 {
 	ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
 
 	// find the importer associated with this data
-	ImporterMap::iterator it = gActiveImports.find( pIn);
-	// it should be there... else the user is playing fools with us
-	if( it == gActiveImports.end())	{
+	const ScenePrivateData* priv = ScenePriv(pIn);
+	if( !priv || !priv->mOrigImporter)	{
 		ReportSceneNotFoundError();
 		return;
 	}
-	// get memory statistics
-#ifdef AI_C_THREADSAFE
-	lock.unlock();
-#endif
-	it->second->GetMemoryRequirements(*in);
+
+	return priv->mOrigImporter->GetMemoryRequirements(*in);
 	ASSIMP_END_EXCEPTION_REGION(void);
 }
 
+// ------------------------------------------------------------------------------------------------
+ASSIMP_API aiPropertyStore* aiCreatePropertyStore(void)
+{
+	return reinterpret_cast<aiPropertyStore*>( new PropertyMap() );
+}
+
+
+// ------------------------------------------------------------------------------------------------
+ASSIMP_API void aiReleasePropertyStore(aiPropertyStore* p)
+{
+	delete reinterpret_cast<PropertyMap*>(p);
+}
+
 // ------------------------------------------------------------------------------------------------
 // Importer::SetPropertyInteger
-ASSIMP_API void aiSetImportPropertyInteger(const char* szName, int value)
+ASSIMP_API void aiSetImportPropertyInteger(aiPropertyStore* p, const char* szName, int value)
 {
 	ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-	SetGenericProperty<int>(gIntProperties,szName,value,NULL);
+	PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
+	SetGenericProperty<int>(pp->ints,szName,value,NULL);
 	ASSIMP_END_EXCEPTION_REGION(void);
 }
 
 // ------------------------------------------------------------------------------------------------
 // Importer::SetPropertyFloat
-ASSIMP_API void aiSetImportPropertyFloat(const char* szName, float value)
+ASSIMP_API void aiSetImportPropertyFloat(aiPropertyStore* p, const char* szName, float value)
 {
 	ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-	SetGenericProperty<float>(gFloatProperties,szName,value,NULL);
+	PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
+	SetGenericProperty<float>(pp->floats,szName,value,NULL);
 	ASSIMP_END_EXCEPTION_REGION(void);
 }
 
 // ------------------------------------------------------------------------------------------------
 // Importer::SetPropertyString
-ASSIMP_API void aiSetImportPropertyString(const char* szName,
+ASSIMP_API void aiSetImportPropertyString(aiPropertyStore* p, const char* szName,
 	const C_STRUCT aiString* st)
 {
 	if (!st) {
 		return;
 	}
 	ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
-	boost::mutex::scoped_lock lock(gMutex);
-#endif
-	SetGenericProperty<std::string>(gStringProperties,szName,
-		std::string( st->data ),NULL);
+	PropertyMap* pp = reinterpret_cast<PropertyMap*>(p);
+	SetGenericProperty<std::string>(pp->strings,szName,std::string(st->C_Str()),NULL);
 	ASSIMP_END_EXCEPTION_REGION(void);
 }
 
@@ -574,16 +539,16 @@ ASSIMP_API void aiTransposeMatrix4(aiMatrix4x4* mat)
 
 // ------------------------------------------------------------------------------------------------
 // Vector transformation
-ASSIMP_API void aiTransformVecByMatrix3(C_STRUCT aiVector3D* vec, 
-	const C_STRUCT aiMatrix3x3* mat)
+ASSIMP_API void aiTransformVecByMatrix3(aiVector3D* vec, 
+	const aiMatrix3x3* mat)
 {
 	ai_assert(NULL != mat && NULL != vec);
 	*vec *= (*mat);
 }
 
 // ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiTransformVecByMatrix4(C_STRUCT aiVector3D* vec, 
-	const C_STRUCT aiMatrix4x4* mat)
+ASSIMP_API void aiTransformVecByMatrix4(aiVector3D* vec, 
+	const aiMatrix4x4* mat)
 {
 	ai_assert(NULL != mat && NULL != vec);
 	*vec *= (*mat);
@@ -592,8 +557,8 @@ ASSIMP_API void aiTransformVecByMatrix4(C_STRUCT aiVector3D* vec,
 // ------------------------------------------------------------------------------------------------
 // Matrix multiplication
 ASSIMP_API void aiMultiplyMatrix4(
-	C_STRUCT aiMatrix4x4* dst, 
-	const C_STRUCT aiMatrix4x4* src)
+	aiMatrix4x4* dst, 
+	const aiMatrix4x4* src)
 {
 	ai_assert(NULL != dst && NULL != src);
 	*dst = (*dst) * (*src);
@@ -601,8 +566,8 @@ ASSIMP_API void aiMultiplyMatrix4(
 
 // ------------------------------------------------------------------------------------------------
 ASSIMP_API void aiMultiplyMatrix3(
-	C_STRUCT aiMatrix3x3* dst, 
-	const C_STRUCT aiMatrix3x3* src)
+	aiMatrix3x3* dst, 
+	const aiMatrix3x3* src)
 {
 	ai_assert(NULL != dst && NULL != src);
 	*dst = (*dst) * (*src);
@@ -611,7 +576,7 @@ ASSIMP_API void aiMultiplyMatrix3(
 // ------------------------------------------------------------------------------------------------
 // Matrix identity
 ASSIMP_API void aiIdentityMatrix3(
-	C_STRUCT aiMatrix3x3* mat)
+	aiMatrix3x3* mat)
 {
 	ai_assert(NULL != mat);
 	*mat = aiMatrix3x3();
@@ -619,7 +584,7 @@ ASSIMP_API void aiIdentityMatrix3(
 
 // ------------------------------------------------------------------------------------------------
 ASSIMP_API void aiIdentityMatrix4(
-	C_STRUCT aiMatrix4x4* mat)
+	aiMatrix4x4* mat)
 {
 	ai_assert(NULL != mat);
 	*mat = aiMatrix4x4();

+ 5 - 5
ThirdParty/Assimp/code/AssimpCExport.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -71,7 +71,7 @@ ASSIMP_API void aiCopyScene(const aiScene* pIn, aiScene** pOut)
 		return;
 	}
 
-	SceneCombiner::CopyScene(pOut,pIn,false);
+	SceneCombiner::CopyScene(pOut,pIn,true);
 }
 
 // ------------------------------------------------------------------------------------------------

+ 4 - 4
ThirdParty/Assimp/code/AssimpPCH.cpp

@@ -2,16 +2,16 @@
 // Actually just a dummy, used by the compiler to build the precompiled header.
 
 #include "AssimpPCH.h"
-#include "./../include/aiVersion.h"
+#include "./../include/assimp/version.h"
 
 // --------------------------------------------------------------------------------
-// Legal information string - dont't remove from image!
+// Legal information string - dont't remove this.
 static const char* LEGAL_INFORMATION =
 
 "Open Asset Import Library (Assimp).\n"
 "A free C/C++ library to import various 3D file formats into applications\n\n"
 
-"(c) 2008-2010, ASSIMP Development Team\n"
+"(c) 2008-2010, assimp team\n"
 "License under the terms and conditions of the 3-clause BSD license\n"
 "http://assimp.sourceforge.net\n"
 ;
@@ -31,7 +31,7 @@ ASSIMP_API unsigned int aiGetVersionMinor ()	{
 // ------------------------------------------------------------------------------------------------
 // Get Assimp major version
 ASSIMP_API unsigned int aiGetVersionMajor ()	{
-	return 2;
+	return 3;
 }
 
 // ------------------------------------------------------------------------------------------------

+ 15 - 14
ThirdParty/Assimp/code/AssimpPCH.h

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -48,11 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define ASSIMP_INTERNAL_BUILD
 
 // ----------------------------------------------------------------------------------------
-/* General compile config taken from aiDefines.h. It is important that the user compiles
- * using exactly the same settings in aiDefines.h. Settings in AssimpPCH.h may differ,
+/* General compile config taken from defs.h. It is important that the user compiles
+ * using exactly the same settings in defs.h. Settings in AssimpPCH.h may differ,
  * they won't affect the public API.
  */
-#include "../include/aiDefines.h"
+#include "../include/assimp/defs.h"
 
 // Include our stdint.h replacement header for MSVC, take the global header for gcc/mingw
 #if defined( _MSC_VER) && (_MSC_VER < 1600)
@@ -132,13 +132,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <boost/lexical_cast.hpp>
 
 // Public ASSIMP headers
-#include "../include/DefaultLogger.h"
-#include "../include/IOStream.h"
-#include "../include/IOSystem.h"
-#include "../include/aiScene.h"
-#include "../include/aiPostProcess.h"
-#include "../include/assimp.hpp"
-#include "../include/export.hpp"
+#include "../include/assimp/DefaultLogger.hpp"
+#include "../include/assimp/IOStream.hpp"
+#include "../include/assimp/IOSystem.hpp"
+#include "../include/assimp/scene.h"
+#include "../include/assimp/importerdesc.h"
+#include "../include/assimp/postprocess.h"
+#include "../include/assimp/Importer.hpp"
+#include "../include/assimp/Exporter.hpp"
 
 // Internal utility headers
 #include "BaseImporter.h"

+ 21 - 6
ThirdParty/Assimp/code/B3DImporter.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 using namespace Assimp;
 using namespace std;
 
+static const aiImporterDesc desc = {
+	"BlitzBasic 3D Importer",
+	"",
+	"",
+	"http://www.blitzbasic.com/",
+	aiImporterFlags_SupportBinaryFlavour,
+	0,
+	0,
+	0,
+	0,
+	"b3d" 
+};
+
 // (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
 #ifdef _MSC_VER 
 #	pragma warning (disable: 4018)
@@ -74,8 +87,10 @@ bool B3DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
 }
 
 // ------------------------------------------------------------------------------------------------
-void B3DImporter::GetExtensionList( std::set<std::string>& extensions ){
-	extensions.insert("b3d");
+// Loader meta information
+const aiImporterDesc* B3DImporter::GetInfo () const
+{
+	return &desc;
 }
 
 #ifdef DEBUG_B3D

+ 8 - 8
ThirdParty/Assimp/code/B3DImporter.h

@@ -1,9 +1,9 @@
 
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -19,10 +19,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,9 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_B3DIMPORTER_H_INC
 #define AI_B3DIMPORTER_H_INC
 
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiMaterial.h"
+#include "../include/assimp/types.h"
+#include "../include/assimp/mesh.h"
+#include "../include/assimp/material.h"
 
 #include <string>
 #include <vector>
@@ -60,7 +60,7 @@ public:
 
 protected:
 
-	virtual void GetExtensionList(std::set<std::string>& extensions);
+	virtual const aiImporterDesc* GetInfo () const;
 	virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
 
 private:

+ 25 - 5
ThirdParty/Assimp/code/BVHLoader.cpp

@@ -1,10 +1,10 @@
 /** Implementation of the BVH loader */
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -21,10 +21,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -49,6 +49,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+static const aiImporterDesc desc = {
+	"BVH Importer (MoCap)",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportTextFlavour,
+	0,
+	0,
+	0,
+	0,
+	"bvh"
+};
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 BVHLoader::BVHLoader()
@@ -76,6 +89,13 @@ bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs
 	return false;
 }
 
+// ------------------------------------------------------------------------------------------------
+// Loader meta information
+const aiImporterDesc* BVHLoader::GetInfo () const
+{
+	return &desc;
+}
+
 // ------------------------------------------------------------------------------------------------
 // Imports the given file into the given scene structure. 
 void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
@@ -374,7 +394,7 @@ float BVHLoader::GetNextTokenAsFloat()
 	// check if the float is valid by testing if the atof() function consumed every char of the token
 	const char* ctoken = token.c_str();
 	float result = 0.0f;
-	ctoken = fast_atof_move( ctoken, result);
+	ctoken = fast_atoreal_move<float>( ctoken, result);
 
 	if( ctoken != token.c_str() + token.length())
 		ThrowException( boost::str( boost::format( "Expected a floating point number, but found \"%s\".") % token));

+ 7 - 11
ThirdParty/Assimp/code/BVHLoader.h

@@ -1,10 +1,10 @@
 /** Defines the BHV motion capturing loader class */
 
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -20,10 +20,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -94,14 +94,10 @@ public:
 	 * See BaseImporter::CanRead() for details.	*/
 	bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
 
+	const aiImporterDesc* GetInfo () const;
+
 protected:
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details
-	 */
-	void GetExtensionList(std::set<std::string>& extensions)
-	{
-		extensions.insert("bvh");
-	}
+
 
 	/** Imports the given file into the given scene structure. 
 	 * See BaseImporter::InternReadFile() for details

+ 41 - 10
ThirdParty/Assimp/code/BaseImporter.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -105,12 +105,36 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
 	// the default implementation does nothing
 }
 
+// ------------------------------------------------------------------------------------------------
+void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
+{
+	const aiImporterDesc* desc = GetInfo();
+	ai_assert(desc != NULL);
+
+	const char* ext = desc->mFileExtensions;
+	ai_assert(ext != NULL);
+
+	const char* last = ext;
+	do {
+		if (!*ext || *ext == ' ') {
+			extensions.insert(std::string(last,ext-last));
+			ai_assert(ext-last > 0);
+			last = ext;
+			while(*last == ' ') {
+				++last;
+			}
+		}
+	}
+	while(*ext++);
+}
+
 // ------------------------------------------------------------------------------------------------
 /*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
 	const std::string&	pFile,
 	const char**		tokens, 
 	unsigned int		numTokens,
-	unsigned int		searchBytes /* = 200 */)
+	unsigned int		searchBytes /* = 200 */,
+	bool				tokensSol /* false */)
 {
 	ai_assert(NULL != tokens && 0 != numTokens && 0 != searchBytes);
 	if (!pIOHandler)
@@ -142,7 +166,13 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
 		for (unsigned int i = 0; i < numTokens;++i)	{
 			ai_assert(NULL != tokens[i]);
 
-			if (::strstr(buffer,tokens[i]))	{
+
+			const char* r = strstr(buffer,tokens[i]);
+			if (!r) 
+				continue;
+			// We got a match, either we don't care where it is, or it happens to
+			// be in the beginning of the file / line
+			if (!tokensSol || r == buffer || r[-1] == '\r' || r[-1] == '\n') {
 				DefaultLogger::get()->debug(std::string("Found positive match for header keyword: ") + tokens[i]);
 				return true;
 			}
@@ -507,9 +537,10 @@ void BatchLoader::LoadAll()
 		pp |= aiProcess_ValidateDataStructure;
 #endif
 		// setup config properties if necessary
-		data->pImporter->pimpl->mFloatProperties  = (*it).map.floats;
-		data->pImporter->pimpl->mIntProperties    = (*it).map.ints;
-		data->pImporter->pimpl->mStringProperties = (*it).map.strings;
+		ImporterPimpl* pimpl = data->pImporter->Pimpl();
+		pimpl->mFloatProperties  = (*it).map.floats;
+		pimpl->mIntProperties    = (*it).map.ints;
+		pimpl->mStringProperties = (*it).map.strings;
 
 		if (!DefaultLogger::isNullLogger())
 		{
@@ -517,7 +548,7 @@ void BatchLoader::LoadAll()
 			DefaultLogger::get()->info("File: " + (*it).file);
 		}
 		data->pImporter->ReadFile((*it).file,pp);
-		(*it).scene = const_cast<aiScene*>(data->pImporter->GetOrphanedScene());
+		(*it).scene = data->pImporter->GetOrphanedScene();
 		(*it).loaded = true;
 
 		DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%");

+ 21 - 17
ThirdParty/Assimp/code/BaseImporter.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <string>
 #include <map>
 #include <vector>
-#include "./../include/aiTypes.h"
+#include "./../include/assimp/types.h"
 
 struct aiScene;
 
@@ -187,18 +187,22 @@ public:
 		const Importer* pImp
 		);
 
-protected:
+	
+	// -------------------------------------------------------------------
+	/** Called by #Importer::GetImporterInfo to get a description of 
+	 *  some loader features. Importers must provide this information. */
+	virtual const aiImporterDesc* GetInfo() const = 0;
+
+
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 *  Implementations are expected to insert() all file extensions
-	 *  handled by them into the extension set. A loader capable of
-	 *  reading certain files with the extension BLA would place the
-	 *  string bla (lower-case!) in the output set.
-	 * @param extensions Output set. */
-	virtual void GetExtensionList(
-		std::set<std::string>& extensions
-		) = 0;
+	/** Called by #Importer::GetExtensionList for each loaded importer.
+	 *  Take the extension list contained in the structure returned by
+	 *  #GetInfo and insert all file extensions into the given set.
+	 *  @param extension set to collect file extensions in*/
+	void GetExtensionList(std::set<std::string>& extensions);
+
+protected:
 
 	// -------------------------------------------------------------------
 	/** Imports the given file into the given scene structure. The 
@@ -271,8 +275,8 @@ public: // static utilities
 		const std::string&	file,
 		const char** tokens, 
 		unsigned int numTokens,
-		unsigned int searchBytes = 200);
-
+		unsigned int searchBytes = 200,
+		bool tokensSol = false);
 
 	// -------------------------------------------------------------------
 	/** @brief Check whether a file has a specific file extension

+ 10 - 10
ThirdParty/Assimp/code/BaseProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -67,7 +67,7 @@ BaseProcess::~BaseProcess()
 // ------------------------------------------------------------------------------------------------
 void BaseProcess::ExecuteOnScene( Importer* pImp)
 {
-	ai_assert(NULL != pImp && NULL != pImp->pimpl->mScene);
+	ai_assert(NULL != pImp && NULL != pImp->Pimpl()->mScene);
 
 	progress = pImp->GetProgressHandler();
 	ai_assert(progress);
@@ -77,17 +77,17 @@ void BaseProcess::ExecuteOnScene( Importer* pImp)
 	// catch exceptions thrown inside the PostProcess-Step
 	try
 	{
-		Execute(pImp->pimpl->mScene);
+		Execute(pImp->Pimpl()->mScene);
 
 	} catch( const std::exception& err )	{
 
 		// extract error description
-		pImp->pimpl->mErrorString = err.what();
-		DefaultLogger::get()->error(pImp->pimpl->mErrorString);
+		pImp->Pimpl()->mErrorString = err.what();
+		DefaultLogger::get()->error(pImp->Pimpl()->mErrorString);
 
 		// and kill the partially imported data
-		delete pImp->pimpl->mScene;
-		pImp->pimpl->mScene = NULL;
+		delete pImp->Pimpl()->mScene;
+		pImp->Pimpl()->mScene = NULL;
 	}
 }
 

+ 5 - 5
ThirdParty/Assimp/code/BaseProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <map>
 
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 #include "GenericProperty.h"
 
 struct aiScene;

+ 4 - 4
ThirdParty/Assimp/code/BlenderDNA.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/BlenderDNA.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/BlenderDNA.inl

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/BlenderIntermediate.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 21 - 13
ThirdParty/Assimp/code/BlenderLoader.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -63,21 +63,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #	endif
 #endif
 
+namespace Assimp {
+	template<> const std::string LogFunctions<BlenderImporter>::log_prefix = "BLEND: ";
+}
+
 using namespace Assimp;
 using namespace Assimp::Blender;
 using namespace Assimp::Formatter;
 
-template<> const std::string LogFunctions<BlenderImporter>::log_prefix = "BLEND: ";
-static const aiLoaderDesc blenderDesc = {
+static const aiImporterDesc blenderDesc = {
 	"Blender 3D Importer \nhttp://www.blender3d.org",
-	"Assimp Team",
 	"",
 	"",
-	aiLoaderFlags_SupportBinaryFlavour | aiLoaderFlags_Experimental,
+	"No animation support yet",
+	aiImporterFlags_SupportBinaryFlavour,
 	0,
 	0,
 	2,
-	50
+	50,
+	"blend"
 };
 
 
@@ -120,9 +124,9 @@ void BlenderImporter::GetExtensionList(std::set<std::string>& app)
 
 // ------------------------------------------------------------------------------------------------
 // Loader registry entry
-const aiLoaderDesc& BlenderImporter::GetInfo () const
+const aiImporterDesc* BlenderImporter::GetInfo () const
 {
-	return blenderDesc;
+	return &blenderDesc;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -295,7 +299,11 @@ void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
 
 	// we need a scene somewhere to start with. 
 	for_each(const FileBlockHead& bl,file.entries) {
-		if (bl.id == "SC") {
+
+		// Fix: using the DNA index is more reliable to locate scenes
+		//if (bl.id == "SC") {
+
+		if (bl.dna_index == (*it).second) {
 			block = &bl;
 			break;
 		}
@@ -874,7 +882,7 @@ aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, Convers
 	std::deque<const Object*> children;
 	for(std::set<const Object*>::iterator it = conv_data.objects.begin(); it != conv_data.objects.end() ;) {
 		const Object* object = *it;
-		if (object->parent.get() == obj) {
+		if (object->parent == obj) {
 			children.push_back(object);
 
 			conv_data.objects.erase(it++);

+ 5 - 31
ThirdParty/Assimp/code/BlenderLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -85,32 +85,6 @@ namespace Assimp	{
 		class BlenderModifier;
 	}
 
-enum aiLoaderFlags 
-{
-	aiLoaderFlags_SupportAsciiFlavour = 0x1,
-	aiLoaderFlags_SupportBinaryFlavour = 0x2,
-	aiLoaderFlags_SupportCompressedFlavour = 0x4,
-
-	aiLoaderFlags_LimitedSupport = 0x8,
-
-	aiLoaderFlags_Experimental = 0x10,
-	aiLoaderFlags_Testing = 0x20,
-	aiLoaderFlags_Production = 0x40,
-};
-
-struct aiLoaderDesc 
-{
-	const char* mName;
-	const char* mAuthor;
-	const char* mMaintainer;
-	const char* mComments;
-	unsigned int mFlags;
-
-	unsigned int mMinMajor;
-	unsigned int mMinMinor;
-	unsigned int mMaxMajor;
-	unsigned int mMaxMinor;
-};
 
 
 // -------------------------------------------------------------------------------------------
@@ -136,7 +110,7 @@ public:
 protected:
 
 	// --------------------
-	const aiLoaderDesc& GetInfo () const;
+	const aiImporterDesc* GetInfo () const;
 
 	// --------------------
 	void GetExtensionList(std::set<std::string>& app);

+ 6 - 4
ThirdParty/Assimp/code/BlenderModifier.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -48,6 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "SceneCombiner.h"
 #include "Subdivision.h"
 
+#include <functional>
+
 using namespace Assimp;
 using namespace Assimp::Blender;
 

+ 4 - 4
ThirdParty/Assimp/code/BlenderModifier.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 10 - 2
ThirdParty/Assimp/code/BlenderScene.cpp

@@ -63,7 +63,11 @@ template <> void Structure :: Convert<Object> (
     ReadFieldArray2<ErrorPolicy_Warn>(dest.obmat,"obmat",db);
     ReadFieldArray2<ErrorPolicy_Warn>(dest.parentinv,"parentinv",db);
     ReadFieldArray<ErrorPolicy_Warn>(dest.parsubstr,"parsubstr",db);
-    ReadFieldPtr<ErrorPolicy_Warn>(dest.parent,"*parent",db);
+    {
+        boost::shared_ptr<Object> parent;
+        ReadFieldPtr<ErrorPolicy_Warn>(parent,"*parent",db);
+        dest.parent = parent.get();
+    }
     ReadFieldPtr<ErrorPolicy_Warn>(dest.track,"*track",db);
     ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy,"*proxy",db);
     ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy_from,"*proxy_from",db);
@@ -238,7 +242,11 @@ template <> void Structure :: Convert<Base> (
     ) const
 { 
 
-    ReadFieldPtr<ErrorPolicy_Warn>(dest.prev,"*prev",db);
+    {
+        boost::shared_ptr<Base> prev;
+        ReadFieldPtr<ErrorPolicy_Warn>(prev,"*prev",db);
+        dest.prev = prev.get();
+    }
     ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
     ReadFieldPtr<ErrorPolicy_Warn>(dest.object,"*object",db);
 

+ 9 - 8
ThirdParty/Assimp/code/BlenderScene.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -71,9 +71,10 @@ namespace Assimp	{
 //
 // * Pointers to other structures or primitive types are allowed.
 //   No references or double pointers or arrays of pointers.
-//   A pointer to a T is written as boost::shared_ptr, while a
+//   A pointer to a T is normally written as boost::shared_ptr, while a
 //   pointer to an array of elements is written as boost::
-//   shared_array.
+//   shared_array. To avoid cyclic pointers, use raw pointers in
+//   one direction.
 //
 // * Arrays can have maximally two-dimensions. Any non-pointer
 //   type can form them.
@@ -477,7 +478,7 @@ struct Object : ElemBase  {
 	float parentinv[4][4] WARN;
 	char parsubstr[32] WARN;
 	
-	boost::shared_ptr<Object> parent WARN;
+	Object* parent WARN;
 	boost::shared_ptr<Object> track WARN;
 
 	boost::shared_ptr<Object> proxy,proxy_from,proxy_group WARN;
@@ -490,7 +491,7 @@ struct Object : ElemBase  {
 
 // -------------------------------------------------------------------------------
 struct Base : ElemBase {
-	boost::shared_ptr<Base> prev WARN;
+	Base* prev WARN;
 	boost::shared_ptr<Base> next WARN;
 	boost::shared_ptr<Object> object WARN;
 };

+ 4 - 4
ThirdParty/Assimp/code/BlobIOSystem.h

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 6 - 6
ThirdParty/Assimp/code/ByteSwap.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_BYTESWAP_H_INC
 #define AI_BYTESWAP_H_INC
 
-#include "../include/aiAssert.h"
-#include "../include/aiTypes.h"
+#include "../include/assimp/ai_assert.h"
+#include "../include/assimp/types.h"
 
 #if _MSC_VER >= 1400 
 #include <stdlib.h>

+ 7 - 8
ThirdParty/Assimp/code/CInterfaceIOWrapper.h

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_CIOSYSTEM_H_INCLUDED
 #define AI_CIOSYSTEM_H_INCLUDED
 
-#include "../include/aiFileIO.h"
+#include "../include/assimp/cfileio.h"
 
 namespace Assimp	{
 	
@@ -114,10 +114,9 @@ public:
 
 	// ...................................................................
 	bool Exists( const char* pFile) const {
-		CIOSystemWrapper* pip = const_cast<CIOSystemWrapper*>(this);
-		IOStream* p = pip->Open(pFile);
+		aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb");		
 		if (p){
-			pip->Close(p);
+			mFileSystem->CloseProc(mFileSystem,p);
 			return true;
 		}
 		return false;

+ 21 - 8
ThirdParty/Assimp/code/COBLoader.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -72,6 +72,20 @@ static const float units[] = {
 	1.f/1609.344f
 };	
 
+static const aiImporterDesc desc = {
+	"TrueSpace Object Importer",
+	"",
+	"",
+	"little-endian files only",
+	aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour,
+	0,
+	0,
+	0,
+	0,
+	"cob scn"
+};
+
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 COBImporter::COBImporter()
@@ -99,11 +113,10 @@ bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 }
 
 // ------------------------------------------------------------------------------------------------
-// List all extensions handled by this loader
-void COBImporter::GetExtensionList(std::set<std::string>& app)
+// Loader meta information
+const aiImporterDesc* COBImporter::GetInfo () const
 {
-	app.insert("cob");
-	app.insert("scn");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------

+ 5 - 5
ThirdParty/Assimp/code/COBLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -82,7 +82,7 @@ public:
 protected:
 
 	// --------------------
-	void GetExtensionList(std::set<std::string>& app);
+	const aiImporterDesc* GetInfo () const;
 
 	// --------------------
 	void SetupProperties(const Importer* pImp);

+ 4 - 4
ThirdParty/Assimp/code/COBScene.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 24 - 10
ThirdParty/Assimp/code/CSMLoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2009, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -54,6 +54,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+static const aiImporterDesc desc = {
+	"CharacterStudio Motion Importer (MoCap)",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportTextFlavour,
+	0,
+	0,
+	0,
+	0,
+	"csm" 
+};
+
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 CSMImporter::CSMImporter()
@@ -83,9 +97,9 @@ bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 
 // ------------------------------------------------------------------------------------------------
 // Build a string of all file extensions supported
-void CSMImporter::GetExtensionList(std::set<std::string>& extensions)
+const aiImporterDesc* CSMImporter::GetInfo () const
 {
-	extensions.insert("csm");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -134,7 +148,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
 			else if (TokenMatchI(buffer,"rate",4))	{
 				SkipSpaces(&buffer);
 				float d;
-				buffer = fast_atof_move(buffer,d);
+				buffer = fast_atoreal_move<float>(buffer,d);
 				anim->mTicksPerSecond = d;
 			}
 			else if (TokenMatchI(buffer,"order",5))	{
@@ -214,15 +228,15 @@ void CSMImporter::InternReadFile( const std::string& pFile,
 						else	{
 							aiVectorKey* sub = s->mPositionKeys + s->mNumPositionKeys;
 							sub->mTime = (double)frame;
-							buffer = fast_atof_move(buffer, (float&)sub->mValue.x);
+							buffer = fast_atoreal_move<float>(buffer, (float&)sub->mValue.x);
 
 							if(!SkipSpacesAndLineEnd(&buffer))
 								throw DeadlyImportError("CSM: Unexpected EOF occured reading sample y coord");
-							buffer = fast_atof_move(buffer, (float&)sub->mValue.y);
+							buffer = fast_atoreal_move<float>(buffer, (float&)sub->mValue.y);
 
 							if(!SkipSpacesAndLineEnd(&buffer))
 								throw DeadlyImportError("CSM: Unexpected EOF occured reading sample z coord");
-							buffer = fast_atof_move(buffer, (float&)sub->mValue.z);
+							buffer = fast_atoreal_move<float>(buffer, (float&)sub->mValue.z);
 
 							++s->mNumPositionKeys;
 						}

+ 5 - 5
ThirdParty/Assimp/code/CSMLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -69,7 +69,7 @@ public:
 protected:
 
 	// -------------------------------------------------------------------
-	void GetExtensionList(std::set<std::string>& extensions);
+	const aiImporterDesc* GetInfo () const;
 
 	// -------------------------------------------------------------------
 	void SetupProperties(const Importer* pImp);

+ 6 - 6
ThirdParty/Assimp/code/CalcTangentsProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -160,8 +160,8 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
 			{
 				register unsigned int idx = face.mIndices[i];
 				vertexDone  [idx] = true;
-				meshTang    [idx] = qnan;
-				meshBitang  [idx] = qnan;
+				meshTang    [idx] = aiVector3D(qnan);
+				meshBitang  [idx] = aiVector3D(qnan);
 			}
 
 			continue;

+ 4 - 4
ThirdParty/Assimp/code/CalcTangentsProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 243 - 11
ThirdParty/Assimp/code/ColladaExporter.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -94,6 +94,7 @@ void ColladaExporter::WriteFile()
 
 	WriteHeader();
 
+  WriteMaterials();
 	WriteGeometryLibrary();
 
 	WriteSceneLibrary();
@@ -121,12 +122,228 @@ void ColladaExporter::WriteHeader()
 	mOutput << startstr << "<authoring_tool>Assimp Collada Exporter</authoring_tool>" << endstr;
 	PopTag();
 	mOutput << startstr << "</contributor>" << endstr;
-	mOutput << startstr << "<unit meter=\"1.0\" name=\"meter\" />" << endstr;
+  mOutput << startstr << "<created>2000-01-01T23:59:59</created>" << endstr;
+  mOutput << startstr << "<modified>2000-01-01T23:59:59</modified>" << endstr;
+	mOutput << startstr << "<unit name=\"centimeter\" meter=\"0.01\" />" << endstr;
 	mOutput << startstr << "<up_axis>Y_UP</up_axis>" << endstr;
 	PopTag();
 	mOutput << startstr << "</asset>" << endstr;
 }
 
+// ------------------------------------------------------------------------------------------------
+// Reads a single surface entry from the given material keys
+void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex)
+{
+  if( pSrcMat->GetTextureCount( pTexture) > 0 )
+  {
+    aiString texfile;
+    unsigned int uvChannel = 0;
+    pSrcMat->GetTexture( pTexture, 0, &texfile, NULL, &uvChannel);
+    poSurface.texture = texfile.C_Str();
+    poSurface.channel = uvChannel;
+  } else
+  {
+    if( pKey )
+      pSrcMat->Get( pKey, pType, pIndex, poSurface.color);
+  }
+}
+
+// ------------------------------------------------------------------------------------------------
+// Writes an image entry for the given surface
+void ColladaExporter::WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd)
+{
+  if( !pSurface.texture.empty() )
+  {
+    mOutput << startstr << "<image id=\"" << pNameAdd << "\">" << endstr;
+    PushTag(); 
+    mOutput << startstr << "<init_from>";
+    for( std::string::const_iterator it = pSurface.texture.begin(); it != pSurface.texture.end(); ++it )
+    {
+      if( isalnum( *it) || *it == '_' || *it == '.' || *it == '/' || *it == '\\' )
+        mOutput << *it;
+      else
+        mOutput << '%' << std::hex << size_t( (unsigned char) *it) << std::dec;
+    }
+    mOutput << "</init_from>" << endstr;
+    PopTag();
+    mOutput << startstr << "</image>" << endstr;
+  }
+}
+
+// ------------------------------------------------------------------------------------------------
+// Writes a color-or-texture entry into an effect definition
+void ColladaExporter::WriteTextureColorEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pImageName)
+{
+  mOutput << startstr << "<" << pTypeName << ">" << endstr;
+  PushTag();
+  if( pSurface.texture.empty() )
+  {
+    mOutput << startstr << "<color sid=\"" << pTypeName << "\">" << pSurface.color.r << "   " << pSurface.color.g << "   " << pSurface.color.b << "   " << pSurface.color.a << "</color>" << endstr;
+  } else
+  {
+    mOutput << startstr << "<texture texture=\"" << pImageName << "\" texcoord=\"CHANNEL" << pSurface.channel << "\" />" << endstr;
+  }
+  PopTag();
+  mOutput << startstr << "</" << pTypeName << ">" << endstr;
+}
+
+// ------------------------------------------------------------------------------------------------
+// Writes the two parameters necessary for referencing a texture in an effect entry
+void ColladaExporter::WriteTextureParamEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pMatName)
+{
+  // if surface is a texture, write out the sampler and the surface parameters necessary to reference the texture
+  if( !pSurface.texture.empty() )
+  {
+    mOutput << startstr << "<newparam sid=\"" << pMatName << "-" << pTypeName << "-surface\">" << endstr;
+    PushTag();
+    mOutput << startstr << "<surface type=\"2D\">" << endstr;
+    PushTag();
+    mOutput << startstr << "<init_from>" << pMatName << "-" << pTypeName << "-image</init_from>" << endstr;
+    PopTag();
+    mOutput << startstr << "</surface>" << endstr;
+    PopTag();
+    mOutput << startstr << "</newparam>" << endstr;
+
+    mOutput << startstr << "<newparam sid=\"" << pMatName << "-" << pTypeName << "-sampler\">" << endstr;
+    PushTag();
+    mOutput << startstr << "<sampler2D>" << endstr;
+    PushTag();
+    mOutput << startstr << "<source>" << pMatName << "-" << pTypeName << "-surface</source>" << endstr;
+    PopTag();
+    mOutput << startstr << "</sampler2D>" << endstr;
+    PopTag();
+    mOutput << startstr << "</newparam>" << endstr;
+  }
+}
+
+// ------------------------------------------------------------------------------------------------
+// Writes the material setup
+void ColladaExporter::WriteMaterials()
+{
+  materials.resize( mScene->mNumMaterials);
+
+  /// collect all materials from the scene
+  size_t numTextures = 0;
+  for( size_t a = 0; a < mScene->mNumMaterials; ++a )
+  {
+    const aiMaterial* mat = mScene->mMaterials[a];
+
+    aiString name;
+    if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS )
+      name = "mat";
+    materials[a].name = std::string( "m") + boost::lexical_cast<std::string> (a) + name.C_Str();
+    for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it )
+      if( !isalnum( *it) )
+        *it = '_';
+
+    ReadMaterialSurface( materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT);
+    if( !materials[a].ambient.texture.empty() ) numTextures++;
+    ReadMaterialSurface( materials[a].diffuse, mat, aiTextureType_DIFFUSE, AI_MATKEY_COLOR_DIFFUSE);
+    if( !materials[a].diffuse.texture.empty() ) numTextures++;
+    ReadMaterialSurface( materials[a].specular, mat, aiTextureType_SPECULAR, AI_MATKEY_COLOR_SPECULAR);
+    if( !materials[a].specular.texture.empty() ) numTextures++;
+    ReadMaterialSurface( materials[a].emissive, mat, aiTextureType_EMISSIVE, AI_MATKEY_COLOR_EMISSIVE);
+    if( !materials[a].emissive.texture.empty() ) numTextures++;
+    ReadMaterialSurface( materials[a].reflective, mat, aiTextureType_REFLECTION, AI_MATKEY_COLOR_REFLECTIVE);
+    if( !materials[a].reflective.texture.empty() ) numTextures++;
+    ReadMaterialSurface( materials[a].normal, mat, aiTextureType_NORMALS, NULL, 0, 0);
+    if( !materials[a].normal.texture.empty() ) numTextures++;
+
+    mat->Get( AI_MATKEY_SHININESS, materials[a].shininess);
+  }
+
+  // output textures if present
+  if( numTextures > 0 )
+  {
+    mOutput << startstr << "<library_images>" << endstr; 
+    PushTag();
+    for( std::vector<Material>::const_iterator it = materials.begin(); it != materials.end(); ++it )
+    { 
+      const Material& mat = *it;
+      WriteImageEntry( mat.ambient, mat.name + "-ambient-image");
+      WriteImageEntry( mat.diffuse, mat.name + "-diffuse-image");
+      WriteImageEntry( mat.specular, mat.name + "-specular-image");
+      WriteImageEntry( mat.emissive, mat.name + "-emissive-image");
+      WriteImageEntry( mat.reflective, mat.name + "-reflective-image");
+      WriteImageEntry( mat.normal, mat.name + "-normal-image");
+    }
+    PopTag();
+    mOutput << startstr << "</library_images>" << endstr;
+  }
+
+  // output effects - those are the actual carriers of information
+  if( !materials.empty() )
+  {
+    mOutput << startstr << "<library_effects>" << endstr;
+    PushTag();
+    for( std::vector<Material>::const_iterator it = materials.begin(); it != materials.end(); ++it )
+    {
+      const Material& mat = *it;
+      // this is so ridiculous it must be right
+      mOutput << startstr << "<effect id=\"" << mat.name << "-fx\" name=\"" << mat.name << "\">" << endstr;
+      PushTag();
+      mOutput << startstr << "<profile_COMMON>" << endstr;
+      PushTag();
+
+      // write sampler- and surface params for the texture entries
+      WriteTextureParamEntry( mat.emissive, "emissive", mat.name);
+      WriteTextureParamEntry( mat.ambient, "ambient", mat.name);
+      WriteTextureParamEntry( mat.diffuse, "diffuse", mat.name);
+      WriteTextureParamEntry( mat.specular, "specular", mat.name);
+      WriteTextureParamEntry( mat.reflective, "reflective", mat.name);
+
+      mOutput << startstr << "<technique sid=\"standard\">" << endstr;
+      PushTag();
+      mOutput << startstr << "<phong>" << endstr;
+      PushTag();
+
+      WriteTextureColorEntry( mat.emissive, "emission", mat.name + "-emissive-sampler");
+      WriteTextureColorEntry( mat.ambient, "ambient", mat.name + "-ambient-sampler");
+      WriteTextureColorEntry( mat.diffuse, "diffuse", mat.name + "-diffuse-sampler");
+      WriteTextureColorEntry( mat.specular, "specular", mat.name + "-specular-sampler");
+
+      mOutput << startstr << "<shininess>" << endstr;
+      PushTag();
+      mOutput << startstr << "<float sid=\"shininess\">" << mat.shininess << "</float>" << endstr;
+      PopTag();
+      mOutput << startstr << "</shininess>" << endstr;
+
+      WriteTextureColorEntry( mat.reflective, "reflective", mat.name + "-reflective-sampler");
+
+  // deactivated because the Collada spec PHONG model does not allow other textures.
+  //    if( !mat.normal.texture.empty() )
+  //      WriteTextureColorEntry( mat.normal, "bump", mat.name + "-normal-sampler");
+
+
+      PopTag();
+      mOutput << startstr << "</phong>" << endstr;
+      PopTag();
+      mOutput << startstr << "</technique>" << endstr;
+      PopTag();
+      mOutput << startstr << "</profile_COMMON>" << endstr;
+      PopTag();
+      mOutput << startstr << "</effect>" << endstr;
+    }
+    PopTag();
+    mOutput << startstr << "</library_effects>" << endstr;
+
+    // write materials - they're just effect references
+    mOutput << startstr << "<library_materials>" << endstr;
+    PushTag();
+    for( std::vector<Material>::const_iterator it = materials.begin(); it != materials.end(); ++it )
+    {
+      const Material& mat = *it;
+      mOutput << startstr << "<material id=\"" << mat.name << "\" name=\"" << mat.name << "\">" << endstr;
+      PushTag();
+      mOutput << startstr << "<instance_effect url=\"#" << mat.name << "-fx\"/>" << endstr;
+      PopTag();
+      mOutput << startstr << "</material>" << endstr;
+    }
+    PopTag();
+    mOutput << startstr << "</library_materials>" << endstr;
+  }
+}
+
 // ------------------------------------------------------------------------------------------------
 // Writes the geometry library
 void ColladaExporter::WriteGeometryLibrary()
@@ -148,6 +365,9 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
 	const aiMesh* mesh = mScene->mMeshes[pIndex];
 	std::string idstr = GetMeshId( pIndex);
 
+  if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
+    return;
+
 	// opening tag
 	mOutput << startstr << "<geometry id=\"" << idstr << "\" name=\"" << idstr << "_name\" >" << endstr;
 	PushTag();
@@ -187,19 +407,19 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
 	for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
 	{
 		if( mesh->HasTextureCoords( a) )
-			mOutput << startstr << "<input semantic=\"TEXCOORD\" source=\"#" << idstr << "-tex" << a << "\" set=\"" << a << "\" />" << endstr;
+			mOutput << startstr << "<input semantic=\"TEXCOORD\" source=\"#" << idstr << "-tex" << a << "\" " /*<< "set=\"" << a << "\"" */ << " />" << endstr;
 	}
 	for( size_t a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a )
 	{
 		if( mesh->HasVertexColors( a) )
-			mOutput << startstr << "<input semantic=\"COLOR\" source=\"#" << idstr << "-color" << a << "\" set=\"" << a << "\" />" << endstr;
+			mOutput << startstr << "<input semantic=\"COLOR\" source=\"#" << idstr << "-color" << a << "\" " /*<< set=\"" << a << "\"" */ << " />" << endstr;
 	}
 	
 	PopTag();
 	mOutput << startstr << "</vertices>" << endstr;
 
 	// write face setup
-	mOutput << startstr << "<polylist count=\"" << mesh->mNumFaces << "\" material=\"tellme\">" << endstr;
+	mOutput << startstr << "<polylist count=\"" << mesh->mNumFaces << "\" material=\"theresonlyone\">" << endstr;
 	PushTag();
 	mOutput << startstr << "<input offset=\"0\" semantic=\"VERTEX\" source=\"#" << idstr << "-vertices\" />" << endstr;
 	
@@ -353,11 +573,23 @@ void ColladaExporter::WriteNode( const aiNode* pNode)
 	// instance every geometry
 	for( size_t a = 0; a < pNode->mNumMeshes; ++a )
 	{
-		// const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]];
-		mOutput << startstr << "<instance_geometry url=\"#" << GetMeshId( a) << "\">" << endstr;
-		PushTag();
+		const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]];
+    // do not instanciate mesh if empty. I wonder how this could happen
+    if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
+      continue;
 
+		mOutput << startstr << "<instance_geometry url=\"#" << GetMeshId( pNode->mMeshes[a]) << "\">" << endstr;
+		PushTag();
+    mOutput << startstr << "<bind_material>" << endstr;
+    PushTag();
+    mOutput << startstr << "<technique_common>" << endstr;
+    PushTag();
+    mOutput << startstr << "<instance_material symbol=\"theresonlyone\" target=\"#" << materials[mesh->mMaterialIndex].name << "\" />" << endstr;
 		PopTag();
+    mOutput << startstr << "</technique_common>" << endstr;
+    PopTag();
+    mOutput << startstr << "</bind_material>" << endstr;
+    PopTag();
 		mOutput << startstr << "</instance_geometry>" << endstr;
 	}
 

+ 40 - 5
ThirdParty/Assimp/code/ColladaExporter.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_COLLADAEXPORTER_H_INC
 #define AI_COLLADAEXPORTER_H_INC
 
-#include "../include/aiAssert.h"
+#include "../include/assimp/ai_assert.h"
 #include <sstream>
 
 struct aiScene;
@@ -68,6 +68,9 @@ protected:
 	/// Writes the asset header
 	void WriteHeader();
 
+  /// Writes the material setup
+  void WriteMaterials();
+
 	/// Writes the geometry library
 	void WriteGeometryLibrary();
 
@@ -105,6 +108,38 @@ protected:
 	std::string startstr;
 	/// current line end string for simple stream insertion
 	std::string endstr;
+
+  // pair of color and texture - texture precedences color
+  struct Surface 
+  { 
+    aiColor4D color; 
+    std::string texture; 
+    size_t channel; 
+    Surface() { channel = 0; }
+  };
+
+  // summarize a material in an convinient way. 
+  struct Material
+  {
+    std::string name;
+    Surface ambient, diffuse, specular, emissive, reflective, normal;
+    float shininess; /// specular exponent
+
+    Material() { shininess = 16.0f; }
+  };
+
+  std::vector<Material> materials;
+
+protected:
+  /// Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions
+  /// Reads a single surface entry from the given material keys
+  void ReadMaterialSurface( Surface& poSurface, const aiMaterial* pSrcMat, aiTextureType pTexture, const char* pKey, size_t pType, size_t pIndex);
+  /// Writes an image entry for the given surface
+  void WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd);
+  /// Writes the two parameters necessary for referencing a texture in an effect entry
+  void WriteTextureParamEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pMatName);
+  /// Writes a color-or-texture entry into an effect definition
+  void WriteTextureColorEntry( const Surface& pSurface, const std::string& pTypeName, const std::string& pImageName);
 };
 
 }

+ 4 - 4
ThirdParty/Assimp/code/ColladaHelper.h

@@ -1,10 +1,10 @@
 /** Helper structures for the Collada loader */
 
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -20,10 +20,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 183 - 128
ThirdParty/Assimp/code/ColladaLoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "AssimpPCH.h"
 #ifndef ASSIMP_BUILD_NO_DAE_IMPORTER
 
-#include "../include/aiAnim.h"
+#include "../include/assimp/anim.h"
 #include "ColladaLoader.h"
 #include "ColladaParser.h"
 
@@ -56,6 +56,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+static const aiImporterDesc desc = {
+	"Collada Importer",
+	"",
+	"",
+	"http://collada.org",
+	aiImporterFlags_SupportTextFlavour,
+	1,
+	3,
+	1,
+	5,
+	"dae" 
+};
+
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 ColladaLoader::ColladaLoader()
@@ -91,9 +105,9 @@ bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo
 
 // ------------------------------------------------------------------------------------------------
 // Get file extension list
-void ColladaLoader::GetExtensionList( std::set<std::string>& extensions )
+const aiImporterDesc* ColladaLoader::GetInfo () const
 {
-	extensions.insert("dae");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -230,13 +244,13 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co
 	{
 		// find the corresponding node in the library
 		const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find((*it).mNode);
-		Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
+		const Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
 
 		// FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632
 		// need to check for both name and ID to catch all. To avoid breaking valid files,
 		// the workaround is only enabled when the first attempt to resolve the node has failed.
 		if (!nd) {
-			nd = const_cast<Collada::Node*>(FindNode(pParser.mRootNode,(*it).mNode));
+			nd = FindNode(pParser.mRootNode,(*it).mNode);
 		}
 		if (!nd) 
 			DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + (*it).mNode);
@@ -619,7 +633,9 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
 
 		// build a temporary array of pointers to the start of each vertex's weights
 		typedef std::vector< std::pair<size_t, size_t> > IndexPairVector;
-		std::vector<IndexPairVector::const_iterator> weightStartPerVertex( pSrcController->mWeightCounts.size());
+		std::vector<IndexPairVector::const_iterator> weightStartPerVertex;
+		weightStartPerVertex.resize(pSrcController->mWeightCounts.size(),pSrcController->mWeights.end());
+
 		IndexPairVector::const_iterator pit = pSrcController->mWeights.begin();
 		for( size_t a = 0; a < pSrcController->mWeightCounts.size(); ++a)
 		{
@@ -910,7 +926,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
 			const Collada::AnimationChannel& srcChannel = *cit;
 			Collada::ChannelEntry entry;
 
-			// we except the animation target to be of type "nodeName/transformID.subElement". Ignore all others
+			// we expect the animation target to be of type "nodeName/transformID.subElement". Ignore all others
 			// find the slash that separates the node name - there should be only one
 			std::string::size_type slashPos = srcChannel.mTarget.find( '/');
 			if( slashPos == std::string::npos)
@@ -979,122 +995,134 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
 			if( e.mTimeAccessor->mCount != e.mValueAccessor->mCount)
 				throw DeadlyImportError( boost::str( boost::format( "Time count / value count mismatch in animation channel \"%s\".") % e.mChannel->mTarget));
 
-			// find bounding times
-			startTime = std::min( startTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, 0, 0));
-			endTime = std::max( endTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, e.mTimeAccessor->mCount-1, 0));
+      if( e.mTimeAccessor->mCount > 0 )
+      {
+			  // find bounding times
+			  startTime = std::min( startTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, 0, 0));
+  			endTime = std::max( endTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, e.mTimeAccessor->mCount-1, 0));
+      }
 		}
 
-		// create a local transformation chain of the node's transforms
-		std::vector<Collada::Transform> transforms = srcNode->mTransforms;
-
-		// now for every unique point in time, find or interpolate the key values for that time
-		// and apply them to the transform chain. Then the node's present transformation can be calculated.
-		float time = startTime;
-		std::vector<aiMatrix4x4> resultTrafos;
-		while( 1)
-		{
-			for( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
-			{
-				Collada::ChannelEntry& e = *it;
-
-				// find the keyframe behind the current point in time
-				size_t pos = 0;
-				float postTime = 0.f;
-				while( 1)
-				{
-					if( pos >= e.mTimeAccessor->mCount)
-						break;
-					postTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
-					if( postTime >= time)
-						break;
-					++pos;
-				}
-
-				pos = std::min( pos, e.mTimeAccessor->mCount-1);
-
-				// read values from there
-				float temp[16];
-				for( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
-					temp[c] = ReadFloat( *e.mValueAccessor, *e.mValueData, pos, c);
-
-				// if not exactly at the key time, interpolate with previous value set
-				if( postTime > time && pos > 0)
-				{
-					float preTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos-1, 0);
-					float factor = (time - postTime) / (preTime - postTime);
-
-					for( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
-					{
-						float v = ReadFloat( *e.mValueAccessor, *e.mValueData, pos-1, c);
-						temp[c] += (v - temp[c]) * factor;
-					}
-				}
-
-				// Apply values to current transformation
-				std::copy( temp, temp + e.mValueAccessor->mSize, transforms[e.mTransformIndex].f + e.mSubElement);
-			}
-
-			// Calculate resulting transformation
-			aiMatrix4x4 mat = pParser.CalculateResultTransform( transforms);
-
-			// out of lazyness: we store the time in matrix.d4
-			mat.d4 = time;
-			resultTrafos.push_back( mat);
-
-			// find next point in time to evaluate. That's the closest frame larger than the current in any channel
-			float nextTime = 1e20f;
-			for( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
-			{
-				Collada::ChannelEntry& e = *it;
-
-				// find the next time value larger than the current
-				size_t pos = 0;
-				while( pos < e.mTimeAccessor->mCount)
-				{
-					float t = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
-					if( t > time)
-					{
-						nextTime = std::min( nextTime, t);
-						break;
-					}
-					++pos;
-				}
-			}
-
-			// no more keys on any channel after the current time -> we're done
-			if( nextTime > 1e19)
-				break;
-
-			// else construct next keyframe at this following time point
-			time = nextTime;
-		}
-
-		// there should be some keyframes
-		ai_assert( resultTrafos.size() > 0);
+    std::vector<aiMatrix4x4> resultTrafos;
+    if( !entries.empty() && entries.front().mTimeAccessor->mCount > 0 )
+    {
+		  // create a local transformation chain of the node's transforms
+		  std::vector<Collada::Transform> transforms = srcNode->mTransforms;
+
+		  // now for every unique point in time, find or interpolate the key values for that time
+		  // and apply them to the transform chain. Then the node's present transformation can be calculated.
+		  float time = startTime;
+		  while( 1)
+		  {
+			  for( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
+			  {
+				  Collada::ChannelEntry& e = *it;
+
+				  // find the keyframe behind the current point in time
+				  size_t pos = 0;
+				  float postTime = 0.f;
+				  while( 1)
+				  {
+					  if( pos >= e.mTimeAccessor->mCount)
+						  break;
+					  postTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
+					  if( postTime >= time)
+						  break;
+					  ++pos;
+				  }
+
+				  pos = std::min( pos, e.mTimeAccessor->mCount-1);
+
+				  // read values from there
+				  float temp[16];
+				  for( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
+					  temp[c] = ReadFloat( *e.mValueAccessor, *e.mValueData, pos, c);
+
+				  // if not exactly at the key time, interpolate with previous value set
+				  if( postTime > time && pos > 0)
+				  {
+					  float preTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos-1, 0);
+					  float factor = (time - postTime) / (preTime - postTime);
+
+					  for( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
+					  {
+						  float v = ReadFloat( *e.mValueAccessor, *e.mValueData, pos-1, c);
+						  temp[c] += (v - temp[c]) * factor;
+					  }
+				  }
+
+				  // Apply values to current transformation
+				  std::copy( temp, temp + e.mValueAccessor->mSize, transforms[e.mTransformIndex].f + e.mSubElement);
+			  }
+
+			  // Calculate resulting transformation
+			  aiMatrix4x4 mat = pParser.CalculateResultTransform( transforms);
+
+			  // out of lazyness: we store the time in matrix.d4
+			  mat.d4 = time;
+			  resultTrafos.push_back( mat);
+
+			  // find next point in time to evaluate. That's the closest frame larger than the current in any channel
+			  float nextTime = 1e20f;
+			  for( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
+			  {
+				  Collada::ChannelEntry& e = *it;
+
+				  // find the next time value larger than the current
+				  size_t pos = 0;
+				  while( pos < e.mTimeAccessor->mCount)
+				  {
+					  float t = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
+					  if( t > time)
+					  {
+						  nextTime = std::min( nextTime, t);
+						  break;
+					  }
+					  ++pos;
+				  }
+			  }
+
+			  // no more keys on any channel after the current time -> we're done
+			  if( nextTime > 1e19)
+				  break;
+
+			  // else construct next keyframe at this following time point
+			  time = nextTime;
+		  }
+    }
+
+		// there should be some keyframes, but we aren't that fixated on valid input data
+//		ai_assert( resultTrafos.size() > 0);
 
 		// build an animation channel for the given node out of these trafo keys
-		aiNodeAnim* dstAnim = new aiNodeAnim;
-		dstAnim->mNodeName = nodeName;
-		dstAnim->mNumPositionKeys = resultTrafos.size();
-		dstAnim->mNumRotationKeys= resultTrafos.size();
-		dstAnim->mNumScalingKeys = resultTrafos.size();
-		dstAnim->mPositionKeys = new aiVectorKey[resultTrafos.size()];
-		dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()];
-		dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()];
-
-		for( size_t a = 0; a < resultTrafos.size(); ++a)
-		{
-			aiMatrix4x4 mat = resultTrafos[a];
-			double time = double( mat.d4); // remember? time is stored in mat.d4
-      mat.d4 = 1.0f;
-
-			dstAnim->mPositionKeys[a].mTime = time;
-			dstAnim->mRotationKeys[a].mTime = time;
-			dstAnim->mScalingKeys[a].mTime = time;
-			mat.Decompose( dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue);
-		}
-
-		anims.push_back( dstAnim);
+    if( !resultTrafos.empty() )
+    {
+		  aiNodeAnim* dstAnim = new aiNodeAnim;
+		  dstAnim->mNodeName = nodeName;
+		  dstAnim->mNumPositionKeys = resultTrafos.size();
+		  dstAnim->mNumRotationKeys= resultTrafos.size();
+		  dstAnim->mNumScalingKeys = resultTrafos.size();
+		  dstAnim->mPositionKeys = new aiVectorKey[resultTrafos.size()];
+		  dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()];
+		  dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()];
+
+		  for( size_t a = 0; a < resultTrafos.size(); ++a)
+		  {
+			  aiMatrix4x4 mat = resultTrafos[a];
+			  double time = double( mat.d4); // remember? time is stored in mat.d4
+        mat.d4 = 1.0f;
+
+			  dstAnim->mPositionKeys[a].mTime = time;
+			  dstAnim->mRotationKeys[a].mTime = time;
+			  dstAnim->mScalingKeys[a].mTime = time;
+			  mat.Decompose( dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue);
+		  }
+
+		  anims.push_back( dstAnim);
+    } else
+    {
+      DefaultLogger::get()->warn( "Collada loader: found empty animation channel, ignored. Please check your exporter.");
+    }
 	}
 
 	if( !anims.empty())
@@ -1240,7 +1268,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
 
 		// transparency, a very hard one. seemingly not all files are following the
 		// specification here .. but we can trick.
-		if (effect.mTransparency > 0.f && effect.mTransparency < 1.f) {
+		if (effect.mTransparency >= 0.f && effect.mTransparency < 1.f) {
 			effect.mTransparency = 1.f- effect.mTransparency;
 			mat.AddProperty( &effect.mTransparency, 1, AI_MATKEY_OPACITY );
 			mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT );
@@ -1273,7 +1301,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
 
 // ------------------------------------------------------------------------------------------------
 // Constructs materials from the collada material definitions
-void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* /*pScene*/)
+void ColladaLoader::BuildMaterials( ColladaParser& pParser, aiScene* /*pScene*/)
 {
 	newMats.reserve(pParser.mMaterialLibrary.size());
 
@@ -1281,10 +1309,10 @@ void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* /*pSc
 	{
 		const Collada::Material& material = matIt->second;
 		// a material is only a reference to an effect
-		ColladaParser::EffectLibrary::const_iterator effIt = pParser.mEffectLibrary.find( material.mEffect);
+		ColladaParser::EffectLibrary::iterator effIt = pParser.mEffectLibrary.find( material.mEffect);
 		if( effIt == pParser.mEffectLibrary.end())
 			continue;
-		const Collada::Effect& effect = effIt->second;
+		Collada::Effect& effect = effIt->second;
 
 		// create material
 		aiMaterial* mat = new aiMaterial;
@@ -1293,7 +1321,7 @@ void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* /*pSc
 
 		// store the material
 		mMaterialIndexByName[matIt->first] = newMats.size();
-		newMats.push_back( std::pair<Collada::Effect*, aiMaterial*>(const_cast<Collada::Effect*>(&effect),mat) );
+		newMats.push_back( std::pair<Collada::Effect*, aiMaterial*>( &effect,mat) );
 	}
 	// ScenePreprocessor generates a default material automatically if none is there.
 	// All further code here in this loader works well without a valid material so
@@ -1396,6 +1424,33 @@ void ColladaLoader::ConvertPath (aiString& ss)
 		memmove(ss.data,ss.data+7,ss.length);
 		ss.data[ss.length] = '\0';
 	}
+
+  // Maxon Cinema Collada Export writes "file:///C:\andsoon" with three slashes... 
+  // I need to filter it without destroying linux paths starting with "/somewhere"
+  if( ss.data[0] == '/' && isalpha( ss.data[1]) && ss.data[2] == ':' )
+  {
+    ss.length--;
+    memmove( ss.data, ss.data+1, ss.length);
+    ss.data[ss.length] = 0;
+  }
+
+  // find and convert all %xyz special chars
+  char* out = ss.data;
+  for( const char* it = ss.data; it != ss.data + ss.length; /**/ )
+  {
+    if( *it == '%' )
+    {
+      size_t nbr = strtoul16( ++it, &it);
+      *out++ = (char)(nbr & 0xFF);
+    } else
+    {
+      *out++ = *it++;
+    }
+  }
+
+  // adjust length and terminator of the shortened string
+  *out = 0;
+  ss.length = (ptrdiff_t) (out - ss.data);
 }
 
 // ------------------------------------------------------------------------------------------------

+ 8 - 8
ThirdParty/Assimp/code/ColladaLoader.h

@@ -1,10 +1,10 @@
 /** Defines the collada loader class */
 
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -20,10 +20,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -89,10 +89,10 @@ public:
 	bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
 
 protected:
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details
 	 */
-	void GetExtensionList( std::set<std::string>& extensions);
+	const aiImporterDesc* GetInfo () const;
 
 	/** Imports the given file into the given scene structure. 
 	 * See BaseImporter::InternReadFile() for details
@@ -153,7 +153,7 @@ protected:
 	void CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName);
 	
 	/** Constructs materials from the collada material definitions */
-	void BuildMaterials( const ColladaParser& pParser, aiScene* pScene);
+	void BuildMaterials( ColladaParser& pParser, aiScene* pScene);
 
 	/** Fill materials from the collada material definitions */
 	void FillMaterials( const ColladaParser& pParser, aiScene* pScene);

+ 40 - 28
ThirdParty/Assimp/code/ColladaParser.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -500,7 +500,7 @@ void ColladaParser::ReadController( Collada::Controller& pController)
 	      for( unsigned int a = 0; a < 16; a++)
 	      {
 		      // read a number
-          content = fast_atof_move( content, pController.mBindShapeMatrix[a]);
+          content = fast_atoreal_move<float>( content, pController.mBindShapeMatrix[a]);
 		      // skip whitespace after it
 		      SkipSpacesAndLineEnd( &content);
 	      }
@@ -980,13 +980,13 @@ void ColladaParser::ReadLight( Collada::Light& pLight)
 				// text content contains 3 floats
 				const char* content = GetTextContent();
 				  
-				content = fast_atof_move( content, (float&)pLight.mColor.r);
+				content = fast_atoreal_move<float>( content, (float&)pLight.mColor.r);
 				SkipSpacesAndLineEnd( &content);
 				
-				content = fast_atof_move( content, (float&)pLight.mColor.g);
+				content = fast_atoreal_move<float>( content, (float&)pLight.mColor.g);
 				SkipSpacesAndLineEnd( &content);
 
-				content = fast_atof_move( content, (float&)pLight.mColor.b);
+				content = fast_atoreal_move<float>( content, (float&)pLight.mColor.b);
 				SkipSpacesAndLineEnd( &content);
 
 				TestClosing( "color");
@@ -1026,6 +1026,14 @@ void ColladaParser::ReadLight( Collada::Light& pLight)
 				pLight.mIntensity = ReadFloatFromTextContent();
 				TestClosing("intensity");
 			}
+			else if (IsElement("falloff")) {
+				pLight.mOuterAngle = ReadFloatFromTextContent();
+				TestClosing("falloff");
+			}
+			else if (IsElement("hotspot_beam")) {
+				pLight.mFalloffAngle = ReadFloatFromTextContent();
+				TestClosing("hotspot_beam");
+			}
 		}
 		else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
 			if( strcmp( mReader->getNodeName(), "light") == 0)
@@ -1342,16 +1350,16 @@ void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler)
 				// text content contains 4 floats
 				const char* content = GetTextContent(); 
 
-				content = fast_atof_move( content, (float&)pColor.r);
+				content = fast_atoreal_move<float>( content, (float&)pColor.r);
 				SkipSpacesAndLineEnd( &content);
 
-				content = fast_atof_move( content, (float&)pColor.g);
+				content = fast_atoreal_move<float>( content, (float&)pColor.g);
 				SkipSpacesAndLineEnd( &content);
 
-				content = fast_atof_move( content, (float&)pColor.b);
+				content = fast_atoreal_move<float>( content, (float&)pColor.b);
 				SkipSpacesAndLineEnd( &content);
 
-				content = fast_atof_move( content, (float&)pColor.a);
+				content = fast_atoreal_move<float>( content, (float&)pColor.a);
 				SkipSpacesAndLineEnd( &content);
 				TestClosing( "color");
 			} 
@@ -1404,7 +1412,7 @@ void ColladaParser::ReadEffectFloat( float& pFloat)
 			{
 				// text content contains a single floats
 				const char* content = GetTextContent();
-				content = fast_atof_move( content, pFloat);
+				content = fast_atoreal_move<float>( content, pFloat);
 				SkipSpacesAndLineEnd( &content);
 
 				TestClosing( "float");
@@ -1639,6 +1647,7 @@ void ColladaParser::ReadDataArray()
 {
 	std::string elmName = mReader->getNodeName();
 	bool isStringArray = (elmName == "IDREF_array" || elmName == "Name_array");
+  bool isEmptyElement = mReader->isEmptyElement();
 
 	// read attributes
 	int indexID = GetAttribute( "id");
@@ -1646,13 +1655,15 @@ void ColladaParser::ReadDataArray()
 	int indexCount = GetAttribute( "count");
 	unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( indexCount);
 	const char* content = TestTextContent();
-	if (content) { // some exporters write empty data arrays, silently skip over them
 
-		// read values and store inside an array in the data library
-		mDataLibrary[id] = Data();
-		Data& data = mDataLibrary[id];
-		data.mIsStringArray = isStringArray;
+  // read values and store inside an array in the data library
+  mDataLibrary[id] = Data();
+  Data& data = mDataLibrary[id];
+  data.mIsStringArray = isStringArray;
 
+  // some exporters write empty data arrays, but we need to conserve them anyways because others might reference them
+  if (content) 
+  { 
 		if( isStringArray)
 		{
 			data.mStrings.reserve( count);
@@ -1681,7 +1692,7 @@ void ColladaParser::ReadDataArray()
 
 				float value;
 				// read a number
-				content = fast_atof_move( content, value);
+				content = fast_atoreal_move<float>( content, value);
 				data.mValues.push_back( value);
 				// skip whitespace after it
 				SkipSpacesAndLineEnd( &content);
@@ -1689,8 +1700,9 @@ void ColladaParser::ReadDataArray()
 		}
 	}
 
-	// test for closing tag
-	TestClosing( elmName.c_str());
+  // test for closing tag
+  if( !isEmptyElement )
+    TestClosing( elmName.c_str());
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -2107,7 +2119,7 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPer
 		for( size_t b = 0; b < numPoints; b++)
 		{
 			// read all indices for this vertex. Yes, in a hacky local array
-			assert( numOffsets < 20 && perVertexOffset < 20);
+			ai_assert( numOffsets < 20 && perVertexOffset < 20);
 			size_t vindex[20];
 			for( size_t offsets = 0; offsets < numOffsets; ++offsets)
 				vindex[offsets] = *idx++;
@@ -2305,7 +2317,7 @@ void ColladaParser::ReadSceneNode( Node* pNode)
 					child->mName = mReader->getAttributeValue( attrName);
 
 				// TODO: (thom) support SIDs
-				// assert( TestAttribute( "sid") == -1);
+				// ai_assert( TestAttribute( "sid") == -1);
 
 				if (pNode) 
 				{
@@ -2445,7 +2457,7 @@ void ColladaParser::ReadNodeTransformation( Node* pNode, TransformType pType)
 	for( unsigned int a = 0; a < sNumParameters[pType]; a++)
 	{
 		// read a number
-		content = fast_atof_move( content, tf.f[a]);
+		content = fast_atoreal_move<float>( content, tf.f[a]);
 		// skip whitespace after it
 		SkipSpacesAndLineEnd( &content);
 	}
@@ -2697,11 +2709,11 @@ const char* ColladaParser::TestTextContent()
 {
 	// present node should be the beginning of an element
 	if( mReader->getNodeType() != irr::io::EXN_ELEMENT || mReader->isEmptyElement())
-		ThrowException( "Expected opening element");
+		return NULL;
 
 	// read contents of the element
-	if( !mReader->read())
-		ThrowException( "Unexpected end of file while reading n element.");
+	if( !mReader->read() )
+		return NULL;
 	if( mReader->getNodeType() != irr::io::EXN_TEXT)
 		return NULL;
 
@@ -2773,7 +2785,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
 				break;
 			}
 			default: 
-				assert( false);
+				ai_assert( false);
 				break;
 		}
 	}

+ 4 - 4
ThirdParty/Assimp/code/ColladaParser.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ copyright notice, this list of conditions and the
 following disclaimer in the documentation and/or other
 materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
 contributors may be used to endorse or promote products
 derived from this software without specific prior
-written permission of the ASSIMP Development Team.
+written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 8 - 8
ThirdParty/Assimp/code/ComputeUVMappingProcess.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -337,7 +337,7 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D&
 
 		for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt)	{
 			const aiVector3D& pos = mesh->mVertices[pnt];
-			out[pnt].Set((pos.z - min.z) / diffu,(pos.y - min.y) / diffv);
+			out[pnt].Set((pos.z - min.z) / diffu,(pos.y - min.y) / diffv,0.f);
 		}
 	}
 	else if (axis * base_axis_y >= angle_epsilon)	{
@@ -347,7 +347,7 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D&
 
 		for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt)	{
 			const aiVector3D& pos = mesh->mVertices[pnt];
-			out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv);
+			out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv,0.f);
 		}
 	}
 	else if (axis * base_axis_z >= angle_epsilon)	{
@@ -357,7 +357,7 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D&
 
 		for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt)	{
 			const aiVector3D& pos = mesh->mVertices[pnt];
-			out[pnt].Set((pos.y - min.y) / diffu,(pos.x - min.x) / diffv);
+			out[pnt].Set((pos.y - min.y) / diffu,(pos.x - min.x) / diffv,0.f);
 		}
 	}
 	// slower code path in case the mapping axis is not one of the coordinate system axes
@@ -372,7 +372,7 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D&
 		// again the same, except we're applying a transformation now
 		for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt)	{
 			const aiVector3D pos = mTrafo * mesh->mVertices[pnt];
-			out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv);
+			out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv,0.f);
 		}
 	}
 

+ 5 - 5
ThirdParty/Assimp/code/ComputeUVMappingProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_COMPUTEUVMAPPING_H_INC
 
 #include "BaseProcess.h"
-#include "../include/aiMesh.h"
+#include "../include/assimp/mesh.h"
 
 class ComputeUVMappingTest;
 namespace Assimp

+ 4 - 4
ThirdParty/Assimp/code/ConvertToLHProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 5 - 5
ThirdParty/Assimp/code/ConvertToLHProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_CONVERTTOLHPROCESS_H_INC
 #define AI_CONVERTTOLHPROCESS_H_INC
 
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 #include "BaseProcess.h"
 
 struct aiMesh;

+ 4 - 4
ThirdParty/Assimp/code/DXFHelper.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 32 - 17
ThirdParty/Assimp/code/DXFLoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -86,6 +86,20 @@ static aiColor4D g_aclrDxfIndexColors[] =
 #define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
 #define AI_DXF_ENTITIES_MAGIC_BLOCK "$ASSIMP_ENTITIES_MAGIC"
 
+
+static const aiImporterDesc desc = {
+	"Drawing Interchange Format (DXF) Importer",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportTextFlavour | aiImporterFlags_LimitedSupport,
+	0,
+	0,
+	0,
+	0,
+	"dxf" 
+};
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 DXFImporter::DXFImporter()
@@ -105,9 +119,9 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
 
 // ------------------------------------------------------------------------------------------------
 // Get a list of all supported file extensions
-void DXFImporter::GetExtensionList(std::set<std::string>& extensions)
+const aiImporterDesc* DXFImporter::GetInfo () const
 {
-	extensions.insert("dxf");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -220,20 +234,21 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
 		throw DeadlyImportError("DXF: no data blocks loaded");
 	}
 
+	DXF::Block* entities = 0;
+	
 	// index blocks by name
 	DXF::BlockMap blocks_by_name;
-	BOOST_FOREACH (const DXF::Block& bl, output.blocks) {
+	BOOST_FOREACH (DXF::Block& bl, output.blocks) {
 		blocks_by_name[bl.name] = &bl;
+		if ( !entities && bl.name == AI_DXF_ENTITIES_MAGIC_BLOCK ) {
+			entities = &bl;
+		}
 	}
 
-	const DXF::BlockMap::iterator bit = blocks_by_name.find(AI_DXF_ENTITIES_MAGIC_BLOCK);
-	if (bit == blocks_by_name.end()) {
+	if (!entities) {
 		throw DeadlyImportError("DXF: no ENTITIES data block loaded");
 	}
 
-	// ENTITIES is currently the only block that needs to be modified,
-	// this is the reason that blocks_by_name stores const by default.
-	DXF::Block& entities = const_cast<DXF::Block&>( *(*bit).second );
 	typedef std::map<std::string, unsigned int> LayerMap;
 
 	LayerMap layers;
@@ -241,10 +256,10 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
 
 	// now expand all block references in the primary ENTITIES block
 	// XXX this involves heavy memory copying, consider a faster solution for future versions.
-	ExpandBlockReferences(entities,blocks_by_name);
+	ExpandBlockReferences(*entities,blocks_by_name);
 
 	unsigned int cur = 0;
-	BOOST_FOREACH (boost::shared_ptr<const DXF::PolyLine> pl, entities.lines) {
+	BOOST_FOREACH (boost::shared_ptr<const DXF::PolyLine> pl, entities->lines) {
 		if (pl->positions.size()) {
 
 			std::map<std::string, unsigned int>::iterator it = layers.find(pl->layer);
@@ -506,7 +521,7 @@ void DXFImporter::ParseBlock(DXF::LineReader& reader, DXF::FileData& output)
 			Parse3DFace(++reader, output);
 			continue;
 		}
-		++reader;
+		++reader;
 	}
 }
 
@@ -683,12 +698,12 @@ void DXFImporter::ParsePolyLine(DXF::LineReader& reader, DXF::FileData& output)
 			line.indices.push_back(i*2);
 			line.indices.push_back(i*2+1);
 			line.counts.push_back(2);
-		}
+		}
 
 		// closed polyline?
 		if (line.flags & DXF_POLYLINE_FLAG_CLOSED) {
 			line.indices.push_back(line.positions.size()-1);
-			line.indices.push_back(0);
+			line.indices.push_back(0);
 			line.counts.push_back(2);
 		}
 	}

+ 7 - 7
ThirdParty/Assimp/code/DXFLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -82,9 +82,9 @@ public:
 protected:
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details*/
-	void GetExtensionList(std::set<std::string>& extensions);
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details*/
+	const aiImporterDesc* GetInfo () const;
 
 	// -------------------------------------------------------------------
 	/** Imports the given file into the given scene structure. 

+ 4 - 4
ThirdParty/Assimp/code/DeboneProcess.cpp

@@ -1,8 +1,8 @@
 									 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 6 - 6
ThirdParty/Assimp/code/DeboneProcess.h

@@ -1,8 +1,8 @@
 				   /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -46,8 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <utility>
 #include "BaseProcess.h"
 
-#include "../include/aiMesh.h"
-#include "../include/aiScene.h"
+#include "../include/assimp/mesh.h"
+#include "../include/assimp/scene.h"
 
 class DeboneTest;
 

+ 4 - 4
ThirdParty/Assimp/code/DefaultIOStream.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 5 - 5
ThirdParty/Assimp/code/DefaultIOStream.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_DEFAULTIOSTREAM_H_INC
 
 #include <stdio.h>
-#include "../include/IOStream.h"
+#include "../include/assimp/IOStream.hpp"
 
 namespace Assimp	{
 

+ 4 - 4
ThirdParty/Assimp/code/DefaultIOSystem.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 5 - 5
ThirdParty/Assimp/code/DefaultIOSystem.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_DEFAULTIOSYSTEM_H_INC
 #define AI_DEFAULTIOSYSTEM_H_INC
 
-#include "../include/IOSystem.h"
+#include "../include/assimp/IOSystem.hpp"
 
 namespace Assimp	{
 

+ 4 - 4
ThirdParty/Assimp/code/DefaultLogger.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 6 - 6
ThirdParty/Assimp/code/DefaultProgressHandler.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -38,13 +38,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ----------------------------------------------------------------------
 */
 
-/** @file ProgressHandler.h
+/** @file ProgressHandler.hpp
  *  @brief Abstract base class 'ProgressHandler'.
  */
 #ifndef INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
 #define INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
 
-#include "../include/ProgressHandler.h"
+#include "../include/assimp/ProgressHandler.hpp"
 namespace Assimp	{
 
 // ------------------------------------------------------------------------------------

+ 4 - 4
ThirdParty/Assimp/code/Exceptional.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2008, ASSIMP Development Team
+Copyright (c) 2006-2008, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 11 - 4
ThirdParty/Assimp/code/Exporter.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -73,6 +73,7 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
 void ExportSceneCollada(const char*,IOSystem*, const aiScene*);
 void ExportSceneObj(const char*,IOSystem*, const aiScene*);
 void ExportSceneSTL(const char*,IOSystem*, const aiScene*);
+void ExportScenePly(const char*,IOSystem*, const aiScene*);
 void ExportScene3DS(const char*, IOSystem*, const aiScene*) {}
 
 // ------------------------------------------------------------------------------------------------
@@ -93,6 +94,12 @@ Exporter::ExportFormatEntry gExporters[] =
 	),
 #endif
 
+#ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
+	Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, 
+		aiProcess_PreTransformVertices
+	),
+#endif
+
 //#ifndef ASSIMP_BUILD_NO_3DS_EXPORTER
 //	ExportFormatEntry( "3ds", "Autodesk 3DS (legacy format)", "3ds" , &ExportScene3DS),
 //#endif

+ 2 - 2
ThirdParty/Assimp/code/FileLogStream.h

@@ -1,8 +1,8 @@
 #ifndef ASSIMP_FILELOGSTREAM_H_INC
 #define ASSIMP_FILELOGSTREAM_H_INC
 
-#include "../include/LogStream.h"
-#include "../include/IOStream.h"
+#include "../include/assimp/LogStream.hpp"
+#include "../include/assimp/IOStream.hpp"
 
 namespace Assimp	{
 

+ 62 - 14
ThirdParty/Assimp/code/FileSystemFilter.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2008, ASSIMP Development Team
+Copyright (c) 2006-2008, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_FILESYSTEMFILTER_H_INC
 #define AI_FILESYSTEMFILTER_H_INC
 
-#include "../include/IOSystem.h"
+#include "../include/assimp/IOSystem.hpp"
 #include "fast_atof.h"
 #include "ParsingUtils.h"
 namespace Assimp	{
@@ -64,6 +64,7 @@ public:
 	FileSystemFilter(const std::string& file, IOSystem* old)
 		: wrapped  (old)
 		, src_file (file)
+		, sep(wrapped->getOsSeparator())
 	{
 		ai_assert(NULL != wrapped);
 
@@ -85,8 +86,9 @@ public:
 			base = ".";
 			base += getOsSeparator();
 		}
-		else if ((s = *(base.end()-1)) != '\\' && s != '/')
+		else if ((s = *(base.end()-1)) != '\\' && s != '/') {
 			base += getOsSeparator();
+		}
 
 		DefaultLogger::get()->info("Import root directory is \'" + base + "\'");
 	}
@@ -116,7 +118,7 @@ public:
 	/** Returns the directory separator. */
 	char getOsSeparator() const
 	{
-		return wrapped->getOsSeparator();
+		return sep;
 	}
 
 	// -------------------------------------------------------------------
@@ -140,7 +142,9 @@ public:
 				// Finally, look for typical issues with paths
 				// and try to correct them. This is our last
 				// resort.
+				tmp = pFile;
 				Cleanup(tmp);
+				BuildPath(tmp);
 				s = wrapped->Open(tmp,pMode);
 			}
 		}
@@ -163,8 +167,6 @@ public:
 	}
 
 private:
-	IOSystem* wrapped;
-	std::string src_file, base;
 
 	// -------------------------------------------------------------------
 	/** Build a valid path from a given relative or absolute path.
@@ -172,7 +174,7 @@ private:
 	void BuildPath (std::string& in) const
 	{
 		// if we can already access the file, great.
-		if (in.length() < 3 || wrapped->Exists(in.c_str())) {
+		if (in.length() < 3 || wrapped->Exists(in)) {
 			return;
 		}
 
@@ -180,13 +182,53 @@ private:
 		if (in[1] != ':') {
 		
 			// append base path and try 
-			in = base + in;
-			if (wrapped->Exists(in.c_str())) {
+			const std::string tmp = base + in;
+			if (wrapped->Exists(tmp)) {
+				in = tmp;
 				return;
 			}
 		}
+		
+		// Chop of the file name and look in the model directory, if
+		// this fails try all sub paths of the given path, i.e.
+		// if the given path is foo/bar/something.lwo, try
+		// <base>/something.lwo
+		// <base>/bar/something.lwo
+		// <base>/foo/bar/something.lwo
+		std::string::size_type pos = in.rfind('/');
+		if (std::string::npos == pos) {
+			pos = in.rfind('\\');
+		}
+
+		if (std::string::npos != pos)	{
+			std::string tmp;
+			std::string::size_type last_dirsep = std::string::npos;
+
+			while(true) {
+				tmp = base;
+				tmp += sep;
+
+				std::string::size_type dirsep = in.rfind('/', last_dirsep);
+				if (std::string::npos == dirsep) {
+					dirsep = in.rfind('\\', last_dirsep);
+				}
+
+				if (std::string::npos == dirsep || dirsep == 0) {
+					// we did try this already.
+					break;
+				}
 
-		// hopefully the underyling file system has another few tricks to access this file ...
+				last_dirsep = dirsep-1;
+
+				tmp += in.substr(dirsep+1, in.length()-pos); 
+				if (wrapped->Exists(tmp)) {
+					in = tmp;
+					return;
+				}
+			}
+		}
+
+		// hopefully the underlying file system has another few tricks to access this file ...
 	}
 
 	// -------------------------------------------------------------------
@@ -203,8 +245,9 @@ private:
 		// beginning of the path. 
 		std::string::iterator it = in.begin();
 		while (IsSpaceOrNewLine( *it ))++it;
-		if (it != in.begin())
+		if (it != in.begin()) {
 			in.erase(in.begin(),it+1);
+		}
 
 		const char sep = getOsSeparator();
 		for (it = in.begin(); it != in.end(); ++it) {
@@ -243,6 +286,11 @@ private:
 			last = *it;
 		}
 	}
+
+private:
+	IOSystem* wrapped;
+	std::string src_file, base;
+	char sep;
 };
 
 } //!ns Assimp

+ 4 - 4
ThirdParty/Assimp/code/FindDegenerates.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 5 - 5
ThirdParty/Assimp/code/FindDegenerates.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_FINDDEGENERATESPROCESS_H_INC
 
 #include "BaseProcess.h"
-#include "../include/aiMesh.h"
+#include "../include/assimp/mesh.h"
 
 class FindDegeneratesProcessTest;
 namespace Assimp	{

+ 4 - 4
ThirdParty/Assimp/code/FindInstancesProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/FindInstancesProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/FindInvalidDataProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 5 - 5
ThirdParty/Assimp/code/FindInvalidDataProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_FINDINVALIDDATA_H_INC
 
 #include "BaseProcess.h"
-#include "../include/aiTypes.h"
+#include "../include/assimp/types.h"
 
 struct aiMesh;
 class FindInvalidDataProcessTest;

+ 4 - 4
ThirdParty/Assimp/code/FixNormalsStep.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/FixNormalsStep.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 6 - 6
ThirdParty/Assimp/code/GenFaceNormalsProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -120,7 +120,7 @@ bool GenFaceNormalsProcess::GenMeshFaceNormals (aiMesh* pMesh)
 		if (face.mNumIndices < 3)	{
 			// either a point or a line -> no well-defined normal vector
 			for (unsigned int i = 0;i < face.mNumIndices;++i) {
-				pMesh->mNormals[face.mIndices[i]] = qnan;
+				pMesh->mNormals[face.mIndices[i]] = aiVector3D(qnan);
 			}
 			continue;
 		}
@@ -128,7 +128,7 @@ bool GenFaceNormalsProcess::GenMeshFaceNormals (aiMesh* pMesh)
 		const aiVector3D* pV1 = &pMesh->mVertices[face.mIndices[0]];
 		const aiVector3D* pV2 = &pMesh->mVertices[face.mIndices[1]];
 		const aiVector3D* pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices-1]];
-		aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
+		const aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
 
 		for (unsigned int i = 0;i < face.mNumIndices;++i) {
 			pMesh->mNormals[face.mIndices[i]] = vNor;

+ 5 - 5
ThirdParty/Assimp/code/GenFaceNormalsProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_GENFACENORMALPROCESS_H_INC
 
 #include "BaseProcess.h"
-#include "../include/aiMesh.h"
+#include "../include/assimp/mesh.h"
 
 namespace Assimp
 {

+ 17 - 12
ThirdParty/Assimp/code/GenVertexNormalsProcess.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -132,18 +132,21 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int
 		if (face.mNumIndices < 3)
 		{
 			// either a point or a line -> no normal vector
-			for (unsigned int i = 0;i < face.mNumIndices;++i)
-				pMesh->mNormals[face.mIndices[i]] = qnan;
+			for (unsigned int i = 0;i < face.mNumIndices;++i) {
+				pMesh->mNormals[face.mIndices[i]] = aiVector3D(qnan);
+			}
+
 			continue;
 		}
 
-		aiVector3D* pV1 = &pMesh->mVertices[face.mIndices[0]];
-		aiVector3D* pV2 = &pMesh->mVertices[face.mIndices[1]];
-		aiVector3D* pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices-1]];
-		aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
+		const aiVector3D* pV1 = &pMesh->mVertices[face.mIndices[0]];
+		const aiVector3D* pV2 = &pMesh->mVertices[face.mIndices[1]];
+		const aiVector3D* pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices-1]];
+		const aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
 
-		for (unsigned int i = 0;i < face.mNumIndices;++i)
+		for (unsigned int i = 0;i < face.mNumIndices;++i) {
 			pMesh->mNormals[face.mIndices[i]] = vNor;
+		}
 	}
 
 	// Set up a SpatialSort to quickly find all vertices close to a given position
@@ -175,7 +178,9 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int
 		// to optimize the whole algorithm a little bit ...
 		std::vector<bool> abHad(pMesh->mNumVertices,false);
 		for (unsigned int i = 0; i < pMesh->mNumVertices;++i)	{
-			if (abHad[i])continue;
+			if (abHad[i]) {
+				continue;
+			}
 
 			// Get all vertices that share this one ...
 			vertexFinder->FindPositions( pMesh->mVertices[i], posEpsilon, verticesFound);

+ 5 - 5
ThirdParty/Assimp/code/GenVertexNormalsProcess.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_GENVERTEXNORMALPROCESS_H_INC
 
 #include "BaseProcess.h"
-#include "../include/aiMesh.h"
+#include "../include/assimp/mesh.h"
 
 class GenNormalsTest;
 

+ 5 - 5
ThirdParty/Assimp/code/GenericProperty.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_GENERIC_PROPERTY_H_INCLUDED
 #define AI_GENERIC_PROPERTY_H_INCLUDED
 
-#include "./../include/assimp.hpp"
+#include "./../include/assimp/Importer.hpp"
 #include "Hash.h"
 
 // ------------------------------------------------------------------------------------------------

+ 6 - 6
ThirdParty/Assimp/code/HMPFileData.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 namespace Assimp	{
 namespace HMP	{
 
-#include "./../include/Compiler/pushpack1.h"
+#include "./../include/assimp/Compiler/pushpack1.h"
 
 // to make it easier for us, we test the magic word against both "endianesses"
 #define AI_HMP_MAGIC_NUMBER_BE_4	AI_MAKE_MAGIC("HMP4")
@@ -128,7 +128,7 @@ struct Vertex_HMP7
 	int8_t normal_x,normal_y;
 } PACK_STRUCT;
 
-#include "./../include/Compiler/poppack1.h"
+#include "./../include/assimp/Compiler/poppack1.h"
 
 } //! namespace HMP
 } //! namespace Assimp

+ 19 - 6
ThirdParty/Assimp/code/HMPLoader.cpp

@@ -1,9 +1,9 @@
 /*
 ---------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 
 All rights reserved.
 
@@ -20,10 +20,10 @@ conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -50,6 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
+static const aiImporterDesc desc = {
+	"3D GameStudio Heightmap (HMP) Importer",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportBinaryFlavour,
+	0,
+	0,
+	0,
+	0,
+	"hmp" 
+};
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 HMPImporter::HMPImporter()
@@ -85,9 +98,9 @@ bool HMPImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 
 // ------------------------------------------------------------------------------------------------
 // Get list of all file extensions that are handled by this loader
-void HMPImporter::GetExtensionList(std::set<std::string>& extensions)
+const aiImporterDesc* HMPImporter::GetInfo () const
 {
-	extensions.insert("hmp");
+	return &desc;
 }
 
 // ------------------------------------------------------------------------------------------------

+ 10 - 10
ThirdParty/Assimp/code/HMPLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -45,9 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AI_HMPLOADER_H_INCLUDED
 
 // public ASSIMP headers
-#include "../include/aiTypes.h"
-#include "../include/aiTexture.h"
-#include "../include/aiMaterial.h"
+#include "../include/assimp/types.h"
+#include "../include/assimp/texture.h"
+#include "../include/assimp/material.h"
 
 // internal headers
 #include "BaseImporter.h"
@@ -80,10 +80,10 @@ protected:
 
 
 	// -------------------------------------------------------------------
-	/** Called by Importer::GetExtensionList() for each loaded importer.
-	 * See BaseImporter::GetExtensionList() for details
+	/** Return importer meta information.
+	 * See #BaseImporter::GetInfo for the details
 	 */
-	void GetExtensionList(std::set<std::string>& extensions);
+	const aiImporterDesc* GetInfo () const;
 
 	// -------------------------------------------------------------------
 	/** Imports the given file into the given scene structure. 

+ 6 - 6
ThirdParty/Assimp/code/HalfLifeFileData.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef AI_MDLFILEHELPER2_H_INC
 #define AI_MDLFILEHELPER2_H_INC
 
-#include "./../include/Compiler/pushpack1.h"
+#include "./../include/assimp/Compiler/pushpack1.h"
 
 #include "MDLFileData.h"
 
@@ -142,7 +142,7 @@ struct Header_HL2
 	int32_t			transitionindex;
 } PACK_STRUCT;
 
-#include "./../include/Compiler/poppack1.h"
+#include "./../include/assimp/Compiler/poppack1.h"
 
 }
 } // end namespaces

+ 4 - 4
ThirdParty/Assimp/code/Hash.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 66 - 64
ThirdParty/Assimp/code/IFCCurve.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -64,14 +64,14 @@ public:
 	Conic(const IfcConic& entity, ConversionData& conv) 
 		: Curve(entity,conv)
 	{
-		aiMatrix4x4 trafo;
+		IfcMatrix4 trafo;
 		ConvertAxisPlacement(trafo,*entity.Position,conv);
 
 		// for convenience, extract the matrix rows
-		location = aiVector3D(trafo.a4,trafo.b4,trafo.c4);
-		p[0] = aiVector3D(trafo.a1,trafo.b1,trafo.c1);
-		p[1] = aiVector3D(trafo.a2,trafo.b2,trafo.c2);
-		p[2] = aiVector3D(trafo.a3,trafo.b3,trafo.c3);
+		location = IfcVector3(trafo.a4,trafo.b4,trafo.c4);
+		p[0] = IfcVector3(trafo.a1,trafo.b1,trafo.c1);
+		p[1] = IfcVector3(trafo.a2,trafo.b2,trafo.c2);
+		p[2] = IfcVector3(trafo.a3,trafo.b3,trafo.c3);
 	}
 
 public:
@@ -82,21 +82,21 @@ public:
 	}
 	
 	// --------------------------------------------------
-	size_t EstimateSampleCount(float a, float b) const {
+	size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
 		ai_assert(InRange(a) && InRange(b));
 
-		a = fmod(a,360.f);
-		b = fmod(b,360.f);
-		return static_cast<size_t>( fabs(ceil(( b-a)) / conv.settings.conicSamplingAngle) );
+		a = fmod(a,static_cast<IfcFloat>( 360. ));
+		b = fmod(b,static_cast<IfcFloat>( 360. ));
+		return static_cast<size_t>( abs(ceil(( b-a)) / conv.settings.conicSamplingAngle) );
 	}
 
 	// --------------------------------------------------
 	ParamRange GetParametricRange() const {
-		return std::make_pair(0.f,360.f);
+		return std::make_pair(static_cast<IfcFloat>( 0. ), static_cast<IfcFloat>( 360. ));
 	}
 
 protected:
-	aiVector3D location, p[3];
+	IfcVector3 location, p[3];
 };
 
 
@@ -118,9 +118,10 @@ public:
 public:
 
 	// --------------------------------------------------
-	aiVector3D Eval(float u) const {
+	IfcVector3 Eval(IfcFloat u) const {
 		u = -conv.angle_scale * u;
-		return location + entity.Radius*(::cos(u)*p[0] + ::sin(u)*p[1]);
+		return location + static_cast<IfcFloat>(entity.Radius)*(static_cast<IfcFloat>(::cos(u))*p[0] + 
+			static_cast<IfcFloat>(::sin(u))*p[1]);
 	}
 
 private:
@@ -146,9 +147,10 @@ public:
 public:
 
 	// --------------------------------------------------
-	aiVector3D Eval(float u) const {
+	IfcVector3 Eval(IfcFloat u) const {
 		u = -conv.angle_scale * u;
-		return location + entity.SemiAxis1*::cos(u)*p[0] + entity.SemiAxis2*::sin(u)*p[1];
+		return location + static_cast<IfcFloat>(entity.SemiAxis1)*static_cast<IfcFloat>(::cos(u))*p[0] +
+			static_cast<IfcFloat>(entity.SemiAxis2)*static_cast<IfcFloat>(::sin(u))*p[1];
 	}
 
 private:
@@ -181,12 +183,12 @@ public:
 	}
 
 	// --------------------------------------------------
-	aiVector3D Eval(float u) const {
+	IfcVector3 Eval(IfcFloat u) const {
 		return p + u*v;
 	}
 
 	// --------------------------------------------------
-	size_t EstimateSampleCount(float a, float b) const {
+	size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
 		ai_assert(InRange(a) && InRange(b));
 		// two points are always sufficient for a line segment
 		return a==b ? 1 : 2;
@@ -194,7 +196,7 @@ public:
 
 
 	// --------------------------------------------------
-	void SampleDiscrete(TempMesh& out,float a, float b) const
+	void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const
 	{
 		ai_assert(InRange(a) && InRange(b));
 	
@@ -209,14 +211,14 @@ public:
 
 	// --------------------------------------------------
 	ParamRange GetParametricRange() const {
-		const float inf = std::numeric_limits<float>::infinity();
+		const IfcFloat inf = std::numeric_limits<IfcFloat>::infinity();
 
 		return std::make_pair(-inf,+inf);
 	}
 
 private:
 	const IfcLine& entity;
-	aiVector3D p,v;
+	IfcVector3 p,v;
 };
 
 // --------------------------------------------------------------------------------
@@ -262,15 +264,15 @@ public:
 public:
 
 	// --------------------------------------------------
-	aiVector3D Eval(float u) const {
+	IfcVector3 Eval(IfcFloat u) const {
 		if (curves.empty()) {
-			return aiVector3D();
+			return IfcVector3();
 		}
 
-		float acc = 0;
+		IfcFloat acc = 0;
 		BOOST_FOREACH(const CurveEntry& entry, curves) {
 			const ParamRange& range = entry.first->GetParametricRange();
-			const float delta = range.second-range.first;
+			const IfcFloat delta = range.second-range.first;
 			if (u < acc+delta) {
 				return entry.first->Eval( entry.second ? (u-acc) + range.first : range.second-(u-acc));
 			}
@@ -282,16 +284,16 @@ public:
 	}
 
 	// --------------------------------------------------
-	size_t EstimateSampleCount(float a, float b) const {
+	size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
 		ai_assert(InRange(a) && InRange(b));
 		size_t cnt = 0;
 
-		float acc = 0;
+		IfcFloat acc = 0;
 		BOOST_FOREACH(const CurveEntry& entry, curves) {
 			const ParamRange& range = entry.first->GetParametricRange();
-			const float delta = range.second-range.first;
+			const IfcFloat delta = range.second-range.first;
 			if (a <= acc+delta && b >= acc) {
-				const float at =  std::max(0.f,a-acc), bt = std::min(delta,b-acc);
+				const IfcFloat at =  std::max(static_cast<IfcFloat>( 0. ),a-acc), bt = std::min(delta,b-acc);
 				cnt += entry.first->EstimateSampleCount( entry.second ? at + range.first : range.second - bt, entry.second ? bt + range.first : range.second - at );
 			}
 
@@ -302,7 +304,7 @@ public:
 	}
 
 	// --------------------------------------------------
-	void SampleDiscrete(TempMesh& out,float a, float b) const
+	void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const
 	{
 		ai_assert(InRange(a) && InRange(b));
 
@@ -321,14 +323,14 @@ public:
 
 	// --------------------------------------------------
 	ParamRange GetParametricRange() const {
-		return std::make_pair(0.f,total);
+		return std::make_pair(static_cast<IfcFloat>( 0. ),total);
 	}
 
 private:
 	const IfcCompositeCurve& entity;
 	std::vector< CurveEntry > curves;
 
-	float total;
+	IfcFloat total;
 };
 
 
@@ -356,7 +358,7 @@ public:
 		// claims that they must be identical if both are present.
 		// oh well.
 		bool have_param = false, have_point = false;
-		aiVector3D point;
+		IfcVector3 point;
 		BOOST_FOREACH(const Entry sel,entity.Trim1) {
 			if (const EXPRESS::REAL* const r = sel->ToPtr<EXPRESS::REAL>()) {
 				range.first = *r;
@@ -411,26 +413,26 @@ public:
 public:
 
 	// --------------------------------------------------
-	aiVector3D Eval(float p) const {
+	IfcVector3 Eval(IfcFloat p) const {
 		ai_assert(InRange(p));
 		return base->Eval( TrimParam(p) );
 	}
 
 	// --------------------------------------------------
-	size_t EstimateSampleCount(float a, float b) const {
+	size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
 		ai_assert(InRange(a) && InRange(b));
 		return base->EstimateSampleCount(TrimParam(a),TrimParam(b));
 	}
 
 	// --------------------------------------------------
 	ParamRange GetParametricRange() const {
-		return std::make_pair(0.f,maxval);
+		return std::make_pair(static_cast<IfcFloat>( 0. ),maxval);
 	}
 
 private:
 
 	// --------------------------------------------------
-	float TrimParam(float f) const {
+	IfcFloat TrimParam(IfcFloat f) const {
 		return agree_sense ? f + range.first :  range.second - f;
 	}
 
@@ -438,7 +440,7 @@ private:
 private:
 	const IfcTrimmedCurve& entity;
 	ParamRange range;
-	float maxval;
+	IfcFloat maxval;
 	bool agree_sense;
 	bool ok;
 
@@ -461,7 +463,7 @@ public:
 	{
 		points.reserve(entity.Points.size());
 
-		aiVector3D t;
+		IfcVector3 t;
 		BOOST_FOREACH(const IfcCartesianPoint& cp, entity.Points) {
 			ConvertCartesianPoint(t,cp);
 			points.push_back(t);
@@ -471,7 +473,7 @@ public:
 public:
 
 	// --------------------------------------------------
-	aiVector3D Eval(float p) const {
+	IfcVector3 Eval(IfcFloat p) const {
 		ai_assert(InRange(p));
 		
 		const size_t b = static_cast<size_t>(floor(p));  
@@ -479,24 +481,24 @@ public:
 			return points.back();
 		}
 
-		const float d = p-static_cast<float>(b);
-		return points[b+1] * d + points[b] * (1.f-d);
+		const IfcFloat d = p-static_cast<IfcFloat>(b);
+		return points[b+1] * d + points[b] * (static_cast<IfcFloat>( 1. )-d);
 	}
 
 	// --------------------------------------------------
-	size_t EstimateSampleCount(float a, float b) const {
+	size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
 		ai_assert(InRange(a) && InRange(b));
 		return static_cast<size_t>( ceil(b) - floor(a) );
 	}
 
 	// --------------------------------------------------
 	ParamRange GetParametricRange() const {
-		return std::make_pair(0.f,static_cast<float>(points.size()-1));
+		return std::make_pair(static_cast<IfcFloat>( 0. ),static_cast<IfcFloat>(points.size()-1));
 	}
 
 private:
 	const IfcPolyline& entity;
-	std::vector<aiVector3D> points;
+	std::vector<IfcVector3> points;
 };
 
 
@@ -540,11 +542,11 @@ Curve* Curve :: Convert(const IFC::IfcCurve& curve,ConversionData& conv)
 
 #ifdef _DEBUG
 // ------------------------------------------------------------------------------------------------
-bool Curve :: InRange(float u) const 
+bool Curve :: InRange(IfcFloat u) const 
 {
 	const ParamRange range = GetParametricRange();
 	if (IsClosed()) {
-		ai_assert(range.first != std::numeric_limits<float>::infinity() && range.second != std::numeric_limits<float>::infinity());
+		ai_assert(range.first != std::numeric_limits<IfcFloat>::infinity() && range.second != std::numeric_limits<IfcFloat>::infinity());
 		u = range.first + fmod(u-range.first,range.second-range.first);
 	}
 	return u >= range.first && u <= range.second;
@@ -552,14 +554,14 @@ bool Curve :: InRange(float u) const
 #endif 
 
 // ------------------------------------------------------------------------------------------------
-float Curve :: GetParametricRangeDelta() const
+IfcFloat Curve :: GetParametricRangeDelta() const
 {
 	const ParamRange& range = GetParametricRange();
 	return range.second - range.first;
 }
 
 // ------------------------------------------------------------------------------------------------
-size_t Curve :: EstimateSampleCount(float a, float b) const
+size_t Curve :: EstimateSampleCount(IfcFloat a, IfcFloat b) const
 {
 	ai_assert(InRange(a) && InRange(b));
 
@@ -568,16 +570,16 @@ size_t Curve :: EstimateSampleCount(float a, float b) const
 }
 
 // ------------------------------------------------------------------------------------------------
-float RecursiveSearch(const Curve* cv, const aiVector3D& val, float a, float b, unsigned int samples, float threshold, unsigned int recurse = 0, unsigned int max_recurse = 15)
+IfcFloat RecursiveSearch(const Curve* cv, const IfcVector3& val, IfcFloat a, IfcFloat b, unsigned int samples, IfcFloat threshold, unsigned int recurse = 0, unsigned int max_recurse = 15)
 {
 	ai_assert(samples>1);
 
-	const float delta = (b-a)/samples, inf = std::numeric_limits<float>::infinity();
-	float min_point[2] = {a,b}, min_diff[2] = {inf,inf};
-	float runner = a;
+	const IfcFloat delta = (b-a)/samples, inf = std::numeric_limits<IfcFloat>::infinity();
+	IfcFloat min_point[2] = {a,b}, min_diff[2] = {inf,inf};
+	IfcFloat runner = a;
 
 	for (unsigned int i = 0; i < samples; ++i, runner += delta) {
-		const float diff = (cv->Eval(runner)-val).SquareLength();
+		const IfcFloat diff = (cv->Eval(runner)-val).SquareLength();
 		if (diff < min_diff[0]) {
 			min_diff[1] = min_diff[0];
 			min_point[1] = min_point[0];
@@ -599,10 +601,10 @@ float RecursiveSearch(const Curve* cv, const aiVector3D& val, float a, float b,
 	// fix for closed curves to take their wrap-over into account
 	if (cv->IsClosed() && fabs(min_point[0]-min_point[1]) > cv->GetParametricRangeDelta()*0.5  ) {
 		const Curve::ParamRange& range = cv->GetParametricRange();
-		const float wrapdiff = (cv->Eval(range.first)-val).SquareLength();
+		const IfcFloat wrapdiff = (cv->Eval(range.first)-val).SquareLength();
 
 		if (wrapdiff < min_diff[0]) {
-			const float t = min_point[0];
+			const IfcFloat t = min_point[0];
 			min_point[0] = min_point[1] > min_point[0] ? range.first : range.second;
 			 min_point[1] = t;
 		}
@@ -612,14 +614,14 @@ float RecursiveSearch(const Curve* cv, const aiVector3D& val, float a, float b,
 }
 
 // ------------------------------------------------------------------------------------------------
-bool Curve :: ReverseEval(const aiVector3D& val, float& paramOut) const
+bool Curve :: ReverseEval(const IfcVector3& val, IfcFloat& paramOut) const
 {
 	// note: the following algorithm is not guaranteed to find the 'right' parameter value
 	// in all possible cases, but it will always return at least some value so this function
 	// will never fail in the default implementation.
 
 	// XXX derive threshold from curve topology
-	const float threshold = 1e-4f;
+	const IfcFloat threshold = 1e-4f;
 	const unsigned int samples = 16;
 
 	const ParamRange& range = GetParametricRange();
@@ -629,14 +631,14 @@ bool Curve :: ReverseEval(const aiVector3D& val, float& paramOut) const
 }
 
 // ------------------------------------------------------------------------------------------------
-void Curve :: SampleDiscrete(TempMesh& out,float a, float b) const
+void Curve :: SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const
 {
 	ai_assert(InRange(a) && InRange(b));
 
 	const size_t cnt = std::max(static_cast<size_t>(0),EstimateSampleCount(a,b));
 	out.verts.reserve( out.verts.size() + cnt );
 
-	float p = a, delta = (b-a)/cnt;
+	IfcFloat p = a, delta = (b-a)/cnt;
 	for(size_t i = 0; i < cnt; ++i, p += delta) {
 		out.verts.push_back(Eval(p));
 	}
@@ -652,7 +654,7 @@ bool BoundedCurve :: IsClosed() const
 void BoundedCurve :: SampleDiscrete(TempMesh& out) const
 {
 	const ParamRange& range = GetParametricRange();
-	ai_assert(range.first != std::numeric_limits<float>::infinity() && range.second != std::numeric_limits<float>::infinity());
+	ai_assert(range.first != std::numeric_limits<IfcFloat>::infinity() && range.second != std::numeric_limits<IfcFloat>::infinity());
 
 	return SampleDiscrete(out,range.first,range.second);
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 675 - 236
ThirdParty/Assimp/code/IFCGeometry.cpp


+ 37 - 20
ThirdParty/Assimp/code/IFCLoader.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -57,14 +57,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "StreamReader.h"
 #include "MemoryIOWrapper.h"
 
+namespace Assimp {
+	template<> const std::string LogFunctions<IFCImporter>::log_prefix = "IFC: ";
+}
 
 using namespace Assimp;
 using namespace Assimp::Formatter;
 using namespace Assimp::IFC;
 
-template<> const std::string LogFunctions<IFCImporter>::log_prefix = "IFC: ";
-
-
 /* DO NOT REMOVE this comment block. The genentitylist.sh script
  * just looks for names adhering to the IfcSomething naming scheme
  * and includes all matches in the whitelist for code-generation. Thus,
@@ -93,6 +93,20 @@ void ConvertUnit(const EXPRESS::DataType& dt,ConversionData& conv);
 
 } // anon
 
+static const aiImporterDesc desc = {
+	"Industry Foundation Classes (IFC) Importer",
+	"",
+	"",
+	"",
+	aiImporterFlags_SupportBinaryFlavour,
+	0,
+	0,
+	0,
+	0,
+	"ifc" 
+};
+
+
 // ------------------------------------------------------------------------------------------------
 // Constructor to be privately used by Importer
 IFCImporter::IFCImporter()
@@ -125,9 +139,9 @@ bool IFCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
 
 // ------------------------------------------------------------------------------------------------
 // List all extensions handled by this loader
-void IFCImporter::GetExtensionList(std::set<std::string>& app) 
+const aiImporterDesc* IFCImporter::GetInfo () const
 {
-	app.insert("ifc");
+	return &desc;
 }
 
 
@@ -155,7 +169,7 @@ void IFCImporter::InternReadFile( const std::string& pFile,
 	}
 
 	boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
-	const STEP::HeaderInfo& head = const_cast<const STEP::DB&>(*db).GetHeader();
+	const STEP::HeaderInfo& head = static_cast<const STEP::DB&>(*db).GetHeader();
 
 	if(!head.fileSchema.size() || head.fileSchema.substr(0,3) != "IFC") {
 		ThrowException("Unrecognized file schema: " + head.fileSchema);
@@ -228,7 +242,7 @@ void IFCImporter::InternReadFile( const std::string& pFile,
 
 	// apply world coordinate system (which includes the scaling to convert to meters and a -90 degrees rotation around x)
 	aiMatrix4x4 scale, rot;
-	aiMatrix4x4::Scaling(aiVector3D(conv.len_scale,conv.len_scale,conv.len_scale),scale);
+	aiMatrix4x4::Scaling(static_cast<aiVector3D>(IfcVector3(conv.len_scale)),scale);
 	aiMatrix4x4::RotationX(-AI_MATH_HALF_PI_F,rot);
 
 	pScene->mRootNode->mTransformation = rot * scale * conv.wcs * pScene->mRootNode->mTransformation;
@@ -325,7 +339,10 @@ void SetCoordinateSpace(ConversionData& conv)
 void ResolveObjectPlacement(aiMatrix4x4& m, const IfcObjectPlacement& place, ConversionData& conv)
 {
 	if (const IfcLocalPlacement* const local = place.ToPtr<IfcLocalPlacement>()){
-		ConvertAxisPlacement(m, *local->RelativePlacement, conv);
+		IfcMatrix4 tmp;
+		ConvertAxisPlacement(tmp, *local->RelativePlacement, conv);
+
+		m = static_cast<aiMatrix4x4>(tmp);
 
 		if (local->PlacementRelTo) {
 			aiMatrix4x4 tmp;
@@ -356,10 +373,10 @@ bool ProcessMappedItem(const IfcMappedItem& mapped, aiNode* nd_src, std::vector<
 	nd->mName.Set("IfcMappedItem");
 		
 	// handle the Cartesian operator
-	aiMatrix4x4 m;
+	IfcMatrix4 m;
 	ConvertTransformOperator(m, *mapped.MappingTarget);
 
-	aiMatrix4x4 msrc;
+	IfcMatrix4 msrc;
 	ConvertAxisPlacement(msrc,*mapped.MappingSource->MappingOrigin,conv);
 
 	msrc = m*msrc;
@@ -367,7 +384,7 @@ bool ProcessMappedItem(const IfcMappedItem& mapped, aiNode* nd_src, std::vector<
 	std::vector<unsigned int> meshes;
 	const size_t old_openings = conv.collect_openings ? conv.collect_openings->size() : 0;
 	if (conv.apply_openings) {
-		aiMatrix4x4 minv = msrc;
+		IfcMatrix4 minv = msrc;
 		minv.Inverse();
 		BOOST_FOREACH(TempOpening& open,*conv.apply_openings){
 			open.Transform(minv);
@@ -401,7 +418,7 @@ bool ProcessMappedItem(const IfcMappedItem& mapped, aiNode* nd_src, std::vector<
 		}
 	}
 
-	nd->mTransformation =  nd_src->mTransformation * msrc;
+	nd->mTransformation =  nd_src->mTransformation * static_cast<aiMatrix4x4>( msrc );
 	subnodes_src.push_back(nd.release());
 
 	return true;
@@ -468,7 +485,7 @@ struct RateRepresentationPredicate {
 	}
 
 	bool operator() (const IfcRepresentation* a, const IfcRepresentation* b) const {
-		return Rate(a) <= Rate(b);
+		return Rate(a) < Rate(b);
 	}
 };
 
@@ -543,7 +560,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const IfcProduct& el, Conversion
 
 	std::vector<TempOpening> openings;
 
-	aiMatrix4x4 myInv;
+	IfcMatrix4 myInv;
 	bool didinv = false;
 
 	// convert everything contained directly within this structure,
@@ -733,7 +750,7 @@ void ProcessSpatialStructures(ConversionData& conv)
 void MakeTreeRelative(aiNode* start, const aiMatrix4x4& combined)
 {
 	// combined is the parent's absolute transformation matrix
-	aiMatrix4x4 old = start->mTransformation;
+	const aiMatrix4x4 old = start->mTransformation;
 
 	if (!combined.IsIdentity()) {
 		start->mTransformation = aiMatrix4x4(combined).Inverse() * start->mTransformation;
@@ -748,7 +765,7 @@ void MakeTreeRelative(aiNode* start, const aiMatrix4x4& combined)
 // ------------------------------------------------------------------------------------------------
 void MakeTreeRelative(ConversionData& conv)
 {
-	MakeTreeRelative(conv.out->mRootNode,aiMatrix4x4());
+	MakeTreeRelative(conv.out->mRootNode,IfcMatrix4());
 }
 
 } // !anon

+ 5 - 5
ThirdParty/Assimp/code/IFCLoader.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -85,7 +85,7 @@ public:
 protected:
 
 	// --------------------
-	void GetExtensionList(std::set<std::string>& app);
+	const aiImporterDesc* GetInfo () const;
 
 	// --------------------
 	void SetupProperties(const Importer* pImp);

+ 7 - 7
ThirdParty/Assimp/code/IFCMaterial.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -84,7 +84,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat
 			if (const IFC::IfcSurfaceStyleRendering* ren = shade->ToPtr<IFC::IfcSurfaceStyleRendering>()) {
 
 				if (ren->Transparency) {
-					const float t = 1.f-ren->Transparency.Get();
+					const float t = 1.f-static_cast<float>(ren->Transparency.Get());
 					mat->AddProperty(&t,1, AI_MATKEY_OPACITY);
 				}
 
@@ -115,7 +115,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat
 					if(const EXPRESS::REAL* rt = ren->SpecularHighlight.Get()->ToPtr<EXPRESS::REAL>()) {
 						// at this point we don't distinguish between the two distinct ways of
 						// specifying highlight intensities. leave this to the user.
-						const float e = *rt;
+						const float e = static_cast<float>(*rt);
 						mat->AddProperty(&e,1,AI_MATKEY_SHININESS);
 					}
 					else {
@@ -141,7 +141,7 @@ unsigned int ProcessMaterials(const IFC::IfcRepresentationItem& item, Conversion
 		name.Set("<IFCDefault>");
 		mat->AddProperty(&name,AI_MATKEY_NAME);
 
-		aiColor4D col = aiColor4D(0.6f,0.6f,0.6f,1.0f);
+		const aiColor4D col = aiColor4D(0.6f,0.6f,0.6f,1.0f);
 		mat->AddProperty(&col,1, AI_MATKEY_COLOR_DIFFUSE);
 
 		conv.materials.push_back(mat.release());

+ 14 - 14
ThirdParty/Assimp/code/IFCProfile.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -54,7 +54,7 @@ namespace Assimp {
 void ProcessPolyLine(const IfcPolyline& def, TempMesh& meshout, ConversionData& /*conv*/)
 {
 	// this won't produce a valid mesh, it just spits out a list of vertices
-	aiVector3D t;
+	IfcVector3 t;
 	BOOST_FOREACH(const IfcCartesianPoint& cp, def.Points) {
 		ConvertCartesianPoint(t,cp);
 		meshout.verts.push_back(t);
@@ -104,13 +104,13 @@ void ProcessOpenProfile(const IfcArbitraryOpenProfileDef& def, TempMesh& meshout
 void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh& meshout, ConversionData& conv)
 {
 	if(const IfcRectangleProfileDef* const cprofile = def.ToPtr<IfcRectangleProfileDef>()) {
-		const float x = cprofile->XDim*0.5f, y = cprofile->YDim*0.5f;
+		const IfcFloat x = cprofile->XDim*0.5f, y = cprofile->YDim*0.5f;
 
 		meshout.verts.reserve(meshout.verts.size()+4);
-		meshout.verts.push_back( aiVector3D( x, y, 0.f ));
-		meshout.verts.push_back( aiVector3D(-x, y, 0.f ));
-		meshout.verts.push_back( aiVector3D(-x,-y, 0.f ));
-		meshout.verts.push_back( aiVector3D( x,-y, 0.f ));
+		meshout.verts.push_back( IfcVector3( x, y, 0.f ));
+		meshout.verts.push_back( IfcVector3(-x, y, 0.f ));
+		meshout.verts.push_back( IfcVector3(-x,-y, 0.f ));
+		meshout.verts.push_back( IfcVector3( x,-y, 0.f ));
 		meshout.vertcnt.push_back(4);
 	}
 	else if( const IfcCircleProfileDef* const circle = def.ToPtr<IfcCircleProfileDef>()) {
@@ -118,13 +118,13 @@ void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh&
 			// TODO
 		}
 		const size_t segments = 32;
-		const float delta = AI_MATH_TWO_PI_F/segments, radius = circle->Radius;
+		const IfcFloat delta = AI_MATH_TWO_PI_F/segments, radius = circle->Radius;
 
 		meshout.verts.reserve(segments);
 
-		float angle = 0.f;
+		IfcFloat angle = 0.f;
 		for(size_t i = 0; i < segments; ++i, angle += delta) {
-			meshout.verts.push_back( aiVector3D( cos(angle)*radius, sin(angle)*radius, 0.f ));
+			meshout.verts.push_back( IfcVector3( cos(angle)*radius, sin(angle)*radius, 0.f ));
 		}
 
 		meshout.vertcnt.push_back(segments);
@@ -134,7 +134,7 @@ void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh&
 		return;
 	}
 
-	aiMatrix4x4 trafo;
+	IfcMatrix4 trafo;
 	ConvertAxisPlacement(trafo, *def.Position);
 	meshout.Transform(trafo);
 }

+ 4 - 4
ThirdParty/Assimp/code/IFCReaderGen.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 4 - 4
ThirdParty/Assimp/code/IFCReaderGen.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

+ 63 - 63
ThirdParty/Assimp/code/IFCUtil.cpp

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -52,18 +52,18 @@ namespace Assimp {
 	namespace IFC {
 
 // ------------------------------------------------------------------------------------------------
-void TempOpening::Transform(const aiMatrix4x4& mat) 
+void TempOpening::Transform(const IfcMatrix4& mat) 
 {
 	if(profileMesh) {
 		profileMesh->Transform(mat);
 	}
-	extrusionDir *= aiMatrix3x3(mat);
+	extrusionDir *= IfcMatrix3(mat);
 }
 
 // ------------------------------------------------------------------------------------------------
 aiMesh* TempMesh::ToMesh() 
 {
-	ai_assert(verts.size() == std::accumulate(vertcnt.begin(),vertcnt.end(),0));
+	ai_assert(verts.size() == std::accumulate(vertcnt.begin(),vertcnt.end(),size_t(0)));
 
 	if (verts.empty()) {
 		return NULL;
@@ -107,17 +107,17 @@ void TempMesh::Clear()
 }
 
 // ------------------------------------------------------------------------------------------------
-void TempMesh::Transform(const aiMatrix4x4& mat) 
+void TempMesh::Transform(const IfcMatrix4& mat) 
 {
-	BOOST_FOREACH(aiVector3D& v, verts) {
+	BOOST_FOREACH(IfcVector3& v, verts) {
 		v *= mat;
 	}
 }
 
 // ------------------------------------------------------------------------------
-aiVector3D TempMesh::Center() const
+IfcVector3 TempMesh::Center() const
 {
-	return std::accumulate(verts.begin(),verts.end(),aiVector3D(0.f,0.f,0.f)) / static_cast<float>(verts.size());
+	return std::accumulate(verts.begin(),verts.end(),IfcVector3()) / static_cast<IfcFloat>(verts.size());
 }
 
 // ------------------------------------------------------------------------------------------------
@@ -132,32 +132,32 @@ void TempMesh::RemoveAdjacentDuplicates()
 {
 
 	bool drop = false;
-	std::vector<aiVector3D>::iterator base = verts.begin();
+	std::vector<IfcVector3>::iterator base = verts.begin();
 	BOOST_FOREACH(unsigned int& cnt, vertcnt) {
 		if (cnt < 2){
 			base += cnt;
 			continue;
 		}
 
-		aiVector3D vmin,vmax;
+		IfcVector3 vmin,vmax;
 		ArrayBounds(&*base, cnt ,vmin,vmax);
 
 
-		const float epsilon = (vmax-vmin).SquareLength() / 1e9f;
-		//const float dotepsilon = 1e-9;
+		const IfcFloat epsilon = (vmax-vmin).SquareLength() / static_cast<IfcFloat>(1e9);
+		//const IfcFloat dotepsilon = 1e-9;
 
 		//// look for vertices that lie directly on the line between their predecessor and their 
 		//// successor and replace them with either of them.
 
 		//for(size_t i = 0; i < cnt; ++i) {
-		//	aiVector3D& v1 = *(base+i), &v0 = *(base+(i?i-1:cnt-1)), &v2 = *(base+(i+1)%cnt);
-		//	const aiVector3D& d0 = (v1-v0), &d1 = (v2-v1);
-		//	const float l0 = d0.SquareLength(), l1 = d1.SquareLength();
+		//	IfcVector3& v1 = *(base+i), &v0 = *(base+(i?i-1:cnt-1)), &v2 = *(base+(i+1)%cnt);
+		//	const IfcVector3& d0 = (v1-v0), &d1 = (v2-v1);
+		//	const IfcFloat l0 = d0.SquareLength(), l1 = d1.SquareLength();
 		//	if (!l0 || !l1) {
 		//		continue;
 		//	}
 
-		//	const float d = (d0/sqrt(l0))*(d1/sqrt(l1));
+		//	const IfcFloat d = (d0/sqrt(l0))*(d1/sqrt(l1));
 
 		//	if ( d >= 1.f-dotepsilon ) {
 		//		v1 = v0;
@@ -171,7 +171,7 @@ void TempMesh::RemoveAdjacentDuplicates()
 		// drop any identical, adjacent vertices. this pass will collect the dropouts
 		// of the previous pass as a side-effect.
 		FuzzyVectorCompare fz(epsilon);
-		std::vector<aiVector3D>::iterator end = base+cnt, e = std::unique( base, end, fz );
+		std::vector<IfcVector3>::iterator end = base+cnt, e = std::unique( base, end, fz );
 		if (e != end) {
 			cnt -= static_cast<unsigned int>(std::distance(e, end));
 			verts.erase(e,end);
@@ -200,7 +200,7 @@ bool IsTrue(const EXPRESS::BOOLEAN& in)
 }
 
 // ------------------------------------------------------------------------------------------------
-float ConvertSIPrefix(const std::string& prefix)
+IfcFloat ConvertSIPrefix(const std::string& prefix)
 {
 	if (prefix == "EXA") {
 		return 1e18f;
@@ -259,22 +259,22 @@ float ConvertSIPrefix(const std::string& prefix)
 // ------------------------------------------------------------------------------------------------
 void ConvertColor(aiColor4D& out, const IfcColourRgb& in)
 {
-	out.r = in.Red;
-	out.g = in.Green;
-	out.b = in.Blue;
-	out.a = 1.f;
+	out.r = static_cast<float>( in.Red );
+	out.g = static_cast<float>( in.Green );
+	out.b = static_cast<float>( in.Blue );
+	out.a = static_cast<float>( 1.f );
 }
 
 // ------------------------------------------------------------------------------------------------
 void ConvertColor(aiColor4D& out, const IfcColourOrFactor& in,ConversionData& conv,const aiColor4D* base)
 {
 	if (const EXPRESS::REAL* const r = in.ToPtr<EXPRESS::REAL>()) {
-		out.r = out.g = out.b = *r;
+		out.r = out.g = out.b = static_cast<float>(*r);
 		if(base) {
-			out.r *= base->r;
-			out.g *= base->g;
-			out.b *= base->b;
-			out.a = base->a;
+			out.r *= static_cast<float>( base->r );
+			out.g *= static_cast<float>( base->g );
+			out.b *= static_cast<float>( base->b );
+			out.a = static_cast<float>( base->a );
 		}
 		else out.a = 1.0;
 	}
@@ -287,29 +287,29 @@ void ConvertColor(aiColor4D& out, const IfcColourOrFactor& in,ConversionData& co
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertCartesianPoint(aiVector3D& out, const IfcCartesianPoint& in)
+void ConvertCartesianPoint(IfcVector3& out, const IfcCartesianPoint& in)
 {
-	out = aiVector3D();
+	out = IfcVector3();
 	for(size_t i = 0; i < in.Coordinates.size(); ++i) {
 		out[i] = in.Coordinates[i];
 	}
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertVector(aiVector3D& out, const IfcVector& in)
+void ConvertVector(IfcVector3& out, const IfcVector& in)
 {
 	ConvertDirection(out,in.Orientation);
 	out *= in.Magnitude;
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertDirection(aiVector3D& out, const IfcDirection& in)
+void ConvertDirection(IfcVector3& out, const IfcDirection& in)
 {
-	out = aiVector3D();
+	out = IfcVector3();
 	for(size_t i = 0; i < in.DirectionRatios.size(); ++i) {
 		out[i] = in.DirectionRatios[i];
 	}
-	const float len = out.Length();
+	const IfcFloat len = out.Length();
 	if (len<1e-6) {
 		IFCImporter::LogWarn("direction vector magnitude too small, normalization would result in a division by zero");
 		return;
@@ -318,7 +318,7 @@ void ConvertDirection(aiVector3D& out, const IfcDirection& in)
 }
 
 // ------------------------------------------------------------------------------------------------
-void AssignMatrixAxes(aiMatrix4x4& out, const aiVector3D& x, const aiVector3D& y, const aiVector3D& z)
+void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z)
 {
 	out.a1 = x.x;
 	out.b1 = x.y;
@@ -334,12 +334,12 @@ void AssignMatrixAxes(aiMatrix4x4& out, const aiVector3D& x, const aiVector3D& y
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement3D& in)
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement3D& in)
 {
-	aiVector3D loc;
+	IfcVector3 loc;
 	ConvertCartesianPoint(loc,in.Location);
 
-	aiVector3D z(0.f,0.f,1.f),r(1.f,0.f,0.f),x;
+	IfcVector3 z(0.f,0.f,1.f),r(1.f,0.f,0.f),x;
 
 	if (in.Axis) { 
 		ConvertDirection(z,*in.Axis.Get());
@@ -348,47 +348,47 @@ void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement3D& in)
 		ConvertDirection(r,*in.RefDirection.Get());
 	}
 
-	aiVector3D v = r.Normalize();
-	aiVector3D tmpx = z * (v*z);
+	IfcVector3 v = r.Normalize();
+	IfcVector3 tmpx = z * (v*z);
 
 	x = (v-tmpx).Normalize();
-	aiVector3D y = (z^x);
+	IfcVector3 y = (z^x);
 
-	aiMatrix4x4::Translation(loc,out);
+	IfcMatrix4::Translation(loc,out);
 	AssignMatrixAxes(out,x,y,z);
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement2D& in)
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement2D& in)
 {
-	aiVector3D loc;
+	IfcVector3 loc;
 	ConvertCartesianPoint(loc,in.Location);
 
-	aiVector3D x(1.f,0.f,0.f);
+	IfcVector3 x(1.f,0.f,0.f);
 	if (in.RefDirection) {
 		ConvertDirection(x,*in.RefDirection.Get());
 	}
 
-	const aiVector3D y = aiVector3D(x.y,-x.x,0.f);
+	const IfcVector3 y = IfcVector3(x.y,-x.x,0.f);
 
-	aiMatrix4x4::Translation(loc,out);
-	AssignMatrixAxes(out,x,y,aiVector3D(0.f,0.f,1.f));
+	IfcMatrix4::Translation(loc,out);
+	AssignMatrixAxes(out,x,y,IfcVector3(0.f,0.f,1.f));
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertAxisPlacement(aiVector3D& axis, aiVector3D& pos, const IfcAxis1Placement& in)
+void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const IfcAxis1Placement& in)
 {
 	ConvertCartesianPoint(pos,in.Location);
 	if (in.Axis) {
 		ConvertDirection(axis,in.Axis.Get());
 	}
 	else {
-		axis = aiVector3D(0.f,0.f,1.f);
+		axis = IfcVector3(0.f,0.f,1.f);
 	}
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement& in, ConversionData& conv)
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement& in, ConversionData& conv)
 {
 	if(const IfcAxis2Placement3D* pl3 = in.ResolveSelectPtr<IfcAxis2Placement3D>(conv.db)) {
 		ConvertAxisPlacement(out,*pl3);
@@ -402,12 +402,12 @@ void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement& in, Convers
 }
 
 // ------------------------------------------------------------------------------------------------
-void ConvertTransformOperator(aiMatrix4x4& out, const IfcCartesianTransformationOperator& op)
+void ConvertTransformOperator(IfcMatrix4& out, const IfcCartesianTransformationOperator& op)
 {
-	aiVector3D loc;
+	IfcVector3 loc;
 	ConvertCartesianPoint(loc,op.LocalOrigin);
 
-	aiVector3D x(1.f,0.f,0.f),y(0.f,1.f,0.f),z(0.f,0.f,1.f);
+	IfcVector3 x(1.f,0.f,0.f),y(0.f,1.f,0.f),z(0.f,0.f,1.f);
 	if (op.Axis1) {
 		ConvertDirection(x,*op.Axis1.Get());
 	}
@@ -420,24 +420,24 @@ void ConvertTransformOperator(aiMatrix4x4& out, const IfcCartesianTransformation
 		}
 	}
 
-	aiMatrix4x4 locm;
-	aiMatrix4x4::Translation(loc,locm);	
+	IfcMatrix4 locm;
+	IfcMatrix4::Translation(loc,locm);	
 	AssignMatrixAxes(out,x,y,z);
 
 
-	aiVector3D vscale;
+	IfcVector3 vscale;
 	if (const IfcCartesianTransformationOperator3DnonUniform* nuni = op.ToPtr<IfcCartesianTransformationOperator3DnonUniform>()) {
 		vscale.x = nuni->Scale?op.Scale.Get():1.f;
 		vscale.y = nuni->Scale2?nuni->Scale2.Get():1.f;
 		vscale.z = nuni->Scale3?nuni->Scale3.Get():1.f;
 	}
 	else {
-		const float sc = op.Scale?op.Scale.Get():1.f;
-		vscale = aiVector3D(sc,sc,sc);
+		const IfcFloat sc = op.Scale?op.Scale.Get():1.f;
+		vscale = IfcVector3(sc,sc,sc);
 	}
 
-	aiMatrix4x4 s;
-	aiMatrix4x4::Scaling(vscale,s);
+	IfcMatrix4 s;
+	IfcMatrix4::Scaling(vscale,s);
 
 	out = locm * out * s;
 }

+ 47 - 33
ThirdParty/Assimp/code/IFCUtil.h

@@ -1,8 +1,8 @@
 /*
-Open Asset Import Library (ASSIMP)
+Open Asset Import Library (assimp)
 ----------------------------------------------------------------------
 
-Copyright (c) 2006-2010, ASSIMP Development Team
+Copyright (c) 2006-2012, assimp team
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, 
@@ -18,10 +18,10 @@ following conditions are met:
   following disclaimer in the documentation and/or other
   materials provided with the distribution.
 
-* Neither the name of the ASSIMP team, nor the names of its
+* Neither the name of the assimp team, nor the names of its
   contributors may be used to endorse or promote products
   derived from this software without specific prior
-  written permission of the ASSIMP Development Team.
+  written permission of the assimp team.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -51,6 +51,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 namespace Assimp {
 namespace IFC {
 
+	typedef double IfcFloat;
+
+	// IfcFloat-precision math data types
+	typedef aiVector2t<IfcFloat> IfcVector2;
+	typedef aiVector3t<IfcFloat> IfcVector3;
+	typedef aiMatrix4x4t<IfcFloat> IfcMatrix4;
+	typedef aiMatrix3x3t<IfcFloat> IfcMatrix3;
+	typedef aiColor4t<IfcFloat> IfcColor4; 
+
+
 // helper for std::for_each to delete all heap-allocated items in a container
 template<typename T>
 struct delete_fun
@@ -67,11 +77,11 @@ struct TempMesh;
 struct TempOpening 
 {
 	const IFC::IfcExtrudedAreaSolid* solid;
-	aiVector3D extrusionDir;
+	IfcVector3 extrusionDir;
 	boost::shared_ptr<TempMesh> profileMesh;
 
 	// ------------------------------------------------------------------------------
-	TempOpening(const IFC::IfcExtrudedAreaSolid* solid,aiVector3D extrusionDir,boost::shared_ptr<TempMesh> profileMesh)
+	TempOpening(const IFC::IfcExtrudedAreaSolid* solid,IfcVector3 extrusionDir,boost::shared_ptr<TempMesh> profileMesh)
 		: solid(solid)
 		, extrusionDir(extrusionDir)
 		, profileMesh(profileMesh)
@@ -79,7 +89,7 @@ struct TempOpening
 	}
 
 	// ------------------------------------------------------------------------------
-	void Transform(const aiMatrix4x4& mat); // defined later since TempMesh is not complete yet
+	void Transform(const IfcMatrix4& mat); // defined later since TempMesh is not complete yet
 };
 
 
@@ -104,14 +114,14 @@ struct ConversionData
 		std::for_each(materials.begin(),materials.end(),delete_fun<aiMaterial>());
 	}
 
-	float len_scale, angle_scale;
+	IfcFloat len_scale, angle_scale;
 	bool plane_angle_in_radians;
 
 	const STEP::DB& db;
 	const IFC::IfcProject& proj;
 	aiScene* out;
 
-	aiMatrix4x4 wcs;
+	IfcMatrix4 wcs;
 	std::vector<aiMesh*> meshes;
 	std::vector<aiMaterial*> materials;
 
@@ -135,12 +145,12 @@ struct ConversionData
 // ------------------------------------------------------------------------------------------------
 struct FuzzyVectorCompare {
 
-	FuzzyVectorCompare(float epsilon) : epsilon(epsilon) {}
-	bool operator()(const aiVector3D& a, const aiVector3D& b) {
+	FuzzyVectorCompare(IfcFloat epsilon) : epsilon(epsilon) {}
+	bool operator()(const IfcVector3& a, const IfcVector3& b) {
 		return fabs((a-b).SquareLength()) < epsilon;
 	}
 
-	const float epsilon;
+	const IfcFloat epsilon;
 };
 
 
@@ -149,14 +159,14 @@ struct FuzzyVectorCompare {
 // ------------------------------------------------------------------------------------------------
 struct TempMesh
 {
-	std::vector<aiVector3D> verts;
+	std::vector<IfcVector3> verts;
 	std::vector<unsigned int> vertcnt;
 
 	// utilities
 	aiMesh* ToMesh();
 	void Clear();
-	void Transform(const aiMatrix4x4& mat);
-	aiVector3D Center() const;
+	void Transform(const IfcMatrix4& mat);
+	IfcVector3 Center() const;
 	void Append(const TempMesh& other);
 	void RemoveAdjacentDuplicates();
 };
@@ -168,17 +178,17 @@ struct TempMesh
 // conversion routines for common IFC entities, implemented in IFCUtil.cpp
 void ConvertColor(aiColor4D& out, const IfcColourRgb& in);
 void ConvertColor(aiColor4D& out, const IfcColourOrFactor& in,ConversionData& conv,const aiColor4D* base);
-void ConvertCartesianPoint(aiVector3D& out, const IfcCartesianPoint& in);
-void ConvertDirection(aiVector3D& out, const IfcDirection& in);
-void ConvertVector(aiVector3D& out, const IfcVector& in);
-void AssignMatrixAxes(aiMatrix4x4& out, const aiVector3D& x, const aiVector3D& y, const aiVector3D& z);
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement3D& in);
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement2D& in);
-void ConvertAxisPlacement(aiVector3D& axis, aiVector3D& pos, const IFC::IfcAxis1Placement& in);
-void ConvertAxisPlacement(aiMatrix4x4& out, const IfcAxis2Placement& in, ConversionData& conv);
-void ConvertTransformOperator(aiMatrix4x4& out, const IfcCartesianTransformationOperator& op);
+void ConvertCartesianPoint(IfcVector3& out, const IfcCartesianPoint& in);
+void ConvertDirection(IfcVector3& out, const IfcDirection& in);
+void ConvertVector(IfcVector3& out, const IfcVector& in);
+void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z);
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement3D& in);
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement2D& in);
+void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const IFC::IfcAxis1Placement& in);
+void ConvertAxisPlacement(IfcMatrix4& out, const IfcAxis2Placement& in, ConversionData& conv);
+void ConvertTransformOperator(IfcMatrix4& out, const IfcCartesianTransformationOperator& op);
 bool IsTrue(const EXPRESS::BOOLEAN& in);
-float ConvertSIPrefix(const std::string& prefix);
+IfcFloat ConvertSIPrefix(const std::string& prefix);
 
 
 // IFCProfile.cpp
@@ -224,36 +234,40 @@ protected:
 
 public:
 
-	typedef std::pair<float,float> ParamRange;
+	typedef std::pair<IfcFloat, IfcFloat> ParamRange;
 
 public:
 
+
+	virtual ~Curve() {}
+
+
 	// check if a curve is closed 
 	virtual bool IsClosed() const = 0;
 
 	// evaluate the curve at the given parametric position
-	virtual aiVector3D Eval(float p) const = 0;
+	virtual IfcVector3 Eval(IfcFloat p) const = 0;
 
 	// try to match a point on the curve to a given parameter
 	// for self-intersecting curves, the result is not ambiguous and
 	// it is undefined which parameter is returned. 
-	virtual bool ReverseEval(const aiVector3D& val, float& paramOut) const;
+	virtual bool ReverseEval(const IfcVector3& val, IfcFloat& paramOut) const;
 
 	// get the range of the curve (both inclusive).
 	// +inf and -inf are valid return values, the curve is not bounded in such a case.
-	virtual std::pair<float,float> GetParametricRange() const = 0;
-	float GetParametricRangeDelta() const;
+	virtual std::pair<IfcFloat,IfcFloat> GetParametricRange() const = 0;
+	IfcFloat GetParametricRangeDelta() const;
 
 	// estimate the number of sample points that this curve will require
-	virtual size_t EstimateSampleCount(float start,float end) const;
+	virtual size_t EstimateSampleCount(IfcFloat start,IfcFloat end) const;
 
 	// intelligently sample the curve based on the current settings
 	// and append the result to the mesh
-	virtual void SampleDiscrete(TempMesh& out,float start,float end) const;
+	virtual void SampleDiscrete(TempMesh& out,IfcFloat start,IfcFloat end) const;
 
 #ifdef _DEBUG
 	// check if a particular parameter value lies within the well-defined range
-	bool InRange(float) const;
+	bool InRange(IfcFloat) const;
 #endif 
 
 public:

+ 2 - 2
ThirdParty/Assimp/code/IFF.h

@@ -12,7 +12,7 @@
 namespace Assimp	{
 namespace IFF		{
 
-#include "./../include/Compiler/pushpack1.h"
+#include "./../include/assimp/Compiler/pushpack1.h"
 
 /////////////////////////////////////////////////////////////////////////////////
 //! Describes an IFF chunk header
@@ -39,7 +39,7 @@ struct SubChunkHeader
 	uint16_t length;
 } PACK_STRUCT;
 
-#include "./../include/Compiler/poppack1.h"
+#include "./../include/assimp/Compiler/poppack1.h"
 
 
 #define AI_IFF_FOURCC(a,b,c,d) ((uint32_t) (((uint8_t)a << 24u) | \

Vissa filer visades inte eftersom för många filer har ändrats