2008-06-22 10:09:26 +00:00
|
|
|
|
/*
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
Open Asset Import Library (ASSIMP)
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2006-2008, ASSIMP Development Team
|
|
|
|
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
Redistribution and use of this software in source and binary forms,
|
|
|
|
|
with or without modification, are permitted provided that the following
|
|
|
|
|
conditions are met:
|
|
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above
|
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
|
following disclaimer.
|
|
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
|
following disclaimer in the documentation and/or other
|
|
|
|
|
materials provided with the distribution.
|
|
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2009-01-13 18:58:07 +00:00
|
|
|
|
/** @file aiDefines.h
|
|
|
|
|
* @brief Assimp build configuration setup. See the notes in the comment
|
2009-01-12 22:06:54 +00:00
|
|
|
|
* blocks to find out how you can customize your Assimp build.
|
2008-10-13 16:45:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
#ifndef INCLUDED_AI_DEFINES_H
|
|
|
|
|
#define INCLUDED_AI_DEFINES_H
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-01-11 15:20:06 +00:00
|
|
|
|
// Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
|
|
|
|
|
// file format loader. The loader is be excluded from the
|
|
|
|
|
// build in this case. 'XX' stands for the most common file
|
|
|
|
|
// extension of the file format. E.g.:
|
|
|
|
|
// ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
|
2009-01-18 23:48:25 +00:00
|
|
|
|
//
|
|
|
|
|
// Other configuration switches:
|
|
|
|
|
// ASSIMP_BUILD_NO_COMPRESSED_X
|
|
|
|
|
// - Disable support for compressed X files, removes the
|
|
|
|
|
// dependency from the zlib inflate algorithm.
|
|
|
|
|
//
|
|
|
|
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
|
|
|
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
|
|
|
|
#endif
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
|
2009-03-15 00:40:30 +00:00
|
|
|
|
// post-processing step.
|
|
|
|
|
// Full list of all 'XX':
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// CALCTANGENTS
|
|
|
|
|
// JOINVERTICES
|
|
|
|
|
// TRIANGULATE
|
|
|
|
|
// GENFACENORMALS
|
|
|
|
|
// GENVERTEXNORMALS
|
|
|
|
|
// REMOVEVC
|
|
|
|
|
// SPLITLARGEMESHES
|
|
|
|
|
// PRETRANSFORMVERTICES
|
|
|
|
|
// LIMITBONEWEIGHTS
|
|
|
|
|
// VALIDATEDS
|
|
|
|
|
// IMPROVECACHELOCALITY
|
|
|
|
|
// FIXINFACINGNORMALS
|
|
|
|
|
// REMOVE_REDUNDANTMATERIALS
|
|
|
|
|
// OPTIMIZEGRAPH
|
|
|
|
|
// SORTBYPTYPE
|
|
|
|
|
// FINDINVALIDDATA
|
2008-11-16 21:56:45 +00:00
|
|
|
|
// TRANSFORMTEXCOORDS
|
|
|
|
|
// GENUVCOORDS
|
2009-02-06 22:43:08 +00:00
|
|
|
|
// ENTITYMESHBUILDER
|
2009-03-15 00:40:30 +00:00
|
|
|
|
// MAKELEFTHANDED
|
|
|
|
|
// FLIPUVS
|
|
|
|
|
// FLIPWINDINGORDER
|
|
|
|
|
// *OPTIMIZEMESHES
|
|
|
|
|
// *OPTIMIZEANIMS
|
|
|
|
|
// *OPTIMIZENODES
|
|
|
|
|
// *GENENTITYMESHES
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Compiler specific includes and definitions
|
|
|
|
|
#if (defined _MSC_VER)
|
|
|
|
|
# undef ASSIMP_API
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Include our workaround stdint.h - VC doesn't have one
|
|
|
|
|
# include "./../include/Compiler/pstdint.h"
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-06-22 10:09:26 +00:00
|
|
|
|
// Define ASSIMP_BUILD_DLL_EXPORT to build a DLL of the library
|
|
|
|
|
# if (defined ASSIMP_BUILD_DLL_EXPORT)
|
|
|
|
|
# define ASSIMP_API __declspec(dllexport)
|
2008-08-08 15:18:28 +00:00
|
|
|
|
# pragma warning (disable : 4251)
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-06-22 10:09:26 +00:00
|
|
|
|
// Define ASSIMP_DLL before including Assimp to use ASSIMP in
|
|
|
|
|
// an external DLL (otherwise a static library is used)
|
|
|
|
|
# elif (defined ASSIMP_DLL)
|
|
|
|
|
# define ASSIMP_API __declspec(dllimport)
|
|
|
|
|
# else
|
|
|
|
|
# define ASSIMP_API
|
|
|
|
|
# endif
|
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Force the compiler to inline a function, if supported
|
2008-10-13 16:45:48 +00:00
|
|
|
|
# define AI_FORCE_INLINE __forceinline
|
|
|
|
|
|
2008-08-13 23:46:46 +00:00
|
|
|
|
#else
|
|
|
|
|
# define ASSIMP_API
|
2008-10-13 16:45:48 +00:00
|
|
|
|
# define AI_FORCE_INLINE inline
|
2008-06-22 10:09:26 +00:00
|
|
|
|
#endif // (defined _MSC_VER)
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// No explicit 'struct' and 'enum' tags for C++, we don't want to
|
2009-01-19 19:34:34 +00:00
|
|
|
|
// confuse the AI (:-)) of our IDE.
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# define C_STRUCT
|
2009-01-12 22:06:54 +00:00
|
|
|
|
# define C_ENUM
|
2008-06-22 10:09:26 +00:00
|
|
|
|
#else
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-06-22 10:09:26 +00:00
|
|
|
|
// To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
|
|
|
|
|
// is defined by Doxygen's preprocessor. The corresponding
|
|
|
|
|
// entries in the DoxyFile look like this:
|
|
|
|
|
#if 0
|
|
|
|
|
ENABLE_PREPROCESSING = YES
|
|
|
|
|
MACRO_EXPANSION = YES
|
|
|
|
|
EXPAND_ONLY_PREDEF = YES
|
|
|
|
|
SEARCH_INCLUDES = YES
|
|
|
|
|
INCLUDE_PATH =
|
|
|
|
|
INCLUDE_FILE_PATTERNS =
|
|
|
|
|
PREDEFINED = ASSIMP_DOXYGEN_BUILD=1
|
2009-01-12 22:06:54 +00:00
|
|
|
|
EXPAND_AS_DEFINED = C_STRUCT C_ENUM
|
2008-06-22 10:09:26 +00:00
|
|
|
|
SKIP_FUNCTION_MACROS = YES
|
|
|
|
|
#endif
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Doxygen gets confused if we use c-struct typedefs to avoid
|
|
|
|
|
// the explicit 'struct' notation. This trick here has the same
|
|
|
|
|
// effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
|
|
|
|
|
// to typedef all structs/enums.
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# if (defined ASSIMP_DOXYGEN_BUILD)
|
2009-01-12 22:06:54 +00:00
|
|
|
|
# define C_STRUCT
|
|
|
|
|
# define C_ENUM
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# else
|
|
|
|
|
# define C_STRUCT struct
|
2009-01-12 22:06:54 +00:00
|
|
|
|
# define C_ENUM enum
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
|
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
#error Currently Borland is unsupported. Feel free to port Assimp.
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// "W8059 Packgr<67><72>e der Struktur ge<67>ndert"
|
|
|
|
|
|
|
|
|
|
#endif
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// Define ASSIMP_BUILD_BOOST_WORKAROUND to compile assimp
|
|
|
|
|
// without boost. This is done by using a few workaround
|
|
|
|
|
// classes. However, some assimp features are not available
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// in this case. This implies the ASSIMP_BUILD_SINGLETHREADED option.
|
2008-10-13 16:45:48 +00:00
|
|
|
|
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
|
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// threading support requires boost
|
|
|
|
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
# define ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
#endif
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
|
|
|
|
|
// without threading support. The library doesn't utilize
|
|
|
|
|
// threads then, and is itself not threadsafe.
|
|
|
|
|
// If this flag is specified, boost::threads is *not* required.
|
|
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
# define ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
# define AI_C_THREADSAFE
|
|
|
|
|
#endif // !! ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
#if (defined _DEBUG || defined DEBUG) // one of the two should be defined ..
|
|
|
|
|
# define ASSIMP_BUILD_DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Make sure NULL is defined
|
|
|
|
|
#ifndef NULL
|
|
|
|
|
# define NULL 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// Use our own definition of PI here
|
2008-08-08 15:18:28 +00:00
|
|
|
|
#define AI_MATH_PI (3.1415926538)
|
|
|
|
|
#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
|
2008-11-26 13:17:39 +00:00
|
|
|
|
#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
|
2008-08-08 15:18:28 +00:00
|
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
// Tiny macro to convert from radians to degrees and the reverse
|
2008-08-13 15:45:57 +00:00
|
|
|
|
#define AI_DEG_TO_RAD(x) (x*0.0174532925f)
|
|
|
|
|
#define AI_RAD_TO_DEG(x) (x*57.2957795f)
|
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
#endif // !! INCLUDED_AI_DEFINES_H
|