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.
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
/** Assimo build configuration setup. See the notes in the comment
|
|
|
|
|
* blocks to find out how you can customize the Assimp build
|
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
#ifndef AI_DEFINES_H_INC
|
|
|
|
|
#define AI_DEFINES_H_INC
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// Define ASSIMP_BUILD_NO_XX_LOADER to disable a specific
|
|
|
|
|
// file format loader. The loader will be excluded from the
|
|
|
|
|
// build in this case. 'XX' stands for the file extension
|
|
|
|
|
// of the loader, e.g. ASSIMP_BUILD_NO_X_LOADER will disable
|
|
|
|
|
// the X loader.
|
|
|
|
|
// ************************************************************
|
|
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
|
|
|
|
|
// post-processing step. The spe will be excluded from the
|
|
|
|
|
// build in this case. 'XX' stands for the name of the loader.
|
|
|
|
|
// Name list:
|
|
|
|
|
//
|
|
|
|
|
// CALCTANGENTS
|
|
|
|
|
// JOINVERTICES
|
|
|
|
|
// CONVERTTOLH
|
|
|
|
|
// TRIANGULATE
|
|
|
|
|
// GENFACENORMALS
|
|
|
|
|
// GENVERTEXNORMALS
|
|
|
|
|
// REMOVEVC
|
|
|
|
|
// SPLITLARGEMESHES
|
|
|
|
|
// PRETRANSFORMVERTICES
|
|
|
|
|
// LIMITBONEWEIGHTS
|
|
|
|
|
// VALIDATEDS
|
|
|
|
|
// IMPROVECACHELOCALITY
|
|
|
|
|
// FIXINFACINGNORMALS
|
|
|
|
|
// REMOVE_REDUNDANTMATERIALS
|
|
|
|
|
// OPTIMIZEGRAPH
|
|
|
|
|
// SORTBYPTYPE
|
|
|
|
|
// FINDINVALIDDATA
|
|
|
|
|
// ************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// Define AI_C_THREADSAFE if you want a thread-safe C-API
|
|
|
|
|
// This feature requires boost.
|
|
|
|
|
// ************************************************************
|
|
|
|
|
|
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
// compiler specific includes and definitions
|
|
|
|
|
#if (defined _MSC_VER)
|
|
|
|
|
|
|
|
|
|
// include stdint.h from the C98 standard
|
2008-10-13 16:45:48 +00:00
|
|
|
|
# include "Compiler/pstdint.h"
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
|
# undef ASSIMP_API
|
|
|
|
|
|
2008-10-13 16:45:48 +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)
|
2008-10-13 16:45:48 +00:00
|
|
|
|
|
|
|
|
|
# if (defined ASSIMP_API)
|
|
|
|
|
# error ASSIMP_API is defined, although it shouldn't
|
|
|
|
|
# endif
|
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// 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
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
# define AI_FORCE_INLINE __forceinline
|
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
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
|
|
|
|
|
# define C_STRUCT
|
|
|
|
|
#else
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
|
|
|
|
|
// is defined by Doxygen's preprocessor. The corresponding
|
|
|
|
|
// entries in the DoxyFile look like this:
|
2008-10-13 16:45:48 +00:00
|
|
|
|
// ************************************************************
|
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
|
|
|
|
|
EXPAND_AS_DEFINED = C_STRUCT
|
|
|
|
|
SKIP_FUNCTION_MACROS = YES
|
|
|
|
|
#endif
|
|
|
|
|
// ************************************************************
|
|
|
|
|
# if (defined ASSIMP_DOXYGEN_BUILD)
|
|
|
|
|
# define C_STRUCT
|
|
|
|
|
# else
|
|
|
|
|
# define C_STRUCT struct
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-10-13 16:45:48 +00:00
|
|
|
|
#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
|
|
|
|
|
|
|
|
|
|
// for borland add the replacement pstdint.h, too
|
|
|
|
|
# include "Compiler/pstdint.h"
|
|
|
|
|
|
|
|
|
|
// "W8059 Packgr<67><72>e der Struktur ge<67>ndert"
|
|
|
|
|
// TODO: find a way to deactivate this warning automatically
|
|
|
|
|
// maybe there is a pragma to do exactly this?
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ************************************************************
|
|
|
|
|
// 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
|
|
|
|
|
// in this case.
|
|
|
|
|
// ************************************************************
|
|
|
|
|
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
|
|
|
|
|
|
|
|
|
|
// threading support in the C-API requires boost
|
|
|
|
|
# ifdef AI_C_THREADSAFE
|
|
|
|
|
# error Unable to activate C-API threading support. Boost is required for this.
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-08-08 11:48:50 +00:00
|
|
|
|
// helper macro that sets a pointer to NULL in debug builds
|
|
|
|
|
#if (!defined AI_DEBUG_INVALIDATE_PTR)
|
|
|
|
|
# if (defined _DEBUG)
|
|
|
|
|
# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
|
|
|
|
|
# else
|
|
|
|
|
# define AI_DEBUG_INVALIDATE_PTR(x)
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
2008-08-06 23:01:38 +00:00
|
|
|
|
|
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-10-13 16:45:48 +00:00
|
|
|
|
// macrod 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)
|
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
#endif // !! AI_DEFINES_H_INC
|