This commit is contained in:
napina
2020-03-23 10:35:06 +02:00
241 changed files with 22245 additions and 22373 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Public ASSIMP data structures
#include <assimp/types.h>
namespace Assimp {
namespace Assimp {
// =======================================================================
// Public interface to Assimp
class Importer;
-1
View File
@@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
+1 -1
View File
@@ -139,7 +139,7 @@ std::string DecimalToHexa( T toConvert ) {
ss >> result;
for ( size_t i = 0; i < result.size(); ++i ) {
result[ i ] = toupper( result[ i ] );
result[ i ] = (char) toupper( result[ i ] );
}
return result;
+115 -143
View File
@@ -51,11 +51,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_ANIM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/quaternion.h>
#include <assimp/types.h>
#ifdef __cplusplus
extern "C" {
@@ -63,8 +63,7 @@ extern "C" {
// ---------------------------------------------------------------------------
/** A time-value pair specifying a certain 3D vector for the given time. */
struct aiVectorKey
{
struct aiVectorKey {
/** The time of this key */
double mTime;
@@ -75,34 +74,33 @@ struct aiVectorKey
/// @brief The default constructor.
aiVectorKey() AI_NO_EXCEPT
: mTime( 0.0 )
, mValue() {
: mTime(0.0),
mValue() {
// empty
}
/// @brief Construction from a given time and key value.
aiVectorKey(double time, const aiVector3D& value)
: mTime( time )
, mValue( value ) {
aiVectorKey(double time, const aiVector3D &value) :
mTime(time), mValue(value) {
// empty
}
typedef aiVector3D elem_type;
// Comparison operators. For use with std::find();
bool operator == (const aiVectorKey& rhs) const {
bool operator==(const aiVectorKey &rhs) const {
return rhs.mValue == this->mValue;
}
bool operator != (const aiVectorKey& rhs ) const {
bool operator!=(const aiVectorKey &rhs) const {
return rhs.mValue != this->mValue;
}
// Relational operators. For use with std::sort();
bool operator < (const aiVectorKey& rhs ) const {
bool operator<(const aiVectorKey &rhs) const {
return mTime < rhs.mTime;
}
bool operator > (const aiVectorKey& rhs ) const {
bool operator>(const aiVectorKey &rhs) const {
return mTime > rhs.mTime;
}
#endif // __cplusplus
@@ -111,8 +109,7 @@ struct aiVectorKey
// ---------------------------------------------------------------------------
/** A time-value pair specifying a rotation for the given time.
* Rotations are expressed with quaternions. */
struct aiQuatKey
{
struct aiQuatKey {
/** The time of this key */
double mTime;
@@ -121,32 +118,30 @@ struct aiQuatKey
#ifdef __cplusplus
aiQuatKey() AI_NO_EXCEPT
: mTime( 0.0 )
, mValue() {
: mTime(0.0),
mValue() {
// empty
}
/** Construction from a given time and key value */
aiQuatKey(double time, const aiQuaternion& value)
: mTime (time)
, mValue (value)
{}
aiQuatKey(double time, const aiQuaternion &value) :
mTime(time), mValue(value) {}
typedef aiQuaternion elem_type;
// Comparison operators. For use with std::find();
bool operator == (const aiQuatKey& rhs ) const {
bool operator==(const aiQuatKey &rhs) const {
return rhs.mValue == this->mValue;
}
bool operator != (const aiQuatKey& rhs ) const {
bool operator!=(const aiQuatKey &rhs) const {
return rhs.mValue != this->mValue;
}
// Relational operators. For use with std::sort();
bool operator < (const aiQuatKey& rhs ) const {
bool operator<(const aiQuatKey &rhs) const {
return mTime < rhs.mTime;
}
bool operator > (const aiQuatKey& rhs ) const {
bool operator>(const aiQuatKey &rhs) const {
return mTime > rhs.mTime;
}
#endif
@@ -154,8 +149,7 @@ struct aiQuatKey
// ---------------------------------------------------------------------------
/** Binds a anim-mesh to a specific point in time. */
struct aiMeshKey
{
struct aiMeshKey {
/** The time of this key */
double mTime;
@@ -168,32 +162,29 @@ struct aiMeshKey
#ifdef __cplusplus
aiMeshKey() AI_NO_EXCEPT
: mTime(0.0)
, mValue(0)
{
: mTime(0.0),
mValue(0) {
}
/** Construction from a given time and key value */
aiMeshKey(double time, const unsigned int value)
: mTime (time)
, mValue (value)
{}
aiMeshKey(double time, const unsigned int value) :
mTime(time), mValue(value) {}
typedef unsigned int elem_type;
// Comparison operators. For use with std::find();
bool operator == (const aiMeshKey& o) const {
bool operator==(const aiMeshKey &o) const {
return o.mValue == this->mValue;
}
bool operator != (const aiMeshKey& o) const {
bool operator!=(const aiMeshKey &o) const {
return o.mValue != this->mValue;
}
// Relational operators. For use with std::sort();
bool operator < (const aiMeshKey& o) const {
bool operator<(const aiMeshKey &o) const {
return mTime < o.mTime;
}
bool operator > (const aiMeshKey& o) const {
bool operator>(const aiMeshKey &o) const {
return mTime > o.mTime;
}
@@ -202,8 +193,7 @@ struct aiMeshKey
// ---------------------------------------------------------------------------
/** Binds a morph anim mesh to a specific point in time. */
struct aiMeshMorphKey
{
struct aiMeshMorphKey {
/** The time of this key */
double mTime;
@@ -214,20 +204,17 @@ struct aiMeshMorphKey
/** The number of values and weights */
unsigned int mNumValuesAndWeights;
#ifdef __cplusplus
aiMeshMorphKey() AI_NO_EXCEPT
: mTime(0.0)
, mValues(nullptr)
, mWeights(nullptr)
, mNumValuesAndWeights(0)
{
aiMeshMorphKey() AI_NO_EXCEPT
: mTime(0.0),
mValues(nullptr),
mWeights(nullptr),
mNumValuesAndWeights(0) {
}
}
~aiMeshMorphKey()
{
~aiMeshMorphKey() {
if (mNumValuesAndWeights && mValues && mWeights) {
delete [] mValues;
delete [] mWeights;
delete[] mValues;
delete[] mWeights;
}
}
#endif
@@ -237,25 +224,24 @@ struct aiMeshMorphKey
/** Defines how an animation channel behaves outside the defined time
* range. This corresponds to aiNodeAnim::mPreState and
* aiNodeAnim::mPostState.*/
enum aiAnimBehaviour
{
enum aiAnimBehaviour {
/** The value from the default node transformation is taken*/
aiAnimBehaviour_DEFAULT = 0x0,
aiAnimBehaviour_DEFAULT = 0x0,
/** The nearest key value is used without interpolation */
aiAnimBehaviour_CONSTANT = 0x1,
/** The value of the nearest two keys is linearly
* extrapolated for the current time value.*/
aiAnimBehaviour_LINEAR = 0x2,
aiAnimBehaviour_LINEAR = 0x2,
/** The animation is repeated.
*
* If the animation key go from n to m and the current
* time is t, use the value at (t-n) % (|m-n|).*/
aiAnimBehaviour_REPEAT = 0x3,
aiAnimBehaviour_REPEAT = 0x3,
/** This value is not used, it is just here to force the
/** This value is not used, it is just here to force the
* the compiler to map this enum to a 32 Bit integer */
#ifndef SWIG
_aiAnimBehaviour_Force32Bit = INT_MAX
@@ -290,7 +276,7 @@ struct aiNodeAnim {
*
* If there are position keys, there will also be at least one
* scaling and one rotation key.*/
C_STRUCT aiVectorKey* mPositionKeys;
C_STRUCT aiVectorKey *mPositionKeys;
/** The number of rotation keys */
unsigned int mNumRotationKeys;
@@ -301,7 +287,7 @@ struct aiNodeAnim {
*
* If there are rotation keys, there will also be at least one
* scaling and one position key. */
C_STRUCT aiQuatKey* mRotationKeys;
C_STRUCT aiQuatKey *mRotationKeys;
/** The number of scaling keys */
unsigned int mNumScalingKeys;
@@ -311,7 +297,7 @@ struct aiNodeAnim {
*
* If there are scaling keys, there will also be at least one
* position and one rotation key.*/
C_STRUCT aiVectorKey* mScalingKeys;
C_STRUCT aiVectorKey *mScalingKeys;
/** Defines how the animation behaves before the first
* key is encountered.
@@ -329,21 +315,21 @@ struct aiNodeAnim {
#ifdef __cplusplus
aiNodeAnim() AI_NO_EXCEPT
: mNumPositionKeys( 0 )
, mPositionKeys( nullptr )
, mNumRotationKeys( 0 )
, mRotationKeys( nullptr )
, mNumScalingKeys( 0 )
, mScalingKeys( nullptr )
, mPreState( aiAnimBehaviour_DEFAULT )
, mPostState( aiAnimBehaviour_DEFAULT ) {
// empty
: mNumPositionKeys(0),
mPositionKeys(nullptr),
mNumRotationKeys(0),
mRotationKeys(nullptr),
mNumScalingKeys(0),
mScalingKeys(nullptr),
mPreState(aiAnimBehaviour_DEFAULT),
mPostState(aiAnimBehaviour_DEFAULT) {
// empty
}
~aiNodeAnim() {
delete [] mPositionKeys;
delete [] mRotationKeys;
delete [] mScalingKeys;
delete[] mPositionKeys;
delete[] mRotationKeys;
delete[] mScalingKeys;
}
#endif // __cplusplus
};
@@ -354,8 +340,7 @@ struct aiNodeAnim {
* aiMesh::mAnimMeshes array. The purpose of aiMeshAnim is to
* define keyframes linking each mesh attachment to a particular
* point in time. */
struct aiMeshAnim
{
struct aiMeshAnim {
/** Name of the mesh to be animated. An empty string is not allowed,
* animated meshes need to be named (not necessarily uniquely,
* the name can basically serve as wild-card to select a group
@@ -366,17 +351,15 @@ struct aiMeshAnim
unsigned int mNumKeys;
/** Key frames of the animation. May not be NULL. */
C_STRUCT aiMeshKey* mKeys;
C_STRUCT aiMeshKey *mKeys;
#ifdef __cplusplus
aiMeshAnim() AI_NO_EXCEPT
: mNumKeys()
, mKeys()
{}
: mNumKeys(),
mKeys() {}
~aiMeshAnim()
{
~aiMeshAnim() {
delete[] mKeys;
}
@@ -385,8 +368,7 @@ struct aiMeshAnim
// ---------------------------------------------------------------------------
/** Describes a morphing animation of a given mesh. */
struct aiMeshMorphAnim
{
struct aiMeshMorphAnim {
/** Name of the mesh to be animated. An empty string is not allowed,
* animated meshes need to be named (not necessarily uniquely,
* the name can basically serve as wildcard to select a group
@@ -397,17 +379,15 @@ struct aiMeshMorphAnim
unsigned int mNumKeys;
/** Key frames of the animation. May not be NULL. */
C_STRUCT aiMeshMorphKey* mKeys;
C_STRUCT aiMeshMorphKey *mKeys;
#ifdef __cplusplus
aiMeshMorphAnim() AI_NO_EXCEPT
: mNumKeys()
, mKeys()
{}
: mNumKeys(),
mKeys() {}
~aiMeshMorphAnim()
{
~aiMeshMorphAnim() {
delete[] mKeys;
}
@@ -435,8 +415,7 @@ struct aiAnimation {
/** The node animation channels. Each channel affects a single node.
* The array is mNumChannels in size. */
C_STRUCT aiNodeAnim** mChannels;
C_STRUCT aiNodeAnim **mChannels;
/** The number of mesh animation channels. Each channel affects
* a single mesh and defines vertex-based animation. */
@@ -444,7 +423,7 @@ struct aiAnimation {
/** The mesh animation channels. Each channel affects a single mesh.
* The array is mNumMeshChannels in size. */
C_STRUCT aiMeshAnim** mMeshChannels;
C_STRUCT aiMeshAnim **mMeshChannels;
/** The number of mesh animation channels. Each channel affects
* a single mesh and defines morphing animation. */
@@ -456,46 +435,45 @@ struct aiAnimation {
#ifdef __cplusplus
aiAnimation() AI_NO_EXCEPT
: mDuration(-1.)
, mTicksPerSecond(0.)
, mNumChannels(0)
, mChannels(nullptr)
, mNumMeshChannels(0)
, mMeshChannels(nullptr)
, mNumMorphMeshChannels(0)
, mMorphMeshChannels(nullptr) {
: mDuration(-1.),
mTicksPerSecond(0.),
mNumChannels(0),
mChannels(nullptr),
mNumMeshChannels(0),
mMeshChannels(nullptr),
mNumMorphMeshChannels(0),
mMorphMeshChannels(nullptr) {
// empty
}
~aiAnimation() {
// DO NOT REMOVE THIS ADDITIONAL CHECK
if ( mNumChannels && mChannels ) {
for( unsigned int a = 0; a < mNumChannels; a++) {
delete mChannels[ a ];
if (mNumChannels && mChannels) {
for (unsigned int a = 0; a < mNumChannels; a++) {
delete mChannels[a];
}
delete [] mChannels;
delete[] mChannels;
}
if (mNumMeshChannels && mMeshChannels) {
for( unsigned int a = 0; a < mNumMeshChannels; a++) {
if (mNumMeshChannels && mMeshChannels) {
for (unsigned int a = 0; a < mNumMeshChannels; a++) {
delete mMeshChannels[a];
}
delete [] mMeshChannels;
delete[] mMeshChannels;
}
if (mNumMorphMeshChannels && mMorphMeshChannels) {
for( unsigned int a = 0; a < mNumMorphMeshChannels; a++) {
delete mMorphMeshChannels[a];
}
delete [] mMorphMeshChannels;
for (unsigned int a = 0; a < mNumMorphMeshChannels; a++) {
delete mMorphMeshChannels[a];
}
delete[] mMorphMeshChannels;
}
}
#endif // __cplusplus
};
#ifdef __cplusplus
}
/// @brief Some C++ utilities for inter- and extrapolation
@@ -509,72 +487,66 @@ namespace Assimp {
* types of the arguments.
*/
template <typename T>
struct Interpolator
{
struct Interpolator {
// ------------------------------------------------------------------
/** @brief Get the result of the interpolation between a,b.
*
* The interpolation algorithm depends on the type of the operands.
* aiQuaternion's and aiQuatKey's SLERP, the rest does a simple
* linear interpolation. */
void operator () (T& out,const T& a, const T& b, ai_real d) const {
out = a + (b-a)*d;
void operator()(T &anim_out, const T &a, const T &b, ai_real d) const {
anim_out = a + (b - a) * d;
}
}; // ! Interpolator <T>
//! @cond Never
template <>
struct Interpolator <aiQuaternion> {
void operator () (aiQuaternion& out,const aiQuaternion& a,
const aiQuaternion& b, ai_real d) const
{
aiQuaternion::Interpolate(out,a,b,d);
struct Interpolator<aiQuaternion> {
void operator()(aiQuaternion &out, const aiQuaternion &a,
const aiQuaternion &b, ai_real d) const {
aiQuaternion::Interpolate(out, a, b, d);
}
}; // ! Interpolator <aiQuaternion>
template <>
struct Interpolator <unsigned int> {
void operator () (unsigned int& out,unsigned int a,
unsigned int b, ai_real d) const
{
out = d>0.5f ? b : a;
struct Interpolator<unsigned int> {
void operator()(unsigned int &out, unsigned int a,
unsigned int b, ai_real d) const {
out = d > 0.5f ? b : a;
}
}; // ! Interpolator <aiQuaternion>
template <>
struct Interpolator<aiVectorKey> {
void operator () (aiVector3D& out,const aiVectorKey& a,
const aiVectorKey& b, ai_real d) const
{
struct Interpolator<aiVectorKey> {
void operator()(aiVector3D &out, const aiVectorKey &a,
const aiVectorKey &b, ai_real d) const {
Interpolator<aiVector3D> ipl;
ipl(out,a.mValue,b.mValue,d);
ipl(out, a.mValue, b.mValue, d);
}
}; // ! Interpolator <aiVectorKey>
template <>
struct Interpolator<aiQuatKey> {
void operator () (aiQuaternion& out, const aiQuatKey& a,
const aiQuatKey& b, ai_real d) const
{
struct Interpolator<aiQuatKey> {
void operator()(aiQuaternion &out, const aiQuatKey &a,
const aiQuatKey &b, ai_real d) const {
Interpolator<aiQuaternion> ipl;
ipl(out,a.mValue,b.mValue,d);
ipl(out, a.mValue, b.mValue, d);
}
}; // ! Interpolator <aiQuatKey>
template <>
struct Interpolator<aiMeshKey> {
void operator () (unsigned int& out, const aiMeshKey& a,
const aiMeshKey& b, ai_real d) const
{
struct Interpolator<aiMeshKey> {
void operator()(unsigned int &out, const aiMeshKey &a,
const aiMeshKey &b, ai_real d) const {
Interpolator<unsigned int> ipl;
ipl(out,a.mValue,b.mValue,d);
ipl(out, a.mValue, b.mValue, d);
}
}; // ! Interpolator <aiQuatKey>
//! @endcond
} // ! end namespace Assimp
} // namespace Assimp
#endif // __cplusplus
+108 -111
View File
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_DEFINES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#pragma GCC system_header
#endif
#include <assimp/config.h>
@@ -76,21 +76,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//////////////////////////////////////////////////////////////////////////
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
# define ASSIMP_BUILD_NEED_Z_INFLATE
#define ASSIMP_BUILD_NEED_Z_INFLATE
#endif
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
# define ASSIMP_BUILD_NEED_Z_INFLATE
#define ASSIMP_BUILD_NEED_Z_INFLATE
#endif
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
# define ASSIMP_BUILD_NEED_Z_INFLATE
# define ASSIMP_BUILD_NEED_UNZIP
#define ASSIMP_BUILD_NEED_Z_INFLATE
#define ASSIMP_BUILD_NEED_UNZIP
#endif
#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
# define ASSIMP_BUILD_NEED_Z_INFLATE
# define ASSIMP_BUILD_NEED_UNZIP
#define ASSIMP_BUILD_NEED_Z_INFLATE
#define ASSIMP_BUILD_NEED_UNZIP
#endif
//////////////////////////////////////////////////////////////////////////
@@ -129,72 +129,71 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
# undef ASSIMP_API
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
//////////////////////////////////////////////////////////////////////////
# ifdef ASSIMP_BUILD_DLL_EXPORT
# define ASSIMP_API __declspec(dllexport)
# define ASSIMP_API_WINONLY __declspec(dllexport)
#undef ASSIMP_API
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
//////////////////////////////////////////////////////////////////////////
#ifdef ASSIMP_BUILD_DLL_EXPORT
#define ASSIMP_API __declspec(dllexport)
#define ASSIMP_API_WINONLY __declspec(dllexport)
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
* an external DLL under Windows. Default is static linkage. */
//////////////////////////////////////////////////////////////////////////
# elif (defined ASSIMP_DLL)
# define ASSIMP_API __declspec(dllimport)
# define ASSIMP_API_WINONLY __declspec(dllimport)
# else
# define ASSIMP_API
# define ASSIMP_API_WINONLY
# endif
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
//////////////////////////////////////////////////////////////////////////
#elif (defined ASSIMP_DLL)
#define ASSIMP_API __declspec(dllimport)
#define ASSIMP_API_WINONLY __declspec(dllimport)
#else
# define ASSIMP_API __attribute__ ((visibility("default")))
# define ASSIMP_API_WINONLY
#define ASSIMP_API
#define ASSIMP_API_WINONLY
#endif
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else
#define ASSIMP_API __attribute__((visibility("default")))
#define ASSIMP_API_WINONLY
#endif // _WIN32
#ifdef _MSC_VER
# ifdef ASSIMP_BUILD_DLL_EXPORT
# pragma warning (disable : 4251)
# endif
/* Force the compiler to inline a function, if possible
#pragma warning(disable : 4521 4512 4714 4127 4351 4510)
#ifdef ASSIMP_BUILD_DLL_EXPORT
#pragma warning(disable : 4251)
#endif
/* Force the compiler to inline a function, if possible
*/
# define AI_FORCE_INLINE __forceinline
#define AI_FORCE_INLINE __forceinline
/* Tells the compiler that a function never returns. Used in code analysis
/* Tells the compiler that a function never returns. Used in code analysis
* to skip dead paths (e.g. after an assertion evaluated to false). */
# define AI_WONT_RETURN __declspec(noreturn)
#define AI_WONT_RETURN __declspec(noreturn)
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else
# define AI_WONT_RETURN
# define AI_FORCE_INLINE inline
#define AI_WONT_RETURN
#define AI_FORCE_INLINE inline
#endif // (defined _MSC_VER)
#ifdef __GNUC__
# define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
#define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
#else
# define AI_WONT_RETURN_SUFFIX
#define AI_WONT_RETURN_SUFFIX
#endif // (defined __clang__)
#ifdef __cplusplus
/* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
/* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
* in doxydocs.
*/
# define C_STRUCT
# define C_ENUM
#define C_STRUCT
#define C_ENUM
#else
//////////////////////////////////////////////////////////////////////////
/* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
//////////////////////////////////////////////////////////////////////////
/* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
* is defined by Doxygen's preprocessor. The corresponding
* entries in the DOXYFILE are: */
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#if 0
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
@@ -206,98 +205,96 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXPAND_AS_DEFINED = C_STRUCT C_ENUM
SKIP_FUNCTION_MACROS = YES
#endif
//////////////////////////////////////////////////////////////////////////
/* Doxygen gets confused if we use c-struct typedefs to avoid
//////////////////////////////////////////////////////////////////////////
/* 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. */
//////////////////////////////////////////////////////////////////////////
# if (defined ASSIMP_DOXYGEN_BUILD)
# define C_STRUCT
# define C_ENUM
# else
# define C_STRUCT struct
# define C_ENUM enum
# endif
//////////////////////////////////////////////////////////////////////////
#if (defined ASSIMP_DOXYGEN_BUILD)
#define C_STRUCT
#define C_ENUM
#else
#define C_STRUCT struct
#define C_ENUM enum
#endif
#endif
#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
# error Currently, Borland is unsupported. Feel free to port Assimp.
#if (defined(__BORLANDC__) || defined(__BCPLUSPLUS__))
#error Currently, Borland is unsupported. Feel free to port Assimp.
#endif
//////////////////////////////////////////////////////////////////////////
/* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
//////////////////////////////////////////////////////////////////////////
/* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
* without threading support. The library doesn't utilize
* threads then and is itself not threadsafe. */
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#ifndef ASSIMP_BUILD_SINGLETHREADED
# define ASSIMP_BUILD_SINGLETHREADED
#define ASSIMP_BUILD_SINGLETHREADED
#endif
#if defined(_DEBUG) || ! defined(NDEBUG)
# define ASSIMP_BUILD_DEBUG
#if defined(_DEBUG) || !defined(NDEBUG)
#define ASSIMP_BUILD_DEBUG
#endif
//////////////////////////////////////////////////////////////////////////
/* Define ASSIMP_DOUBLE_PRECISION to compile assimp
//////////////////////////////////////////////////////////////////////////
/* Define ASSIMP_DOUBLE_PRECISION to compile assimp
* with double precision support (64-bit). */
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#ifdef ASSIMP_DOUBLE_PRECISION
typedef double ai_real;
typedef signed long long int ai_int;
typedef unsigned long long int ai_uint;
typedef double ai_real;
typedef signed long long int ai_int;
typedef unsigned long long int ai_uint;
#ifndef ASSIMP_AI_REAL_TEXT_PRECISION
#define ASSIMP_AI_REAL_TEXT_PRECISION 16
#endif // ASSIMP_AI_REAL_TEXT_PRECISION
#else // ASSIMP_DOUBLE_PRECISION
typedef float ai_real;
typedef signed int ai_int;
typedef unsigned int ai_uint;
typedef float ai_real;
typedef signed int ai_int;
typedef unsigned int ai_uint;
#ifndef ASSIMP_AI_REAL_TEXT_PRECISION
#define ASSIMP_AI_REAL_TEXT_PRECISION 8
#endif // ASSIMP_AI_REAL_TEXT_PRECISION
#endif // ASSIMP_DOUBLE_PRECISION
//////////////////////////////////////////////////////////////////////////
/* Useful constants */
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
/* Useful constants */
//////////////////////////////////////////////////////////////////////////
/* 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)
#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)
/* And this is to avoid endless casts to float */
#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)
#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 */
#define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925)
#define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795)
#define AI_DEG_TO_RAD(x) ((x) * (ai_real)0.0174532925)
#define AI_RAD_TO_DEG(x) ((x) * (ai_real)57.2957795)
/* Numerical limits */
static const ai_real ai_epsilon = (ai_real) 0.00001;
static const ai_real ai_epsilon = (ai_real)0.00001;
/* Support for big-endian builds */
#if defined(__BYTE_ORDER__)
# if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
# if !defined(__BIG_ENDIAN__)
# define __BIG_ENDIAN__
# endif
# else /* little endian */
# if defined (__BIG_ENDIAN__)
# undef __BIG_ENDIAN__
# endif
# endif
#if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#if !defined(__BIG_ENDIAN__)
#define __BIG_ENDIAN__
#endif
#else /* little endian */
#if defined(__BIG_ENDIAN__)
#undef __BIG_ENDIAN__
#endif
#endif
#endif
#if defined(__BIG_ENDIAN__)
# define AI_BUILD_BIG_ENDIAN
#define AI_BUILD_BIG_ENDIAN
#endif
/**
* To avoid running out of memory
* This can be adjusted for specific use cases
@@ -306,26 +303,26 @@ static const ai_real ai_epsilon = (ai_real) 0.00001;
#define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type))
#ifndef _MSC_VER
# if __cplusplus >= 201103L // C++11
# define AI_NO_EXCEPT noexcept
# else
# define AI_NO_EXCEPT
# endif
#if __cplusplus >= 201103L // C++11
#define AI_NO_EXCEPT noexcept
#else
# if (_MSC_VER >= 1915 )
# define AI_NO_EXCEPT noexcept
# else
# define AI_NO_EXCEPT
# endif
#define AI_NO_EXCEPT
#endif
#else
#if (_MSC_VER >= 1915)
#define AI_NO_EXCEPT noexcept
#else
#define AI_NO_EXCEPT
#endif
#endif // _MSC_VER
/**
* Helper macro to set a pointer to NULL in debug builds
*/
#if (defined ASSIMP_BUILD_DEBUG)
# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
#define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
#else
# define AI_DEBUG_INVALIDATE_PTR(x)
#define AI_DEBUG_INVALIDATE_PTR(x)
#endif
#endif // !! AI_DEFINES_H_INC
+2 -2
View File
@@ -58,6 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
template <typename T> class aiMatrix4x4t;
template <typename T> class aiVector2t;
template <typename T> class aiVector3t;
// ---------------------------------------------------------------------------
/** @brief Represents a row-major 3x3 matrix
@@ -136,8 +137,7 @@ public:
* @param axis Axis to rotate around
* @param out To be filled
*/
static aiMatrix3x3t& Rotation( TReal a,
const aiVector3t<TReal>& axis, aiMatrix3x3t& out);
static aiMatrix3x3t& Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t& out);
// -------------------------------------------------------------------
/** @brief Returns a translation matrix
-2
View File
@@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
+146 -170
View File
@@ -49,11 +49,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_MESH_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#pragma GCC system_header
#endif
#include <assimp/types.h>
#ifdef _WIN32
#pragma warning(disable : 4351)
#endif // _WIN32
#include <assimp/aabb.h>
#include <assimp/types.h>
#ifdef __cplusplus
extern "C" {
@@ -69,42 +73,42 @@ extern "C" {
* Maximum number of indices per face (polygon). */
#ifndef AI_MAX_FACE_INDICES
# define AI_MAX_FACE_INDICES 0x7fff
#define AI_MAX_FACE_INDICES 0x7fff
#endif
/** @def AI_MAX_BONE_WEIGHTS
* Maximum number of indices per face (polygon). */
#ifndef AI_MAX_BONE_WEIGHTS
# define AI_MAX_BONE_WEIGHTS 0x7fffffff
#define AI_MAX_BONE_WEIGHTS 0x7fffffff
#endif
/** @def AI_MAX_VERTICES
* Maximum number of vertices per mesh. */
#ifndef AI_MAX_VERTICES
# define AI_MAX_VERTICES 0x7fffffff
#define AI_MAX_VERTICES 0x7fffffff
#endif
/** @def AI_MAX_FACES
* Maximum number of faces per mesh. */
#ifndef AI_MAX_FACES
# define AI_MAX_FACES 0x7fffffff
#define AI_MAX_FACES 0x7fffffff
#endif
/** @def AI_MAX_NUMBER_OF_COLOR_SETS
* Supported number of vertex color sets per mesh. */
#ifndef AI_MAX_NUMBER_OF_COLOR_SETS
# define AI_MAX_NUMBER_OF_COLOR_SETS 0x8
#define AI_MAX_NUMBER_OF_COLOR_SETS 0x8
#endif // !! AI_MAX_NUMBER_OF_COLOR_SETS
/** @def AI_MAX_NUMBER_OF_TEXTURECOORDS
* Supported number of texture coord sets (UV(W) channels) per mesh */
#ifndef AI_MAX_NUMBER_OF_TEXTURECOORDS
# define AI_MAX_NUMBER_OF_TEXTURECOORDS 0x8
#define AI_MAX_NUMBER_OF_TEXTURECOORDS 0x8
#endif // !! AI_MAX_NUMBER_OF_TEXTURECOORDS
// ---------------------------------------------------------------------------
@@ -129,39 +133,36 @@ extern "C" {
* @note Take a look at the @link data Data Structures page @endlink for
* more information on the layout and winding order of a face.
*/
struct aiFace
{
struct aiFace {
//! Number of indices defining this face.
//! The maximum value for this member is #AI_MAX_FACE_INDICES.
unsigned int mNumIndices;
//! Pointer to the indices array. Size of the array is given in numIndices.
unsigned int* mIndices;
unsigned int *mIndices;
#ifdef __cplusplus
//! Default constructor
aiFace() AI_NO_EXCEPT
: mNumIndices( 0 )
, mIndices( nullptr ) {
: mNumIndices(0),
mIndices(nullptr) {
// empty
}
//! Default destructor. Delete the index array
~aiFace()
{
delete [] mIndices;
~aiFace() {
delete[] mIndices;
}
//! Copy constructor. Copy the index array
aiFace( const aiFace& o)
: mNumIndices(0)
, mIndices( nullptr ) {
aiFace(const aiFace &o) :
mNumIndices(0), mIndices(nullptr) {
*this = o;
}
//! Assignment operator. Copy the index array
aiFace& operator = ( const aiFace& o) {
aiFace &operator=(const aiFace &o) {
if (&o == this) {
return *this;
}
@@ -170,7 +171,7 @@ struct aiFace
mNumIndices = o.mNumIndices;
if (mNumIndices) {
mIndices = new unsigned int[mNumIndices];
::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
::memcpy(mIndices, o.mIndices, mNumIndices * sizeof(unsigned int));
} else {
mIndices = nullptr;
}
@@ -180,7 +181,7 @@ struct aiFace
//! Comparison operator. Checks whether the index array
//! of two faces is identical
bool operator== (const aiFace& o) const {
bool operator==(const aiFace &o) const {
if (mIndices == o.mIndices) {
return true;
}
@@ -204,13 +205,12 @@ struct aiFace
//! Inverse comparison operator. Checks whether the index
//! array of two faces is NOT identical
bool operator != (const aiFace& o) const {
bool operator!=(const aiFace &o) const {
return !(*this == o);
}
#endif // __cplusplus
}; // struct aiFace
// ---------------------------------------------------------------------------
/** @brief A single influence of a bone on a vertex.
*/
@@ -220,38 +220,36 @@ struct aiVertexWeight {
//! The strength of the influence in the range (0...1).
//! The influence from all bones at one vertex amounts to 1.
float mWeight;
ai_real mWeight;
#ifdef __cplusplus
//! Default constructor
aiVertexWeight() AI_NO_EXCEPT
: mVertexId(0)
, mWeight(0.0f) {
: mVertexId(0),
mWeight(0.0f) {
// empty
}
//! Initialization from a given index and vertex weight factor
//! \param pID ID
//! \param pWeight Vertex weight factor
aiVertexWeight( unsigned int pID, float pWeight )
: mVertexId( pID )
, mWeight( pWeight ) {
aiVertexWeight(unsigned int pID, float pWeight) :
mVertexId(pID), mWeight(pWeight) {
// empty
}
bool operator == ( const aiVertexWeight &rhs ) const {
return ( mVertexId == rhs.mVertexId && mWeight == rhs.mWeight );
bool operator==(const aiVertexWeight &rhs) const {
return (mVertexId == rhs.mVertexId && mWeight == rhs.mWeight);
}
bool operator != ( const aiVertexWeight &rhs ) const {
return ( *this == rhs );
bool operator!=(const aiVertexWeight &rhs) const {
return (*this == rhs);
}
#endif // __cplusplus
};
// Forward declare aiNode (pointer use only)
struct aiNode;
@@ -274,15 +272,15 @@ struct aiBone {
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
// The bone armature node - used for skeleton conversion
// you must enable aiProcess_PopulateArmatureData to populate this
C_STRUCT aiNode* mArmature;
C_STRUCT aiNode *mArmature;
// The bone node in the scene - used for skeleton conversion
// you must enable aiProcess_PopulateArmatureData to populate this
C_STRUCT aiNode* mNode;
C_STRUCT aiNode *mNode;
#endif
//! The influence weights of this bone, by vertex index.
C_STRUCT aiVertexWeight* mWeights;
C_STRUCT aiVertexWeight *mWeights;
/** Matrix that transforms from bone space to mesh space in bind pose.
*
@@ -301,56 +299,51 @@ struct aiBone {
//! Default constructor
aiBone() AI_NO_EXCEPT
: mName()
, mNumWeights( 0 )
, mWeights( nullptr )
, mOffsetMatrix() {
: mName(),
mNumWeights(0),
mWeights(nullptr),
mOffsetMatrix() {
// empty
}
//! Copy constructor
aiBone(const aiBone& other)
: mName( other.mName )
, mNumWeights( other.mNumWeights )
, mWeights(nullptr)
, mOffsetMatrix( other.mOffsetMatrix ) {
aiBone(const aiBone &other) :
mName(other.mName), mNumWeights(other.mNumWeights), mWeights(nullptr), mOffsetMatrix(other.mOffsetMatrix) {
if (other.mWeights && other.mNumWeights) {
mWeights = new aiVertexWeight[mNumWeights];
::memcpy(mWeights,other.mWeights,mNumWeights * sizeof(aiVertexWeight));
::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight));
}
}
//! Assignment operator
aiBone &operator=(const aiBone& other) {
aiBone &operator=(const aiBone &other) {
if (this == &other) {
return *this;
}
mName = other.mName;
mNumWeights = other.mNumWeights;
mName = other.mName;
mNumWeights = other.mNumWeights;
mOffsetMatrix = other.mOffsetMatrix;
if (other.mWeights && other.mNumWeights)
{
if (other.mWeights && other.mNumWeights) {
if (mWeights) {
delete[] mWeights;
}
mWeights = new aiVertexWeight[mNumWeights];
::memcpy(mWeights,other.mWeights,mNumWeights * sizeof(aiVertexWeight));
::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight));
}
return *this;
}
bool operator == ( const aiBone &rhs ) const {
if ( mName != rhs.mName || mNumWeights != rhs.mNumWeights ) {
bool operator==(const aiBone &rhs) const {
if (mName != rhs.mName || mNumWeights != rhs.mNumWeights) {
return false;
}
for ( size_t i = 0; i < mNumWeights; ++i ) {
if ( mWeights[ i ] != rhs.mWeights[ i ] ) {
for (size_t i = 0; i < mNumWeights; ++i) {
if (mWeights[i] != rhs.mWeights[i]) {
return false;
}
}
@@ -359,12 +352,11 @@ struct aiBone {
}
//! Destructor - deletes the array of vertex weights
~aiBone() {
delete [] mWeights;
delete[] mWeights;
}
#endif // __cplusplus
};
// ---------------------------------------------------------------------------
/** @brief Enumerates the types of geometric primitives supported by Assimp.
*
@@ -373,27 +365,26 @@ struct aiBone {
* @see aiProcess_Triangulate Automatic triangulation
* @see AI_CONFIG_PP_SBP_REMOVE Removal of specific primitive types.
*/
enum aiPrimitiveType
{
enum aiPrimitiveType {
/** A point primitive.
*
* This is just a single vertex in the virtual world,
* #aiFace contains just one index for such a primitive.
*/
aiPrimitiveType_POINT = 0x1,
aiPrimitiveType_POINT = 0x1,
/** A line primitive.
*
* This is a line defined through a start and an end position.
* #aiFace contains exactly two indices for such a primitive.
*/
aiPrimitiveType_LINE = 0x2,
aiPrimitiveType_LINE = 0x2,
/** A triangular primitive.
*
* A triangle consists of three indices.
*/
aiPrimitiveType_TRIANGLE = 0x4,
aiPrimitiveType_TRIANGLE = 0x4,
/** A higher-level polygon with more than 3 edges.
*
@@ -402,10 +393,9 @@ enum aiPrimitiveType
* is provided for your convenience, it splits all polygons in
* triangles (which are much easier to handle).
*/
aiPrimitiveType_POLYGON = 0x8,
aiPrimitiveType_POLYGON = 0x8,
/** This value is not used. It is just here to force the
/** This value is not used. It is just here to force the
* compiler to map this enum to a 32 Bit integer.
*/
#ifndef SWIG
@@ -417,8 +407,6 @@ enum aiPrimitiveType
#define AI_PRIMITIVE_TYPE_FOR_N_INDICES(n) \
((n) > 3 ? aiPrimitiveType_POLYGON : (aiPrimitiveType)(1u << ((n)-1)))
// ---------------------------------------------------------------------------
/** @brief An AnimMesh is an attachment to an #aiMesh stores per-vertex
* animations for a particular frame.
@@ -430,8 +418,7 @@ enum aiPrimitiveType
* established by #aiMeshAnim, which references singular mesh attachments
* by their ID and binds them to a time offset.
*/
struct aiAnimMesh
{
struct aiAnimMesh {
/**Anim Mesh name */
C_STRUCT aiString mName;
@@ -441,22 +428,22 @@ struct aiAnimMesh
* meshes may neither add or nor remove vertex components (if
* a replacement array is nullptr and the corresponding source
* array is not, the source data is taken instead)*/
C_STRUCT aiVector3D* mVertices;
C_STRUCT aiVector3D *mVertices;
/** Replacement for aiMesh::mNormals. */
C_STRUCT aiVector3D* mNormals;
C_STRUCT aiVector3D *mNormals;
/** Replacement for aiMesh::mTangents. */
C_STRUCT aiVector3D* mTangents;
C_STRUCT aiVector3D *mTangents;
/** Replacement for aiMesh::mBitangents. */
C_STRUCT aiVector3D* mBitangents;
C_STRUCT aiVector3D *mBitangents;
/** Replacement for aiMesh::mColors */
C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
C_STRUCT aiColor4D *mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
/** Replacement for aiMesh::mTextureCoords */
C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
C_STRUCT aiVector3D *mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
/** The number of vertices in the aiAnimMesh, and thus the length of all
* the member arrays.
@@ -467,7 +454,7 @@ struct aiAnimMesh
* from language bindings.
*/
unsigned int mNumVertices;
/**
* Weight of the AnimMesh.
*/
@@ -476,35 +463,33 @@ struct aiAnimMesh
#ifdef __cplusplus
aiAnimMesh() AI_NO_EXCEPT
: mVertices( nullptr )
, mNormals(nullptr)
, mTangents(nullptr)
, mBitangents(nullptr)
, mColors()
, mTextureCoords()
, mNumVertices( 0 )
, mWeight( 0.0f )
{
: mVertices(nullptr),
mNormals(nullptr),
mTangents(nullptr),
mBitangents(nullptr),
mColors(),
mTextureCoords(),
mNumVertices(0),
mWeight(0.0f) {
// fixme consider moving this to the ctor initializer list as well
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++){
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
mTextureCoords[a] = nullptr;
}
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
mColors[a] = nullptr;
}
}
~aiAnimMesh()
{
delete [] mVertices;
delete [] mNormals;
delete [] mTangents;
delete [] mBitangents;
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
delete [] mTextureCoords[a];
~aiAnimMesh() {
delete[] mVertices;
delete[] mNormals;
delete[] mTangents;
delete[] mBitangents;
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
delete[] mTextureCoords[a];
}
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
delete [] mColors[a];
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
delete[] mColors[a];
}
}
@@ -530,14 +515,14 @@ struct aiAnimMesh
/** Check whether the anim mesh overrides a particular
* set of vertex colors on his host mesh.
* @param pIndex 0<index<AI_MAX_NUMBER_OF_COLOR_SETS */
bool HasVertexColors( unsigned int pIndex) const {
bool HasVertexColors(unsigned int pIndex) const {
return pIndex >= AI_MAX_NUMBER_OF_COLOR_SETS ? false : mColors[pIndex] != nullptr;
}
/** Check whether the anim mesh overrides a particular
* set of texture coordinates on his host mesh.
* @param pIndex 0<index<AI_MAX_NUMBER_OF_TEXTURECOORDS */
bool HasTextureCoords( unsigned int pIndex) const {
bool HasTextureCoords(unsigned int pIndex) const {
return pIndex >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? false : mTextureCoords[pIndex] != nullptr;
}
@@ -547,18 +532,17 @@ struct aiAnimMesh
// ---------------------------------------------------------------------------
/** @brief Enumerates the methods of mesh morphing supported by Assimp.
*/
enum aiMorphingMethod
{
enum aiMorphingMethod {
/** Interpolation between morph targets */
aiMorphingMethod_VERTEX_BLEND = 0x1,
aiMorphingMethod_VERTEX_BLEND = 0x1,
/** Normalized morphing between morph targets */
aiMorphingMethod_MORPH_NORMALIZED = 0x2,
aiMorphingMethod_MORPH_NORMALIZED = 0x2,
/** Relative morphing between morph targets */
aiMorphingMethod_MORPH_RELATIVE = 0x3,
aiMorphingMethod_MORPH_RELATIVE = 0x3,
/** This value is not used. It is just here to force the
/** This value is not used. It is just here to force the
* compiler to map this enum to a 32 Bit integer.
*/
#ifndef SWIG
@@ -585,8 +569,7 @@ enum aiMorphingMethod
* aiScene::mFlags
* @endcode
*/
struct aiMesh
{
struct aiMesh {
/** Bitwise combination of the members of the #aiPrimitiveType enum.
* This specifies which types of primitives are present in the mesh.
* The "SortByPrimitiveType"-Step can be used to make sure the
@@ -610,7 +593,7 @@ struct aiMesh
* This array is always present in a mesh. The array is
* mNumVertices in size.
*/
C_STRUCT aiVector3D* mVertices;
C_STRUCT aiVector3D *mVertices;
/** Vertex normals.
* The array contains normalized vectors, nullptr if not present.
@@ -632,7 +615,7 @@ struct aiMesh
* However, this needn't apply for normals that have been taken
* directly from the model file.
*/
C_STRUCT aiVector3D* mNormals;
C_STRUCT aiVector3D *mNormals;
/** Vertex tangents.
* The tangent of a vertex points in the direction of the positive
@@ -646,7 +629,7 @@ struct aiMesh
* @note If the mesh contains tangents, it automatically also
* contains bitangents.
*/
C_STRUCT aiVector3D* mTangents;
C_STRUCT aiVector3D *mTangents;
/** Vertex bitangents.
* The bitangent of a vertex points in the direction of the positive
@@ -655,20 +638,20 @@ struct aiMesh
* @note If the mesh contains tangents, it automatically also contains
* bitangents.
*/
C_STRUCT aiVector3D* mBitangents;
C_STRUCT aiVector3D *mBitangents;
/** Vertex color sets.
* A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex
* colors per vertex. nullptr if not present. Each array is
* mNumVertices in size if present.
*/
C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
C_STRUCT aiColor4D *mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
/** Vertex texture coords, also known as UV channels.
* A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per
* vertex. nullptr if not present. The array is mNumVertices in size.
*/
C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
C_STRUCT aiVector3D *mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
/** Specifies the number of components for a given UV channel.
* Up to three channels are supported (UVW, for accessing volume
@@ -685,7 +668,7 @@ struct aiMesh
* in mNumFaces. If the #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
* is NOT set each face references an unique set of vertices.
*/
C_STRUCT aiFace* mFaces;
C_STRUCT aiFace *mFaces;
/** The number of bones this mesh contains.
* Can be 0, in which case the mBones array is nullptr.
@@ -696,7 +679,7 @@ struct aiMesh
* A bone consists of a name by which it can be found in the
* frame hierarchy and a set of vertex weights.
*/
C_STRUCT aiBone** mBones;
C_STRUCT aiBone **mBones;
/** The material used by this mesh.
* A mesh uses only a single material. If an imported model uses
@@ -718,7 +701,6 @@ struct aiMesh
**/
C_STRUCT aiString mName;
/** The number of attachment meshes. Note! Currently only works with Collada loader. */
unsigned int mNumAnimMeshes;
@@ -726,7 +708,7 @@ struct aiMesh
* Attachment meshes carry replacement data for some of the
* mesh'es vertex components (usually positions, normals).
* Note! Currently only works with Collada loader.*/
C_STRUCT aiAnimMesh** mAnimMeshes;
C_STRUCT aiAnimMesh **mAnimMeshes;
/**
* Method of morphing when animeshes are specified.
@@ -737,30 +719,30 @@ struct aiMesh
*
*/
C_STRUCT aiAABB mAABB;
#ifdef __cplusplus
//! Default constructor. Initializes all members to 0
aiMesh() AI_NO_EXCEPT
: mPrimitiveTypes( 0 )
, mNumVertices( 0 )
, mNumFaces( 0 )
, mVertices( nullptr )
, mNormals(nullptr)
, mTangents(nullptr)
, mBitangents(nullptr)
, mColors()
, mTextureCoords()
, mNumUVComponents()
, mFaces(nullptr)
, mNumBones( 0 )
, mBones(nullptr)
, mMaterialIndex( 0 )
, mNumAnimMeshes( 0 )
, mAnimMeshes(nullptr)
, mMethod( 0 )
, mAABB() {
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) {
: mPrimitiveTypes(0),
mNumVertices(0),
mNumFaces(0),
mVertices(nullptr),
mNormals(nullptr),
mTangents(nullptr),
mBitangents(nullptr),
mColors(),
mTextureCoords(),
mNumUVComponents(),
mFaces(nullptr),
mNumBones(0),
mBones(nullptr),
mMaterialIndex(0),
mNumAnimMeshes(0),
mAnimMeshes(nullptr),
mMethod(0),
mAABB() {
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) {
mNumUVComponents[a] = 0;
mTextureCoords[a] = nullptr;
}
@@ -772,62 +754,57 @@ struct aiMesh
//! Deletes all storage allocated for the mesh
~aiMesh() {
delete [] mVertices;
delete [] mNormals;
delete [] mTangents;
delete [] mBitangents;
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
delete [] mTextureCoords[a];
delete[] mVertices;
delete[] mNormals;
delete[] mTangents;
delete[] mBitangents;
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
delete[] mTextureCoords[a];
}
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
delete [] mColors[a];
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
delete[] mColors[a];
}
// DO NOT REMOVE THIS ADDITIONAL CHECK
if (mNumBones && mBones) {
for( unsigned int a = 0; a < mNumBones; a++) {
if(mBones[a])
{
if (mNumBones && mBones) {
for (unsigned int a = 0; a < mNumBones; a++) {
if (mBones[a]) {
delete mBones[a];
}
}
delete [] mBones;
delete[] mBones;
}
if (mNumAnimMeshes && mAnimMeshes) {
for( unsigned int a = 0; a < mNumAnimMeshes; a++) {
if (mNumAnimMeshes && mAnimMeshes) {
for (unsigned int a = 0; a < mNumAnimMeshes; a++) {
delete mAnimMeshes[a];
}
delete [] mAnimMeshes;
delete[] mAnimMeshes;
}
delete [] mFaces;
delete[] mFaces;
}
//! Check whether the mesh contains positions. Provided no special
//! scene flags are set, this will always be true
bool HasPositions() const
{ return mVertices != nullptr && mNumVertices > 0; }
bool HasPositions() const { return mVertices != nullptr && mNumVertices > 0; }
//! Check whether the mesh contains faces. If no special scene flags
//! are set this should always return true
bool HasFaces() const
{ return mFaces != nullptr && mNumFaces > 0; }
bool HasFaces() const { return mFaces != nullptr && mNumFaces > 0; }
//! Check whether the mesh contains normal vectors
bool HasNormals() const
{ return mNormals != nullptr && mNumVertices > 0; }
bool HasNormals() const { return mNormals != nullptr && mNumVertices > 0; }
//! Check whether the mesh contains tangent and bitangent vectors
//! It is not possible that it contains tangents and no bitangents
//! (or the other way round). The existence of one of them
//! implies that the second is there, too.
bool HasTangentsAndBitangents() const
{ return mTangents != nullptr && mBitangents != nullptr && mNumVertices > 0; }
bool HasTangentsAndBitangents() const { return mTangents != nullptr && mBitangents != nullptr && mNumVertices > 0; }
//! Check whether the mesh contains a vertex color set
//! \param pIndex Index of the vertex color set
bool HasVertexColors( unsigned int pIndex) const {
bool HasVertexColors(unsigned int pIndex) const {
if (pIndex >= AI_MAX_NUMBER_OF_COLOR_SETS) {
return false;
} else {
@@ -837,7 +814,7 @@ struct aiMesh
//! Check whether the mesh contains a texture coordinate set
//! \param pIndex Index of the texture coordinates set
bool HasTextureCoords( unsigned int pIndex) const {
bool HasTextureCoords(unsigned int pIndex) const {
if (pIndex >= AI_MAX_NUMBER_OF_TEXTURECOORDS) {
return false;
} else {
@@ -847,7 +824,7 @@ struct aiMesh
//! Get the number of UV channels the mesh contains
unsigned int GetNumUVChannels() const {
unsigned int n( 0 );
unsigned int n(0);
while (n < AI_MAX_NUMBER_OF_TEXTURECOORDS && mTextureCoords[n]) {
++n;
}
@@ -876,4 +853,3 @@ struct aiMesh
}
#endif //! extern "C"
#endif // AI_MESH_H_INC
+132 -141
View File
@@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@@ -49,40 +47,41 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_TYPES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#pragma GCC system_header
#endif
// Some runtime headers
#include <sys/types.h>
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
// Our compile configuration
#include <assimp/defs.h>
// Some types moved to separate header due to size of operators
#include <assimp/vector3.h>
#include <assimp/vector2.h>
#include <assimp/vector3.h>
#include <assimp/color4.h>
#include <assimp/matrix3x3.h>
#include <assimp/matrix4x4.h>
#include <assimp/quaternion.h>
typedef int32_t ai_int32;
typedef uint32_t ai_uint32 ;
typedef uint32_t ai_uint32;
#ifdef __cplusplus
#include <cstring>
#include <new> // for std::nothrow_t
#include <string> // for aiString::Set(const std::string&)
namespace Assimp {
#include <cstring>
#include <new> // for std::nothrow_t
#include <string> // for aiString::Set(const std::string&)
namespace Assimp {
//! @cond never
namespace Intern {
// --------------------------------------------------------------------
/** @brief Internal helper class to utilize our internal new/delete
namespace Intern {
// --------------------------------------------------------------------
/** @brief Internal helper class to utilize our internal new/delete
* routines for allocating object of this and derived classes.
*
* By doing this you can safely share class objects between Assimp
@@ -93,25 +92,25 @@ namespace Intern {
* If it lies on a different heap than Assimp is working with,
* the application is determined to crash.
*/
// --------------------------------------------------------------------
// --------------------------------------------------------------------
#ifndef SWIG
struct ASSIMP_API AllocateFromAssimpHeap {
// http://www.gotw.ca/publications/mill15.htm
struct ASSIMP_API AllocateFromAssimpHeap {
// http://www.gotw.ca/publications/mill15.htm
// new/delete overload
void *operator new ( size_t num_bytes) /* throw( std::bad_alloc ) */;
void *operator new ( size_t num_bytes, const std::nothrow_t& ) throw();
void operator delete ( void* data);
// new/delete overload
void *operator new(size_t num_bytes) /* throw( std::bad_alloc ) */;
void *operator new(size_t num_bytes, const std::nothrow_t &) throw();
void operator delete(void *data);
// array new/delete overload
void *operator new[] ( size_t num_bytes) /* throw( std::bad_alloc ) */;
void *operator new[] ( size_t num_bytes, const std::nothrow_t& ) throw();
void operator delete[] ( void* data);
// array new/delete overload
void *operator new[](size_t num_bytes) /* throw( std::bad_alloc ) */;
void *operator new[](size_t num_bytes, const std::nothrow_t &) throw();
void operator delete[](void *data);
}; // struct AllocateFromAssimpHeap
}; // struct AllocateFromAssimpHeap
#endif
} // namespace Intern
//! @endcond
//! @endcond
} // namespace Assimp
extern "C" {
@@ -119,9 +118,9 @@ extern "C" {
/** Maximum dimension for strings, ASSIMP strings are zero terminated. */
#ifdef __cplusplus
static const size_t MAXLEN = 1024;
static const size_t MAXLEN = 1024;
#else
# define MAXLEN 1024
#define MAXLEN 1024
#endif
// ----------------------------------------------------------------------------------
@@ -129,16 +128,17 @@ extern "C" {
*/
struct aiPlane {
#ifdef __cplusplus
aiPlane () AI_NO_EXCEPT : a(0.f), b(0.f), c(0.f), d(0.f) {}
aiPlane (ai_real _a, ai_real _b, ai_real _c, ai_real _d)
: a(_a), b(_b), c(_c), d(_d) {}
aiPlane() AI_NO_EXCEPT : a(0.f), b(0.f), c(0.f), d(0.f) {}
aiPlane(ai_real _a, ai_real _b, ai_real _c, ai_real _d) :
a(_a), b(_b), c(_c), d(_d) {}
aiPlane (const aiPlane& o) : a(o.a), b(o.b), c(o.c), d(o.d) {}
aiPlane(const aiPlane &o) :
a(o.a), b(o.b), c(o.c), d(o.d) {}
#endif // !__cplusplus
//! Plane equation
ai_real a,b,c,d;
ai_real a, b, c, d;
}; // !struct aiPlane
// ----------------------------------------------------------------------------------
@@ -146,11 +146,12 @@ struct aiPlane {
*/
struct aiRay {
#ifdef __cplusplus
aiRay () AI_NO_EXCEPT {}
aiRay (const aiVector3D& _pos, const aiVector3D& _dir)
: pos(_pos), dir(_dir) {}
aiRay() AI_NO_EXCEPT {}
aiRay(const aiVector3D &_pos, const aiVector3D &_dir) :
pos(_pos), dir(_dir) {}
aiRay (const aiRay& o) : pos (o.pos), dir (o.dir) {}
aiRay(const aiRay &o) :
pos(o.pos), dir(o.dir) {}
#endif // !__cplusplus
@@ -161,55 +162,55 @@ struct aiRay {
// ----------------------------------------------------------------------------------
/** Represents a color in Red-Green-Blue space.
*/
struct aiColor3D
{
struct aiColor3D {
#ifdef __cplusplus
aiColor3D () AI_NO_EXCEPT : r(0.0f), g(0.0f), b(0.0f) {}
aiColor3D (ai_real _r, ai_real _g, ai_real _b) : r(_r), g(_g), b(_b) {}
explicit aiColor3D (ai_real _r) : r(_r), g(_r), b(_r) {}
aiColor3D (const aiColor3D& o) : r(o.r), g(o.g), b(o.b) {}
aiColor3D() AI_NO_EXCEPT : r(0.0f), g(0.0f), b(0.0f) {}
aiColor3D(ai_real _r, ai_real _g, ai_real _b) :
r(_r), g(_g), b(_b) {}
explicit aiColor3D(ai_real _r) :
r(_r), g(_r), b(_r) {}
aiColor3D(const aiColor3D &o) :
r(o.r), g(o.g), b(o.b) {}
aiColor3D &operator=(const aiColor3D &o) {
r = o.r;
g = o.g;
b = o.b;
return *this;
}
/** Component-wise comparison */
// TODO: add epsilon?
bool operator == (const aiColor3D& other) const
{return r == other.r && g == other.g && b == other.b;}
/** Component-wise inverse comparison */
// TODO: add epsilon?
bool operator != (const aiColor3D& other) const
{return r != other.r || g != other.g || b != other.b;}
aiColor3D &operator=(const aiColor3D &o) {
r = o.r;
g = o.g;
b = o.b;
return *this;
}
/** Component-wise comparison */
// TODO: add epsilon?
bool operator < (const aiColor3D& other) const {
return r < other.r || ( r == other.r && (g < other.g || (g == other.g && b < other.b ) ) );
bool operator==(const aiColor3D &other) const { return r == other.r && g == other.g && b == other.b; }
/** Component-wise inverse comparison */
// TODO: add epsilon?
bool operator!=(const aiColor3D &other) const { return r != other.r || g != other.g || b != other.b; }
/** Component-wise comparison */
// TODO: add epsilon?
bool operator<(const aiColor3D &other) const {
return r < other.r || (r == other.r && (g < other.g || (g == other.g && b < other.b)));
}
/** Component-wise addition */
aiColor3D operator+(const aiColor3D& c) const {
return aiColor3D(r+c.r,g+c.g,b+c.b);
aiColor3D operator+(const aiColor3D &c) const {
return aiColor3D(r + c.r, g + c.g, b + c.b);
}
/** Component-wise subtraction */
aiColor3D operator-(const aiColor3D& c) const {
return aiColor3D(r-c.r,g-c.g,b-c.b);
aiColor3D operator-(const aiColor3D &c) const {
return aiColor3D(r - c.r, g - c.g, b - c.b);
}
/** Component-wise multiplication */
aiColor3D operator*(const aiColor3D& c) const {
return aiColor3D(r*c.r,g*c.g,b*c.b);
aiColor3D operator*(const aiColor3D &c) const {
return aiColor3D(r * c.r, g * c.g, b * c.b);
}
/** Multiply with a scalar */
aiColor3D operator*(ai_real f) const {
return aiColor3D(r*f,g*f,b*f);
return aiColor3D(r * f, g * f, b * f);
}
/** Access a specific color component */
@@ -218,12 +219,12 @@ struct aiColor3D
}
/** Access a specific color component */
ai_real& operator[](unsigned int i) {
if ( 0 == i ) {
ai_real &operator[](unsigned int i) {
if (0 == i) {
return r;
} else if ( 1 == i ) {
} else if (1 == i) {
return g;
} else if ( 2 == i ) {
} else if (2 == i) {
return b;
}
return r;
@@ -232,14 +233,14 @@ struct aiColor3D
/** Check whether a color is black */
bool IsBlack() const {
static const ai_real epsilon = ai_real(10e-3);
return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;
return std::fabs(r) < epsilon && std::fabs(g) < epsilon && std::fabs(b) < epsilon;
}
#endif // !__cplusplus
//! Red, green and blue color values
ai_real r, g, b;
}; // !struct aiColor3D
}; // !struct aiColor3D
// ----------------------------------------------------------------------------------
/** Represents an UTF-8 string, zero byte terminated.
@@ -262,99 +263,95 @@ struct aiColor3D
* (binary) length of such a string is limited to MAXLEN characters (including the
* the terminating zero).
*/
struct aiString
{
struct aiString {
#ifdef __cplusplus
/** Default constructor, the string is set to have zero length */
aiString() AI_NO_EXCEPT
: length( 0 ) {
: length(0) {
data[0] = '\0';
#ifdef ASSIMP_BUILD_DEBUG
// Debug build: overwrite the string on its full length with ESC (27)
memset(data+1,27,MAXLEN-1);
memset(data + 1, 27, MAXLEN - 1);
#endif
}
/** Copy constructor */
aiString(const aiString& rOther)
: length(rOther.length)
{
aiString(const aiString &rOther) :
length(rOther.length) {
// Crop the string to the maximum length
length = length>=MAXLEN?MAXLEN-1:length;
memcpy( data, rOther.data, length);
length = length >= MAXLEN ? MAXLEN - 1 : length;
memcpy(data, rOther.data, length);
data[length] = '\0';
}
/** Constructor from std::string */
explicit aiString(const std::string& pString) :
length( (ai_uint32) pString.length())
{
length = length>=MAXLEN?MAXLEN-1:length;
memcpy( data, pString.c_str(), length);
explicit aiString(const std::string &pString) :
length((ai_uint32)pString.length()) {
length = length >= MAXLEN ? MAXLEN - 1 : length;
memcpy(data, pString.c_str(), length);
data[length] = '\0';
}
/** Copy a std::string to the aiString */
void Set( const std::string& pString) {
if( pString.length() > MAXLEN - 1) {
void Set(const std::string &pString) {
if (pString.length() > MAXLEN - 1) {
return;
}
length = (ai_uint32)pString.length();
memcpy( data, pString.c_str(), length);
memcpy(data, pString.c_str(), length);
data[length] = 0;
}
/** Copy a const char* to the aiString */
void Set( const char* sz) {
const ai_int32 len = (ai_uint32) ::strlen(sz);
if( len > (ai_int32)MAXLEN - 1) {
void Set(const char *sz) {
const ai_int32 len = (ai_uint32)::strlen(sz);
if (len > (ai_int32)MAXLEN - 1) {
return;
}
length = len;
memcpy( data, sz, len);
memcpy(data, sz, len);
data[len] = 0;
}
/** Assignment operator */
aiString& operator = (const aiString &rOther) {
aiString &operator=(const aiString &rOther) {
if (this == &rOther) {
return *this;
}
length = rOther.length;;
memcpy( data, rOther.data, length);
length = rOther.length;
;
memcpy(data, rOther.data, length);
data[length] = '\0';
return *this;
}
/** Assign a const char* to the string */
aiString& operator = (const char* sz) {
aiString &operator=(const char *sz) {
Set(sz);
return *this;
}
/** Assign a cstd::string to the string */
aiString& operator = ( const std::string& pString) {
aiString &operator=(const std::string &pString) {
Set(pString);
return *this;
}
/** Comparison operator */
bool operator==(const aiString& other) const {
return (length == other.length && 0 == memcmp(data,other.data,length));
bool operator==(const aiString &other) const {
return (length == other.length && 0 == memcmp(data, other.data, length));
}
/** Inverse comparison operator */
bool operator!=(const aiString& other) const {
return (length != other.length || 0 != memcmp(data,other.data,length));
bool operator!=(const aiString &other) const {
return (length != other.length || 0 != memcmp(data, other.data, length));
}
/** Append a string to the string */
void Append (const char* app) {
const ai_uint32 len = (ai_uint32) ::strlen(app);
void Append(const char *app) {
const ai_uint32 len = (ai_uint32)::strlen(app);
if (!len) {
return;
}
@@ -362,23 +359,23 @@ struct aiString
return;
}
memcpy(&data[length],app,len+1);
memcpy(&data[length], app, len + 1);
length += len;
}
/** Clear the string - reset its length to zero */
void Clear () {
length = 0;
void Clear() {
length = 0;
data[0] = '\0';
#ifdef ASSIMP_BUILD_DEBUG
// Debug build: overwrite the string on its full length with ESC (27)
memset(data+1,27,MAXLEN-1);
memset(data + 1, 27, MAXLEN - 1);
#endif
}
/** Returns a pointer to the underlying zero-terminated array of characters */
const char* C_Str() const {
const char *C_Str() const {
return data;
}
@@ -391,15 +388,13 @@ struct aiString
/** String buffer. Size limit is MAXLEN */
char data[MAXLEN];
} ; // !struct aiString
}; // !struct aiString
// ----------------------------------------------------------------------------------
/** Standard return type for some library functions.
* Rarely used, and if, mostly in the C API.
*/
typedef enum aiReturn
{
typedef enum aiReturn {
/** Indicates that a function was successful */
aiReturn_SUCCESS = 0x0,
@@ -417,19 +412,18 @@ typedef enum aiReturn
_AI_ENFORCE_ENUM_SIZE = 0x7fffffff
/// @endcond
} aiReturn; // !enum aiReturn
} aiReturn; // !enum aiReturn
// just for backwards compatibility, don't use these constants anymore
#define AI_SUCCESS aiReturn_SUCCESS
#define AI_FAILURE aiReturn_FAILURE
#define AI_SUCCESS aiReturn_SUCCESS
#define AI_FAILURE aiReturn_FAILURE
#define AI_OUTOFMEMORY aiReturn_OUTOFMEMORY
// ----------------------------------------------------------------------------------
/** Seek origins (for the virtual file system API).
* Much cooler than using SEEK_SET, SEEK_CUR or SEEK_END.
*/
enum aiOrigin
{
enum aiOrigin {
/** Beginning of the file */
aiOrigin_SET = 0x0,
@@ -452,8 +446,7 @@ enum aiOrigin
* Logging to these streams can be enabled with a single call to
* #LogStream::createDefaultStream.
*/
enum aiDefaultLogStream
{
enum aiDefaultLogStream {
/** Stream the log to a file */
aiDefaultLogStream_FILE = 0x1,
@@ -476,9 +469,9 @@ enum aiDefaultLogStream
}; // !enum aiDefaultLogStream
// just for backwards compatibility, don't use these constants anymore
#define DLS_FILE aiDefaultLogStream_FILE
#define DLS_STDOUT aiDefaultLogStream_STDOUT
#define DLS_STDERR aiDefaultLogStream_STDERR
#define DLS_FILE aiDefaultLogStream_FILE
#define DLS_STDOUT aiDefaultLogStream_STDOUT
#define DLS_STDERR aiDefaultLogStream_STDERR
#define DLS_DEBUGGER aiDefaultLogStream_DEBUGGER
// ----------------------------------------------------------------------------------
@@ -486,21 +479,19 @@ enum aiDefaultLogStream
* animations) of an import. All sizes are in bytes.
* @see Importer::GetMemoryRequirements()
*/
struct aiMemoryInfo
{
struct aiMemoryInfo {
#ifdef __cplusplus
/** Default constructor */
aiMemoryInfo() AI_NO_EXCEPT
: textures (0)
, materials (0)
, meshes (0)
, nodes (0)
, animations (0)
, cameras (0)
, lights (0)
, total (0)
{}
: textures(0),
materials(0),
meshes(0),
nodes(0),
animations(0),
cameras(0),
lights(0),
total(0) {}
#endif
@@ -537,8 +528,8 @@ struct aiMemoryInfo
#include "vector2.inl"
#include "vector3.inl"
#include "color4.inl"
#include "quaternion.inl"
#include "matrix3x3.inl"
#include "matrix4x4.inl"
#include "quaternion.inl"
#endif // AI_TYPES_H_INC