2008-06-22 10:09:26 +00:00
|
|
|
|
/*
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
Open Asset Import Library (ASSIMP)
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
2010-04-10 15:30:22 +00:00
|
|
|
|
Copyright (c) 2006-2010, ASSIMP Development Team
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
Redistribution and use of this software in source and binary forms,
|
|
|
|
|
with or without modification, are permitted provided that the following
|
|
|
|
|
conditions are met:
|
|
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above
|
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
|
following disclaimer.
|
|
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
|
following disclaimer in the documentation and/or other
|
|
|
|
|
materials provided with the distribution.
|
|
|
|
|
|
|
|
|
|
* 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-04-11 14:31:57 +00:00
|
|
|
|
* blocks to find out how to 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-04-11 14:31:57 +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.
|
|
|
|
|
*
|
|
|
|
|
* If you're unsure about that, take a look at the implementation of the
|
|
|
|
|
* import plugin you wish to disable. You'll find the right define in the
|
|
|
|
|
* first lines of the corresponding unit.
|
|
|
|
|
*
|
|
|
|
|
* Other (mixed) configuration switches are listed here:
|
|
|
|
|
* ASSIMP_BUILD_NO_COMPRESSED_X
|
2010-07-11 00:37:34 +00:00
|
|
|
|
* - Disable support for compressed X files
|
|
|
|
|
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
|
|
|
|
* - Disable support for compressed Blender files*/
|
2009-04-11 14:31:57 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2010-07-11 00:37:34 +00:00
|
|
|
|
|
2009-01-18 23:48:25 +00:00
|
|
|
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
|
|
|
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
2010-07-11 00:37:34 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
|
|
|
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
2009-01-18 23:48:25 +00:00
|
|
|
|
#endif
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +00:00
|
|
|
|
/* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
|
|
|
|
|
* post processing step. This is the current list of process names ('XX'):
|
|
|
|
|
* CALCTANGENTS
|
|
|
|
|
* JOINVERTICES
|
|
|
|
|
* TRIANGULATE
|
|
|
|
|
* GENFACENORMALS
|
|
|
|
|
* GENVERTEXNORMALS
|
|
|
|
|
* REMOVEVC
|
|
|
|
|
* SPLITLARGEMESHES
|
|
|
|
|
* PRETRANSFORMVERTICES
|
|
|
|
|
* LIMITBONEWEIGHTS
|
|
|
|
|
* VALIDATEDS
|
|
|
|
|
* IMPROVECACHELOCALITY
|
|
|
|
|
* FIXINFACINGNORMALS
|
|
|
|
|
* REMOVE_REDUNDANTMATERIALS
|
|
|
|
|
* OPTIMIZEGRAPH
|
|
|
|
|
* SORTBYPTYPE
|
|
|
|
|
* FINDINVALIDDATA
|
|
|
|
|
* TRANSFORMTEXCOORDS
|
|
|
|
|
* GENUVCOORDS
|
|
|
|
|
* ENTITYMESHBUILDER
|
|
|
|
|
* MAKELEFTHANDED
|
|
|
|
|
* FLIPUVS
|
|
|
|
|
* FLIPWINDINGORDER
|
|
|
|
|
* OPTIMIZEMESHES
|
|
|
|
|
* OPTIMIZEANIMS
|
|
|
|
|
* OPTIMIZEGRAPH
|
|
|
|
|
* GENENTITYMESHES
|
|
|
|
|
* FIXTEXTUREPATHS */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2010-07-11 00:37:34 +00:00
|
|
|
|
#ifdef _MSC_VER
|
2009-01-12 22:06:54 +00:00
|
|
|
|
# undef ASSIMP_API
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +00:00
|
|
|
|
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2010-07-11 00:37:34 +00:00
|
|
|
|
# ifdef ASSIMP_BUILD_DLL_EXPORT
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# define ASSIMP_API __declspec(dllexport)
|
2011-08-22 20:22:51 +00:00
|
|
|
|
# define ASSIMP_API_WINONLY __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
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +00:00
|
|
|
|
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
|
|
|
|
|
* an external DLL under Windows. Default is static linkage. */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# elif (defined ASSIMP_DLL)
|
|
|
|
|
# define ASSIMP_API __declspec(dllimport)
|
2011-08-22 20:22:51 +00:00
|
|
|
|
# define ASSIMP_API_WINONLY __declspec(dllimport)
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# else
|
|
|
|
|
# define ASSIMP_API
|
2011-08-22 20:22:51 +00:00
|
|
|
|
# define ASSIMP_API_WINONLY
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# endif
|
|
|
|
|
|
2010-02-05 22:32:19 +00:00
|
|
|
|
/* Force the compiler to inline a function, if possible
|
2009-04-11 14:31:57 +00:00
|
|
|
|
*/
|
2008-10-13 16:45:48 +00:00
|
|
|
|
# define AI_FORCE_INLINE __forceinline
|
|
|
|
|
|
2010-02-05 22:32:19 +00:00
|
|
|
|
/* Tells the compiler that a function never returns. Used in code analysis
|
2010-07-11 00:37:34 +00:00
|
|
|
|
* to skip dead paths (e.g. after an assertion evaluated to false). */
|
2010-02-05 22:32:19 +00:00
|
|
|
|
# define AI_WONT_RETURN __declspec(noreturn)
|
2008-08-13 23:46:46 +00:00
|
|
|
|
#else
|
2010-02-05 22:32:19 +00:00
|
|
|
|
|
|
|
|
|
# define AI_WONT_RETURN
|
|
|
|
|
|
2011-08-22 20:22:51 +00:00
|
|
|
|
# define ASSIMP_API __attribute__ ((visibility("default")))
|
|
|
|
|
# define ASSIMP_API_WINONLY
|
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
|
2011-08-22 20:22:51 +00:00
|
|
|
|
/* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
|
|
|
|
|
* in doxydocs.
|
2009-04-11 14:31:57 +00:00
|
|
|
|
*/
|
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
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +00:00
|
|
|
|
/* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
|
|
|
|
|
* is defined by Doxygen's preprocessor. The corresponding
|
|
|
|
|
* entries in the DOXYFILE are: */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2008-06-22 10:09:26 +00:00
|
|
|
|
#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-04-11 14:31:57 +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__))
|
2010-07-11 00:37:34 +00:00
|
|
|
|
#error Currently, Borland is unsupported. Feel free to port Assimp.
|
2009-01-19 19:34:34 +00:00
|
|
|
|
|
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
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +00:00
|
|
|
|
/* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
|
|
|
|
|
* without boost. This is done by using a few workaround
|
|
|
|
|
* classes and brings some limitations (e.g. some logging won't be done,
|
|
|
|
|
* the library won't utilize threads or be threadsafe at all).
|
|
|
|
|
* This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
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
|
|
|
|
|
2009-04-11 14:31:57 +00:00
|
|
|
|
#endif // !! ASSIMP_BUILD_BOOST_WORKAROUND
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-04-11 14:31:57 +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. */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-01-12 22:06:54 +00:00
|
|
|
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
# define ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
# define AI_C_THREADSAFE
|
|
|
|
|
#endif // !! ASSIMP_BUILD_SINGLETHREADED
|
|
|
|
|
|
2010-11-26 11:30:25 +00:00
|
|
|
|
#ifdef _DEBUG
|
2009-01-19 19:34:34 +00:00
|
|
|
|
# define ASSIMP_BUILD_DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-07-11 00:37:34 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/* ASSIMP_BUILD_XXXX_NNBIT_ARCHITECTURE */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
|
// See http://msdn.microsoft.com/en-us/library/b0084kay.
|
|
|
|
|
# if defined(_M_IX86)
|
|
|
|
|
# define ASSIMP_BUILD_X86_32BIT_ARCHITECTURE
|
|
|
|
|
# elif defined(_M_X64)
|
|
|
|
|
# define ASSIMP_BUILD_X86_64BIT_ARCHITECTURE
|
|
|
|
|
# elif defined(_M_IA64)
|
|
|
|
|
# define ASSIMP_BUILD_IA_64BIT_ARCHITECTURE
|
|
|
|
|
# else
|
|
|
|
|
# error unknown architecture
|
|
|
|
|
# endif
|
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
|
// See http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html.
|
|
|
|
|
# if defined(__x86_32__) || defined(__i386__)
|
|
|
|
|
# define ASSIMP_BUILD_X86_32BIT_ARCHITECTURE
|
|
|
|
|
# elif defined(__x86_64__)
|
2010-07-11 00:38:14 +00:00
|
|
|
|
# define ASSIMP_BUILD_X86_64BIT_ARCHITECTURE
|
2010-11-02 18:19:49 +00:00
|
|
|
|
# elif defined(__ppc__)
|
|
|
|
|
# define ASSIMP_BUILD_PPC_32BIT_ARCHITECTURE
|
2011-03-16 22:55:28 +00:00
|
|
|
|
# elif defined(__arm__)
|
|
|
|
|
# define ASSIMP_BUILD_ARM_32BIT_ARCHITECTURE
|
2010-07-11 00:37:34 +00:00
|
|
|
|
# else
|
2011-03-16 22:55:28 +00:00
|
|
|
|
# error "unknown architecture"
|
2010-07-11 00:37:34 +00:00
|
|
|
|
# endif
|
|
|
|
|
#else
|
|
|
|
|
# error unknown compiler
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/* Useful constants */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2009-06-20 14:49:49 +00:00
|
|
|
|
/* This is PI. Hi PI. */
|
|
|
|
|
#define AI_MATH_PI (3.141592653589793238462643383279 )
|
|
|
|
|
#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
|
|
|
|
|
#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
|
2008-08-08 15:18:28 +00:00
|
|
|
|
|
2010-02-05 22:32:19 +00:00
|
|
|
|
/* And this is to avoid endless casts to float */
|
2009-06-20 14:49:49 +00:00
|
|
|
|
#define AI_MATH_PI_F (3.1415926538f)
|
|
|
|
|
#define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f)
|
|
|
|
|
#define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
|
|
|
|
|
|
|
|
|
|
/* Tiny macro to convert from radians to degrees and back */
|
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)
|
|
|
|
|
|
2010-03-05 18:02:36 +00:00
|
|
|
|
/* Support for big-endian builds on Mac OS X. */
|
|
|
|
|
#if defined(__APPLE__) && defined(__BIG_ENDIAN__)
|
|
|
|
|
#define AI_BUILD_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-19 19:34:34 +00:00
|
|
|
|
#endif // !! INCLUDED_AI_DEFINES_H
|