aiAnim.h   aiAnim.h 
skipping to change at line 60 skipping to change at line 60
#include "aiQuaternion.h" #include "aiQuaternion.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** A time-value pair specifying a certain 3D vector for the given time. */ /** A time-value pair specifying a certain 3D vector for the given time. */
struct aiVectorKey struct aiVectorKey
{ {
//! The time of this key /** The time of this key */
double mTime; double mTime;
//! The value of this key
/** The value of this key */
C_STRUCT aiVector3D mValue; C_STRUCT aiVector3D mValue;
#ifdef __cplusplus #ifdef __cplusplus
//! Default constructor //! Default constructor
aiVectorKey(){} aiVectorKey(){}
//! Construction from a given time and key value //! Construction from a given time and key value
aiVectorKey(double time, const aiVector3D& value) aiVectorKey(double time, const aiVector3D& value)
: mTime (time) : mTime (time)
, mValue (value) , mValue (value)
{} {}
typedef aiVector3D elem_type; typedef aiVector3D elem_type;
//! Comparison operators. Just the key value is compared // Comparison operators. For use with std::find();
//! For use with std::find();
bool operator == (const aiVectorKey& o) const { bool operator == (const aiVectorKey& o) const {
return o.mValue == this->mValue; return o.mValue == this->mValue;
} }
bool operator != (const aiVectorKey& o) const { bool operator != (const aiVectorKey& o) const {
return o.mValue != this->mValue; return o.mValue != this->mValue;
} }
//! Relational operators. Just the key time is compared // Relational operators. For use with std::sort();
//! For use with std::sort();
bool operator < (const aiVectorKey& o) const { bool operator < (const aiVectorKey& o) const {
return mTime < o.mTime; return mTime < o.mTime;
} }
bool operator > (const aiVectorKey& o) const { bool operator > (const aiVectorKey& o) const {
return mTime > o.mTime; return mTime > o.mTime;
} }
#endif #endif
}; };
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** A time-value pair specifying a rotation for the given time. For joint /** A time-value pair specifying a rotation for the given time.
* animations the rotation is usually expressed using a quaternion. * Rotations are expressed with quaternions. */
*/
struct aiQuatKey struct aiQuatKey
{ {
//! The time of this key /** The time of this key */
double mTime; double mTime;
//! The value of this key
/** The value of this key */
C_STRUCT aiQuaternion mValue; C_STRUCT aiQuaternion mValue;
#ifdef __cplusplus #ifdef __cplusplus
aiQuatKey(){
}
//! Default constructor /** Construction from a given time and key value */
aiQuatKey(){}
//! Construction from a given time and key value
aiQuatKey(double time, const aiQuaternion& value) aiQuatKey(double time, const aiQuaternion& value)
: mTime (time) : mTime (time)
, mValue (value) , mValue (value)
{} {}
typedef aiQuaternion elem_type; typedef aiQuaternion elem_type;
//! Comparison operators. Just the key value is compared // Comparison operators. For use with std::find();
//! For use with std::find();
bool operator == (const aiQuatKey& o) const { bool operator == (const aiQuatKey& o) const {
return o.mValue == this->mValue; return o.mValue == this->mValue;
} }
bool operator != (const aiQuatKey& o) const { bool operator != (const aiQuatKey& o) const {
return o.mValue != this->mValue; return o.mValue != this->mValue;
} }
//! Relational operators. Just the key time is compared // Relational operators. For use with std::sort();
//! For use with std::sort();
bool operator < (const aiQuatKey& o) const { bool operator < (const aiQuatKey& o) const {
return mTime < o.mTime; return mTime < o.mTime;
} }
bool operator > (const aiQuatKey& o) const { bool operator > (const aiQuatKey& o) const {
return mTime > o.mTime; return mTime > o.mTime;
} }
#endif #endif
}; };
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** Binds a anim mesh to a specific point in time. */
struct aiMeshKey
{
/** The time of this key */
double mTime;
/** Index into the aiMesh::mAnimMeshes array of the
* mesh coresponding to the #aiMeshAnim hosting this
* key frame. The referenced anim mesh is evaluated
* according to the rules defined in the docs for #aiAnimMesh.*/
unsigned int mValue;
#ifdef __cplusplus
aiMeshKey() {
}
/** Construction from a given time and key 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 {
return o.mValue == this->mValue;
}
bool operator != (const aiMeshKey& o) const {
return o.mValue != this->mValue;
}
// Relational operators. For use with std::sort();
bool operator < (const aiMeshKey& o) const {
return mTime < o.mTime;
}
bool operator > (const aiMeshKey& o) const {
return mTime > o.mTime;
}
#endif
};
// ------------------------------------------------------------------------
---
/** Defines how an animation channel behaves outside the defined time /** Defines how an animation channel behaves outside the defined time
* range. This corresponds to aiNodeAnim::mPreState and * range. This corresponds to aiNodeAnim::mPreState and
* aiNodeAnim::mPostState.*/ * aiNodeAnim::mPostState.*/
enum aiAnimBehaviour enum aiAnimBehaviour
{ {
/** The value from the default node transformation is taken*/ /** The value from the default node transformation is taken*/
aiAnimBehaviour_DEFAULT = 0x0, aiAnimBehaviour_DEFAULT = 0x0,
/** The nearest key value is used without interpolation */ /** The nearest key value is used without interpolation */
aiAnimBehaviour_CONSTANT = 0x1, aiAnimBehaviour_CONSTANT = 0x1,
skipping to change at line 184 skipping to change at line 225
* are given in three separate series of values, one each for position, * are given in three separate series of values, one each for position,
* rotation and scaling. The transformation matrix computed from these * rotation and scaling. The transformation matrix computed from these
* values replaces the node's original transformation matrix at a * values replaces the node's original transformation matrix at a
* specific time. * specific time.
* This means all keys are absolute and not relative to the bone default p ose. * This means all keys are absolute and not relative to the bone default p ose.
* The order in which the transformations are applied is * The order in which the transformations are applied is
* - as usual - scaling, rotation, translation. * - as usual - scaling, rotation, translation.
* *
* @note All keys are returned in their correct, chronological order. * @note All keys are returned in their correct, chronological order.
* Duplicate keys don't pass the validation step. Most likely there * Duplicate keys don't pass the validation step. Most likely there
* will be no negative time values, but they are not forbidden ( so you sh * will be no negative time values, but they are not forbidden also ( so
ould * implementations need to cope with them! ) */
* be able to handle them ) */
struct aiNodeAnim struct aiNodeAnim
{ {
/** The name of the node affected by this animation. The node /** The name of the node affected by this animation. The node
* must exist and it must be unique.*/ * must exist and it must be unique.*/
C_STRUCT aiString mNodeName; C_STRUCT aiString mNodeName;
/** The number of position keys */ /** The number of position keys */
unsigned int mNumPositionKeys; unsigned int mNumPositionKeys;
/** The position keys of this animation channel. Positions are /** The position keys of this animation channel. Positions are
skipping to change at line 257 skipping to change at line 298
~aiNodeAnim() ~aiNodeAnim()
{ {
delete [] mPositionKeys; delete [] mPositionKeys;
delete [] mRotationKeys; delete [] mRotationKeys;
delete [] mScalingKeys; delete [] mScalingKeys;
} }
#endif // __cplusplus #endif // __cplusplus
}; };
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** Describes vertex-based animations for a single mesh or a group of
* meshes. Meshes carry the animation data for each frame in their
* aiMesh::mAnimMeshes array. The purpose of aiMeshAnim is to
* define keyframes linking each mesh attachment to a particular
* point in time. */
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 wildcard to select a group
* of meshes with similar animation setup)*/
C_STRUCT aiString mName;
/** Size of the #mKeys array. Must be 1, at least. */
unsigned int mNumKeys;
/** Key frames of the animation. May not be NULL. */
C_STRUCT aiMeshKey* mKeys;
#ifdef __cplusplus
aiMeshAnim()
: mNumKeys()
, mKeys()
{}
~aiMeshAnim()
{
delete[] mKeys;
}
#endif
};
// ------------------------------------------------------------------------
---
/** An animation consists of keyframe data for a number of nodes. For /** An animation consists of keyframe data for a number of nodes. For
* each node affected by the animation a separate series of data is given. */ * each node affected by the animation a separate series of data is given. */
struct aiAnimation struct aiAnimation
{ {
/** The name of the animation. If the modeling package this data was /** The name of the animation. If the modeling package this data was
* exported from does support only a single animation channel, this * exported from does support only a single animation channel, this
* name is usually empty (length is zero). */ * name is usually empty (length is zero). */
C_STRUCT aiString mName; C_STRUCT aiString mName;
/** Duration of the animation in ticks. */ /** Duration of the animation in ticks. */
skipping to change at line 280 skipping to change at line 356
double mTicksPerSecond; double mTicksPerSecond;
/** The number of bone animation channels. Each channel affects /** The number of bone animation channels. Each channel affects
* a single node. */ * a single node. */
unsigned int mNumChannels; unsigned int mNumChannels;
/** The node animation channels. Each channel affects a single node. /** The node animation channels. Each channel affects a single node.
* The array is mNumChannels in size. */ * 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. */
unsigned int mNumMeshChannels;
/** The mesh animation channels. Each channel affects a single mesh.
* The array is mNumMeshChannels in size. */
C_STRUCT aiMeshAnim** mMeshChannels;
#ifdef __cplusplus #ifdef __cplusplus
aiAnimation() aiAnimation()
: mDuration(-1.)
, mTicksPerSecond()
, mNumChannels()
, mChannels()
, mNumMeshChannels()
, mMeshChannels()
{ {
mDuration = -1.;
mTicksPerSecond = 0;
mNumChannels = 0; mChannels = NULL;
} }
~aiAnimation() ~aiAnimation()
{ {
// DO NOT REMOVE THIS ADDITIONAL CHECK // DO NOT REMOVE THIS ADDITIONAL CHECK
if (mNumChannels && mChannels) if (mNumChannels && mChannels) {
{ for( unsigned int a = 0; a < mNumChannels; a++) {
for( unsigned int a = 0; a < mNumChannels; a++)
delete mChannels[a]; delete mChannels[a];
}
delete [] mChannels; delete [] mChannels;
} }
if (mNumMeshChannels && mMeshChannels) {
for( unsigned int a = 0; a < mNumMeshChannels; a++)
{
delete mMeshChannels[a];
}
delete [] mMeshChannels;
}
} }
#endif // __cplusplus #endif // __cplusplus
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
// some C++ utilities for inter- and extrapolation // some C++ utilities for inter- and extrapolation
namespace Assimp { namespace Assimp {
skipping to change at line 339 skipping to change at line 433
template <> template <>
struct Interpolator <aiQuaternion> { struct Interpolator <aiQuaternion> {
void operator () (aiQuaternion& out,const aiQuaternion& a, void operator () (aiQuaternion& out,const aiQuaternion& a,
const aiQuaternion& b, float d) const const aiQuaternion& b, float d) const
{ {
aiQuaternion::Interpolate(out,a,b,d); aiQuaternion::Interpolate(out,a,b,d);
} }
}; // ! Interpolator <aiQuaternion> }; // ! Interpolator <aiQuaternion>
template <> template <>
struct Interpolator <unsigned int> {
void operator () (unsigned int& out,unsigned int a,
unsigned int b, float d) const
{
out = d>0.5f ? b : a;
}
}; // ! Interpolator <aiQuaternion>
template <>
struct Interpolator <aiVectorKey> { struct Interpolator <aiVectorKey> {
void operator () (aiVector3D& out,const aiVectorKey& a, void operator () (aiVector3D& out,const aiVectorKey& a,
const aiVectorKey& b, float d) const const aiVectorKey& b, float d) const
{ {
Interpolator<aiVector3D> ipl; Interpolator<aiVector3D> ipl;
ipl(out,a.mValue,b.mValue,d); ipl(out,a.mValue,b.mValue,d);
} }
}; // ! Interpolator <aiVectorKey> }; // ! Interpolator <aiVectorKey>
template <> template <>
struct Interpolator <aiQuatKey> { struct Interpolator <aiQuatKey> {
void operator () (aiQuaternion& out, const aiQuatKey a, void operator () (aiQuaternion& out, const aiQuatKey a,
const aiQuatKey& b, float d) const const aiQuatKey& b, float d) const
{ {
Interpolator<aiQuaternion> ipl; Interpolator<aiQuaternion> ipl;
ipl(out,a.mValue,b.mValue,d); ipl(out,a.mValue,b.mValue,d);
} }
}; // ! Interpolator <aiQuatKey> }; // ! Interpolator <aiQuatKey>
template <>
struct Interpolator <aiMeshKey> {
void operator () (unsigned int& out, const aiMeshKey a,
const aiMeshKey& b, float d) const
{
Interpolator<unsigned int> ipl;
ipl(out,a.mValue,b.mValue,d);
}
}; // ! Interpolator <aiQuatKey>
//! @endcond //! @endcond
} // ! end namespace Assimp } // ! end namespace Assimp
#endif // __cplusplus #endif // __cplusplus
#endif // AI_ANIM_H_INC #endif // AI_ANIM_H_INC
 End of changes. 22 change blocks. 
28 lines changed or deleted 143 lines changed or added


 aiConfig.h   aiConfig.h 
skipping to change at line 62 skipping to change at line 62
* <br><br> * <br><br>
* The corresponding functions for use with the plain-c API are: * The corresponding functions for use with the plain-c API are:
* #aiSetImportPropertyInteger, * #aiSetImportPropertyInteger,
* #aiSetImportPropertyFloat, * #aiSetImportPropertyFloat,
* #aiSetImportPropertyString * #aiSetImportPropertyString
*/ */
#ifndef INCLUDED_AI_CONFIG_H #ifndef INCLUDED_AI_CONFIG_H
#define INCLUDED_AI_CONFIG_H #define INCLUDED_AI_CONFIG_H
// ######################################################################## ### // ######################################################################## ###
// LIBRARY SETTINGS
// General, global settings
// ########################################################################
###
// ------------------------------------------------------------------------
---
/** @brief Enables time measurements.
*
* If enabled, measures the time needed for each part of the loading
* process (i.e. IO time, importing, postprocessing, ..) and dumps
* these timings to the DefaultLogger. See the @link perf Performance
* Page@endlink for more information on this topic.
*
* Property type: bool. Default value: false.
*/
#define AI_CONFIG_GLOB_MEASURE_TIME \
"GLOB_MEASURE_TIME"
# if 0 // not implemented yet
// ------------------------------------------------------------------------
---
/** @brief Set Assimp's multithreading policy.
*
* This setting is ignored if Assimp was built without boost.thread
* support (ASSIMP_BUILD_NO_THREADING, which is implied by ASSIMP_BUILD_BOO
ST_WORKAROUND).
* Possible values are: -1 to let Assimp decide what to do, 0 to disable
* multithreading entirely and any number larger than 0 to force a specific
* number of threads. Assimp is always free to ignore this settings, which
is
* merely a hint. Usually, the default value (-1) will be fine. However, if
* Assimp is used concurrently from multiple user threads, it might be usef
ul
* to limit each Importer instance to a specific number of cores.
*
* For more information, see the @link threading Threading page@endlink.
* Property type: int, default value: -1.
*/
#define AI_CONFIG_GLOB_MULTITHREADING \
"GLOB_MULTITHREADING"
#endif
// ########################################################################
###
// POST PROCESSING SETTINGS // POST PROCESSING SETTINGS
// Various stuff to fine-tune the behavior of a specific post processing st ep. // Various stuff to fine-tune the behavior of a specific post processing st ep.
// ######################################################################## ### // ######################################################################## ###
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Specifies the maximum angle that may be between two vertex tang ents /** @brief Specifies the maximum angle that may be between two vertex tang ents
* that their tangents and bitangents are smoothed. * that their tangents and bitangents are smoothed.
* *
* This applies to the CalcTangentSpace-Step. The angle is specified * This applies to the CalcTangentSpace-Step. The angle is specified
* in degrees, so 180 is PI. The default value is * in degrees, so 180 is PI. The default value is
skipping to change at line 138 skipping to change at line 176
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the #aiProcess_PretransformVertices step to /** @brief Configures the #aiProcess_PretransformVertices step to
* keep the scene hierarchy. Meshes are moved to worldspace, but * keep the scene hierarchy. Meshes are moved to worldspace, but
* no optimization is performed (read: meshes with equal materials are not * no optimization is performed (read: meshes with equal materials are not
* joined. The total number of meshes won't change). * joined. The total number of meshes won't change).
* *
* This option could be of use for you if the scene hierarchy contains * This option could be of use for you if the scene hierarchy contains
* important additional information which you intend to parse. * important additional information which you intend to parse.
* For rendering, you can still render all meshes in the scene without * For rendering, you can still render all meshes in the scene without
* any transformations. * any transformations.
* Property type: integer (0: false; !0: true). Default value: false. * Property type: bool. Default value: false.
*/ */
#define AI_CONFIG_PP_PTV_KEEP_HIERARCHY \ #define AI_CONFIG_PP_PTV_KEEP_HIERARCHY \
"PP_PTV_KEEP_HIERARCHY" "PP_PTV_KEEP_HIERARCHY"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the #aiProcess_PretransformVertices step to normalize /** @brief Configures the #aiProcess_PretransformVertices step to normalize
* all vertex components into the -1...1 range. That is, a bounding box * all vertex components into the -1...1 range. That is, a bounding box
* for the whole scene is computed, the maximum component is taken and all * for the whole scene is computed, the maximum component is taken and all
* meshes are scaled appropriately (uniformly of course!). * meshes are scaled appropriately (uniformly of course!).
* This might be useful if you don't know the spatial dimension of the inp ut * This might be useful if you don't know the spatial dimension of the inp ut
skipping to change at line 161 skipping to change at line 199
"PP_PTV_NORMALIZE" "PP_PTV_NORMALIZE"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the #aiProcess_FindDegenerates step to /** @brief Configures the #aiProcess_FindDegenerates step to
* remove degenerated primitives from the import - immediately. * remove degenerated primitives from the import - immediately.
* *
* The default behaviour converts degenerated triangles to lines and * The default behaviour converts degenerated triangles to lines and
* degenerated lines to points. See the documentation to the * degenerated lines to points. See the documentation to the
* #aiProcess_FindDegenerates step for a detailed example of the various wa ys * #aiProcess_FindDegenerates step for a detailed example of the various wa ys
* to get rid of these lines and points if you don't want them. * to get rid of these lines and points if you don't want them.
* Property type: integer (0: false; !0: true). Default value: false. * Property type: bool. Default value: false.
*/ */
#define AI_CONFIG_PP_FD_REMOVE \ #define AI_CONFIG_PP_FD_REMOVE \
"PP_FD_REMOVE" "PP_FD_REMOVE"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the #aiProcess_OptimizeGraph step to preserve nodes /** @brief Configures the #aiProcess_OptimizeGraph step to preserve nodes
* matching a name in a given list. * matching a name in a given list.
* *
* This is a list of 1 to n strings, ' ' serves as delimiter character. * This is a list of 1 to n strings, ' ' serves as delimiter character.
* Identifiers containing whitespaces must be enclosed in *single* * Identifiers containing whitespaces must be enclosed in *single*
skipping to change at line 401 skipping to change at line 439
* It represents just a hint to loaders and post-processing steps to use * It represents just a hint to loaders and post-processing steps to use
* faster code paths, if possible. * faster code paths, if possible.
* This property is expected to be an integer, != 0 stands for true. * This property is expected to be an integer, != 0 stands for true.
* The default value is 0. * The default value is 0.
*/ */
#define AI_CONFIG_FAVOUR_SPEED \ #define AI_CONFIG_FAVOUR_SPEED \
"FAVOUR_SPEED" "FAVOUR_SPEED"
// ######################################################################## ### // ######################################################################## ###
// IMPORTER SETTINGS // IMPORTER SETTINGS
// Various stuff to fine-tune the behaviour of a specific importer plugin. // Various stuff to fine-tune the behaviour of specific importer plugins.
// ######################################################################## ### // ######################################################################## ###
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Set the vertex animation keyframe to be imported /** @brief Set the vertex animation keyframe to be imported
* *
* ASSIMP does not support vertex keyframes (only bone animation is support ed). * ASSIMP does not support vertex keyframes (only bone animation is support ed).
* The library reads only one frame of models with vertex animations. * The library reads only one frame of models with vertex animations.
* By default this is the first frame. * By default this is the first frame.
* \note The default value is 0. This option applies to all importers. * \note The default value is 0. This option applies to all importers.
* However, it is also possible to override the global setting * However, it is also possible to override the global setting
skipping to change at line 430 skipping to change at line 468
#define AI_CONFIG_IMPORT_MD2_KEYFRAME "IMPORT_MD2_KEYFRAME" #define AI_CONFIG_IMPORT_MD2_KEYFRAME "IMPORT_MD2_KEYFRAME"
#define AI_CONFIG_IMPORT_MDL_KEYFRAME "IMPORT_MDL_KEYFRAME" #define AI_CONFIG_IMPORT_MDL_KEYFRAME "IMPORT_MDL_KEYFRAME"
#define AI_CONFIG_IMPORT_MDC_KEYFRAME "IMPORT_MDC_KEYFRAME" #define AI_CONFIG_IMPORT_MDC_KEYFRAME "IMPORT_MDC_KEYFRAME"
#define AI_CONFIG_IMPORT_SMD_KEYFRAME "IMPORT_SMD_KEYFRAME" #define AI_CONFIG_IMPORT_SMD_KEYFRAME "IMPORT_SMD_KEYFRAME"
#define AI_CONFIG_IMPORT_UNREAL_KEYFRAME "IMPORT_UNREAL_KEYFRAME" #define AI_CONFIG_IMPORT_UNREAL_KEYFRAME "IMPORT_UNREAL_KEYFRAME"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the AC loader to collect all surfaces which have the /** @brief Configures the AC loader to collect all surfaces which have the
* "Backface cull" flag set in separate meshes. * "Backface cull" flag set in separate meshes.
* *
* Property type: integer (0: false; !0: true). Default value: true. * Property type: bool. Default value: true.
*/ */
#define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL \ #define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL \
"IMPORT_AC_SEPARATE_BFCULL" "IMPORT_AC_SEPARATE_BFCULL"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures whether the AC loader evaluates subdivision surfaces ( /** @brief Configures whether the AC loader evaluates subdivision surfaces (
* indicated by the presence of the 'subdiv' attribute in the file). By * indicated by the presence of the 'subdiv' attribute in the file). By
* default, Assimp performs the subdivision using the standard * default, Assimp performs the subdivision using the standard
* Catmull-Clark algorithm * Catmull-Clark algorithm
* *
* Property type: integer (0: false; !0: true). Default value: true. * * Property type: bool. Default value: true.
*/ */
#define AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION \ #define AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION \
"IMPORT_AC_EVAL_SUBDIVISION" "IMPORT_AC_EVAL_SUBDIVISION"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the UNREAL 3D loader to separate faces with differen t /** @brief Configures the UNREAL 3D loader to separate faces with differen t
* surface flags (e.g. two-sided vs. single-sided). * surface flags (e.g. two-sided vs. single-sided).
* *
* Property type: integer (0: false; !0: true). Default value: true. * * Property type: bool. Default value: true.
*/ */
#define AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS \ #define AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS \
"UNREAL_HANDLE_FLAGS" "UNREAL_HANDLE_FLAGS"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the terragen import plugin to compute uv's for /** @brief Configures the terragen import plugin to compute uv's for
* terrains, if not given. Furthermore a default texture is assigned. * terrains, if not given. Furthermore a default texture is assigned.
* *
* UV coordinates for terrains are so simple to compute that you'll usually * UV coordinates for terrains are so simple to compute that you'll usually
* want to compute them on your own, if you need them. This option is inten ded * want to compute them on your own, if you need them. This option is inten ded
* for model viewers which want to offer an easy way to apply textures to * for model viewers which want to offer an easy way to apply textures to
* terrains. * terrains.
* Property type: integer (0: false; !0: true). Default value: false. * * Property type: bool. Default value: false.
*/ */
#define AI_CONFIG_IMPORT_TER_MAKE_UVS \ #define AI_CONFIG_IMPORT_TER_MAKE_UVS \
"IMPORT_TER_MAKE_UVS" "IMPORT_TER_MAKE_UVS"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the ASE loader to always reconstruct normal vectors /** @brief Configures the ASE loader to always reconstruct normal vectors
* basing on the smoothing groups loaded from the file. * basing on the smoothing groups loaded from the file.
* *
* Many ASE files have invalid normals (they're not orthonormal). * Some ASE files have carry invalid normals, other don't.
* Property type: integer (0: false; !0: true). Default value: true. * * Property type: bool. Default value: true.
*/ */
#define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS \ #define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS \
"IMPORT_ASE_RECONSTRUCT_NORMALS" "IMPORT_ASE_RECONSTRUCT_NORMALS"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the M3D loader to process multi-part player models. /** @brief Configures the M3D loader to detect and process multi-part
* Quake player models.
* *
* These models usually consist of 3 files, lower.md3, upper.md3 and * These models usually consist of 3 files, lower.md3, upper.md3 and
* head.md3. If this property is set to true, Assimp will try to load and * head.md3. If this property is set to true, Assimp will try to load and
* combine all three files if one of them is loaded. * combine all three files if one of them is loaded.
* Property type: integer (0: false; !0: true). Default value: true. * Property type: bool. Default value: true.
*/ */
#define AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART \ #define AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART \
"IMPORT_MD3_HANDLE_MULTIPART" "IMPORT_MD3_HANDLE_MULTIPART"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Tells the MD3 loader which skin files to load. /** @brief Tells the MD3 loader which skin files to load.
* *
* When loading MD3 files, Assimp checks whether a file * When loading MD3 files, Assimp checks whether a file
* <md3_file_name>_<skin_name>.skin is existing. These files are used by * <md3_file_name>_<skin_name>.skin is existing. These files are used by
* Quake III to be able to assign different skins (e.g. red and blue team) * Quake III to be able to assign different skins (e.g. red and blue team)
skipping to change at line 542 skipping to change at line 581
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Configures the MD5 loader to not load the MD5ANIM file for /** @brief Configures the MD5 loader to not load the MD5ANIM file for
* a MD5MESH file automatically. * a MD5MESH file automatically.
* *
* The default strategy is to look for a file with the same name but the * The default strategy is to look for a file with the same name but the
* MD5ANIM extension in the same directory. If it is found, it is loaded * MD5ANIM extension in the same directory. If it is found, it is loaded
* and combined with the MD5MESH file. This configuration option can be * and combined with the MD5MESH file. This configuration option can be
* used to disable this behaviour. * used to disable this behaviour.
* *
* Property type: integer (0: false; !0: true). Default value: false. * * Property type: bool. Default value: false.
*/ */
#define AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD \ #define AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD \
"IMPORT_MD5_NO_ANIM_AUTOLOAD" "IMPORT_MD5_NO_ANIM_AUTOLOAD"
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Defines the begin of the time range for which the LWS loader /** @brief Defines the begin of the time range for which the LWS loader
* evaluates animations and computes aiNodeAnim's. * evaluates animations and computes aiNodeAnim's.
* *
* Assimp provides full conversion of LightWave's envelope system, includin g * Assimp provides full conversion of LightWave's envelope system, includin g
* pre and post conditions. The loader computes linearly subsampled animati on * pre and post conditions. The loader computes linearly subsampled animati on
 End of changes. 12 change blocks. 
12 lines changed or deleted 58 lines changed or added


 aiDefines.h   aiDefines.h 
skipping to change at line 63 skipping to change at line 63
* build in this case. 'XX' stands for the most common file * build in this case. 'XX' stands for the most common file
* extension of the file format. E.g.: * extension of the file format. E.g.:
* ASSIMP_BUILD_NO_X_IMPORTER disables the X loader. * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
* *
* If you're unsure about that, take a look at the implementation of the * 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 i n the * import plugin you wish to disable. You'll find the right define i n the
* first lines of the corresponding unit. * first lines of the corresponding unit.
* *
* Other (mixed) configuration switches are listed here: * Other (mixed) configuration switches are listed here:
* ASSIMP_BUILD_NO_COMPRESSED_X * ASSIMP_BUILD_NO_COMPRESSED_X
* - Disable support for compressed X files */ * - Disable support for compressed X files
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
* - Disable support for compressed Blender files*/
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X #ifndef ASSIMP_BUILD_NO_COMPRESSED_X
# define ASSIMP_BUILD_NEED_Z_INFLATE # define ASSIMP_BUILD_NEED_Z_INFLATE
#endif #endif
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
# define ASSIMP_BUILD_NEED_Z_INFLATE
#endif
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
/* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
* post processing step. This is the current list of process names ( 'XX'): * post processing step. This is the current list of process names ( 'XX'):
* CALCTANGENTS * CALCTANGENTS
* JOINVERTICES * JOINVERTICES
* TRIANGULATE * TRIANGULATE
* GENFACENORMALS * GENFACENORMALS
* GENVERTEXNORMALS * GENVERTEXNORMALS
* REMOVEVC * REMOVEVC
* SPLITLARGEMESHES * SPLITLARGEMESHES
skipping to change at line 101 skipping to change at line 108
* MAKELEFTHANDED * MAKELEFTHANDED
* FLIPUVS * FLIPUVS
* FLIPWINDINGORDER * FLIPWINDINGORDER
* OPTIMIZEMESHES * OPTIMIZEMESHES
* OPTIMIZEANIMS * OPTIMIZEANIMS
* OPTIMIZEGRAPH * OPTIMIZEGRAPH
* GENENTITYMESHES * GENENTITYMESHES
* FIXTEXTUREPATHS */ * FIXTEXTUREPATHS */
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
// Compiler specific includes and definitions #ifdef _MSC_VER
#if (defined _MSC_VER)
# undef ASSIMP_API # undef ASSIMP_API
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
# if (defined ASSIMP_BUILD_DLL_EXPORT) # ifdef ASSIMP_BUILD_DLL_EXPORT
# define ASSIMP_API __declspec(dllexport) # define ASSIMP_API __declspec(dllexport)
# pragma warning (disable : 4251) # pragma warning (disable : 4251)
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
/* 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. */ * an external DLL under Windows. Default is static linkage. */
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
# elif (defined ASSIMP_DLL) # elif (defined ASSIMP_DLL)
# define ASSIMP_API __declspec(dllimport) # define ASSIMP_API __declspec(dllimport)
# else # else
# define ASSIMP_API # define ASSIMP_API
# endif # endif
/* Force the compiler to inline a function, if possible /* 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 an alysis /* Tells the compiler that a function never returns. Used in code an alysis
* to skip dead paths (e.g. after an assertion evaluated false). * to skip dead paths (e.g. after an assertion evaluated to false).
*/ */
# define AI_WONT_RETURN __declspec(noreturn) # define AI_WONT_RETURN __declspec(noreturn)
#else #else
# define AI_WONT_RETURN # define AI_WONT_RETURN
# define ASSIMP_API # define ASSIMP_API
# define AI_FORCE_INLINE inline # define AI_FORCE_INLINE inline
#endif // (defined _MSC_VER) #endif // (defined _MSC_VER)
#ifdef __cplusplus #ifdef __cplusplus
skipping to change at line 177 skipping to change at line 182
# if (defined ASSIMP_DOXYGEN_BUILD) # if (defined ASSIMP_DOXYGEN_BUILD)
# define C_STRUCT # define C_STRUCT
# define C_ENUM # define C_ENUM
# else # else
# define C_STRUCT struct # define C_STRUCT struct
# define C_ENUM enum # define C_ENUM enum
# endif # endif
#endif #endif
#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__)) #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
#error Currently, Borland is unsupported. Feel free to port Assimp.
#error Currently Borland is unsupported. Feel free to port Assimp.
// "W8059 Packgr // "W8059 Packgr
#endif #endif
//////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////// //////
/* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp /* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
* without boost. This is done by using a few workaround * without boost. This is done by using a few workaround
* classes and brings some limitations (e.g. some logging won't be d one, * classes and brings some limitations (e.g. some logging won't be d one,
* the library won't utilize threads or be threadsafe at all). * the library won't utilize threads or be threadsafe at all).
* This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */ * This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
skipping to change at line 217 skipping to change at line 221
#endif #endif
#ifndef ASSIMP_BUILD_SINGLETHREADED #ifndef ASSIMP_BUILD_SINGLETHREADED
# define AI_C_THREADSAFE # define AI_C_THREADSAFE
#endif // !! ASSIMP_BUILD_SINGLETHREADED #endif // !! ASSIMP_BUILD_SINGLETHREADED
#if (defined _DEBUG || defined DEBUG) // one of the two should be defined . . #if (defined _DEBUG || defined DEBUG) // one of the two should be defined . .
# define ASSIMP_BUILD_DEBUG # define ASSIMP_BUILD_DEBUG
#endif #endif
////////////////////////////////////////////////////////////////////
//////
/* 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__)
# define ASSIMP_BUILD_X86_64BIT_ARCHITECTURE
# elif defined(__ppc__)
# define ASSIMP_BUILD_PPC_32BIT_ARCHITECTURE
# else
# error unknown architecture
# endif
#else
# error unknown compiler
#endif
////////////////////////////////////////////////////////////////////
//////
/* Useful constants */
////////////////////////////////////////////////////////////////////
//////
/* This is PI. Hi PI. */ /* This is PI. Hi PI. */
#define AI_MATH_PI (3.141592653589793238462643383279 ) #define AI_MATH_PI (3.141592653589793238462643383279 )
#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0) #define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5) #define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
/* And this is to avoid endless casts to float */ /* And this is to avoid endless casts to float */
#define AI_MATH_PI_F (3.1415926538f) #define AI_MATH_PI_F (3.1415926538f)
#define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f) #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_HALF_PI_F (AI_MATH_PI_F * 0.5f)
 End of changes. 8 change blocks. 
8 lines changed or deleted 50 lines changed or added


 aiMesh.h   aiMesh.h 
skipping to change at line 56 skipping to change at line 56
#ifndef INCLUDED_AI_MESH_H #ifndef INCLUDED_AI_MESH_H
#define INCLUDED_AI_MESH_H #define INCLUDED_AI_MESH_H
#include "aiTypes.h" #include "aiTypes.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
// Limits. These values are required to match the settings Assimp was
// compiled against. Therfore, do not redefine them unless you build the
// library from source using the same definitions.
// ------------------------------------------------------------------------
---
/** @def AI_MAX_FACE_INDICES
* Maximum number of indices per face (polygon). */
#ifndef AI_MAX_FACE_INDICES
# 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
#endif
/** @def AI_MAX_VERTICES
* Maximum number of vertices per mesh. */
#ifndef AI_MAX_VERTICES
# 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
#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 0x4
#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 0x4
#endif // !! AI_MAX_NUMBER_OF_TEXTURECOORDS
// ------------------------------------------------------------------------
---
/** @brief A single face in a mesh, referring to multiple vertices. /** @brief A single face in a mesh, referring to multiple vertices.
* *
* If mNumIndices is 3, we call the face 'triangle', for mNumIndices > 3 * If mNumIndices is 3, we call the face 'triangle', for mNumIndices > 3
* it's called 'polygon' (hey, that's just a definition!). * it's called 'polygon' (hey, that's just a definition!).
* <br> * <br>
* aiMesh::mPrimitiveTypes can be queried to quickly examine which types of * aiMesh::mPrimitiveTypes can be queried to quickly examine which types of
* primitive are actually present in a mesh. The #aiProcess_SortByPType fla g * primitive are actually present in a mesh. The #aiProcess_SortByPType fla g
* executes a special post-processing algorithm which splits meshes with * executes a special post-processing algorithm which splits meshes with
* *different* primitive types mixed up (e.g. lines and triangles) in sever al * *different* primitive types mixed up (e.g. lines and triangles) in sever al
* 'clean' submeshes. Furthermore there is a configuration option ( * 'clean' submeshes. Furthermore there is a configuration option (
skipping to change at line 79 skipping to change at line 127
* @code * @code
* aiPrimitiveType_LINE|aiPrimitiveType_POINT * aiPrimitiveType_LINE|aiPrimitiveType_POINT
* @endcode * @endcode
* Together with the #aiProcess_Triangulate flag you can then be sure that * Together with the #aiProcess_Triangulate flag you can then be sure that
* #aiFace::mNumIndices is always 3. * #aiFace::mNumIndices is always 3.
* @note Take a look at the @link data Data Structures page @endlink for * @note Take a look at the @link data Data Structures page @endlink for
* more information on the layout and winding order of a face. * more information on the layout and winding order of a face.
*/ */
struct aiFace struct aiFace
{ {
//! Number of indices defining this face. 3 for a triangle, >3 for p //! Number of indices defining this face.
olygon //! The maximum value for this member is #AI_MAX_FACE_INDICES.
unsigned int mNumIndices; unsigned int mNumIndices;
//! Pointer to the indices array. Size of the array is given in numI ndices. //! Pointer to the indices array. Size of the array is given in numI ndices.
unsigned int* mIndices; unsigned int* mIndices;
#ifdef __cplusplus #ifdef __cplusplus
//! Default constructor //! Default constructor
aiFace() aiFace()
{ {
skipping to change at line 182 skipping to change at line 231
* A bone has a name by which it can be found in the frame hierarchy and b y * A bone has a name by which it can be found in the frame hierarchy and b y
* which it can be addressed by animations. In addition it has a number of * which it can be addressed by animations. In addition it has a number of
* influences on vertices. * influences on vertices.
*/ */
struct aiBone struct aiBone
{ {
//! The name of the bone. //! The name of the bone.
C_STRUCT aiString mName; C_STRUCT aiString mName;
//! The number of vertices affected by this bone //! The number of vertices affected by this bone
//! The maximum value for this member is #AI_MAX_BONE_WEIGHTS.
unsigned int mNumWeights; unsigned int mNumWeights;
//! The vertices affected by this bone //! The vertices affected by this bone
C_STRUCT aiVertexWeight* mWeights; C_STRUCT aiVertexWeight* mWeights;
//! Matrix that transforms from mesh space to bone space in bind pos e //! Matrix that transforms from mesh space to bone space in bind pos e
C_STRUCT aiMatrix4x4 mOffsetMatrix; C_STRUCT aiMatrix4x4 mOffsetMatrix;
#ifdef __cplusplus #ifdef __cplusplus
skipping to change at line 220 skipping to change at line 270
} }
//! Destructor - deletes the array of vertex weights //! Destructor - deletes the array of vertex weights
~aiBone() ~aiBone()
{ {
delete [] mWeights; delete [] mWeights;
} }
#endif // __cplusplus #endif // __cplusplus
}; };
#ifndef AI_MAX_NUMBER_OF_COLOR_SETS
// ------------------------------------------------------------------------
---
/** @def AI_MAX_NUMBER_OF_COLOR_SETS
* Maximum number of vertex color sets per mesh.
*
* Normally: Diffuse, specular, ambient and emissive
* However one could use the vertex color sets for any other purpose, too.
*
* @note Some internal structures expect (and assert) this value
* to be at least 4. For the moment it is absolutely safe to assume that
* this will never change.
*/
# define AI_MAX_NUMBER_OF_COLOR_SETS 0x4
#endif // !! AI_MAX_NUMBER_OF_COLOR_SETS
#ifndef AI_MAX_NUMBER_OF_TEXTURECOORDS
// ------------------------------------------------------------------------
---
/** @def AI_MAX_NUMBER_OF_TEXTURECOORDS
* Maximum number of texture coord sets (UV(W) channels) per mesh
*
* The material system uses the AI_MATKEY_UVWSRC_XXX keys to specify
* which UVW channel serves as data source for a texture.
*
* @note Some internal structures expect (and assert) this value
* to be at least 4. For the moment it is absolutely safe to assume that
* this will never change.
*/
# define AI_MAX_NUMBER_OF_TEXTURECOORDS 0x4
#endif // !! AI_MAX_NUMBER_OF_TEXTURECOORDS
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief Enumerates the types of geometric primitives supported by Assimp . /** @brief Enumerates the types of geometric primitives supported by Assimp .
* *
* @see aiFace Face data structure * @see aiFace Face data structure
* @see aiProcess_SortByPType Per-primitive sorting of meshes * @see aiProcess_SortByPType Per-primitive sorting of meshes
* @see aiProcess_Triangulate Automatic triangulation * @see aiProcess_Triangulate Automatic triangulation
* @see AI_CONFIG_PP_SBP_REMOVE Removal of specific primitive types. * @see AI_CONFIG_PP_SBP_REMOVE Removal of specific primitive types.
*/ */
enum aiPrimitiveType enum aiPrimitiveType
{ {
skipping to change at line 302 skipping to change at line 322
#ifndef SWIG #ifndef SWIG
_aiPrimitiveType_Force32Bit = 0x9fffffff _aiPrimitiveType_Force32Bit = 0x9fffffff
#endif #endif
}; //! enum aiPrimitiveType }; //! enum aiPrimitiveType
// Get the #aiPrimitiveType flag for a specific number of face indices // Get the #aiPrimitiveType flag for a specific number of face indices
#define AI_PRIMITIVE_TYPE_FOR_N_INDICES(n) \ #define AI_PRIMITIVE_TYPE_FOR_N_INDICES(n) \
((n) > 3 ? aiPrimitiveType_POLYGON : (aiPrimitiveType)(1u << ((n)-1) )) ((n) > 3 ? aiPrimitiveType_POLYGON : (aiPrimitiveType)(1u << ((n)-1) ))
// ------------------------------------------------------------------------ --- // ------------------------------------------------------------------------ ---
/** @brief NOT CURRENTLY IN USE. An AnimMesh is an attachment to an #aiMesh
stores per-vertex
* animations for a particular frame.
*
* You may think of an #aiAnimMesh as a `patch` for the host mesh, which
* replaces only certain vertex data streams at a particular time.
* Each mesh stores n attached attached meshes (#aiMesh::mAnimMeshes).
* The actual relationship between the time line and anim meshes is
* established by #aiMeshAnim, which references singular mesh attachments
* by their ID and binds them to a time offset.
*/
struct aiAnimMesh
{
/** Replacement for aiMesh::mVertices. If this array is non-NULL,
* it *must* contain mNumVertices entries. The corresponding
* array in the host mesh must be non-NULL as well - animation
* meshes may neither add or nor remove vertex components (if
* a replacement array is NULL and the corresponding source
* array is not, the source data is taken instead)*/
C_STRUCT aiVector3D* mVertices;
/** Replacement for aiMesh::mNormals. */
C_STRUCT aiVector3D* mNormals;
/** Replacement for aiMesh::mTangents. */
C_STRUCT aiVector3D* mTangents;
/** Replacement for aiMesh::mBitangents. */
C_STRUCT aiVector3D* mBitangents;
/** Replacement for aiMesh::mColors */
C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
/** Replacement for aiMesh::mTextureCoords */
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.
*
* This has always the same value as the mNumVertices property in th
e
* corresponding aiMesh. It is duplicated here merely to make the le
ngth
* of the member arrays accessible even if the aiMesh is not known,
e.g.
* from language bindings.
*/
unsigned int mNumVertices;
#ifdef __cplusplus
aiAnimMesh()
: mVertices()
, mNormals()
, mTangents()
, mBitangents()
{
// fixme consider moving this to the ctor initializer list a
s well
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;
a++){
mTextureCoords[a] = NULL;
}
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a+
+) {
mColors[a] = NULL;
}
}
~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];
}
}
/** Check whether the anim mesh overrides the vertex positions
* of its host mesh*/
bool HasPositions() const {
return mVertices != NULL;
}
/** Check whether the anim mesh overrides the vertex normals
* of its host mesh*/
bool HasNormals() const {
return mNormals != NULL;
}
/** Check whether the anim mesh overrides the vertex tangents
* and bitangents of its host mesh. As for aiMesh,
* tangents and bitangents always go together. */
bool HasTangentsAndBitangents() const {
return mTangents != NULL;
}
/** 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 {
return pIndex >= AI_MAX_NUMBER_OF_COLOR_SETS ? false : mColo
rs[pIndex] != NULL;
}
/** 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 {
return pIndex >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? false : mT
extureCoords[pIndex] != NULL;
}
#endif
};
// ------------------------------------------------------------------------
---
/** @brief A mesh represents a geometry or model with a single material. /** @brief A mesh represents a geometry or model with a single material.
* *
* It usually consists of a number of vertices and a series of primitives/fa ces * It usually consists of a number of vertices and a series of primitives/fa ces
* referencing the vertices. In addition there might be a series of bones, e ach * referencing the vertices. In addition there might be a series of bones, e ach
* of them addressing a number of vertices with a certain weight. Vertex dat a * of them addressing a number of vertices with a certain weight. Vertex dat a
* is presented in channels with each channel containing a single per-vertex * is presented in channels with each channel containing a single per-vertex
* information such as a set of texture coords or a normal vector. * information such as a set of texture coords or a normal vector.
* If a data pointer is non-null, the corresponding data stream is present. * If a data pointer is non-null, the corresponding data stream is present.
* From C++-programs you can also use the comfort functions Has*() to * From C++-programs you can also use the comfort functions Has*() to
* test for the presence of various data streams. * test for the presence of various data streams.
* *
* A Mesh uses only a single material which is referenced by a material ID. * A Mesh uses only a single material which is referenced by a material ID.
* @note The mPositions member is usually not optional. However, vertex posi tions * @note The mPositions member is usually not optional. However, vertex posi tions
* *could* be missing if the AI_SCENE_FLAGS_INCOMPLETE flag is set in * *could* be missing if the #AI_SCENE_FLAGS_INCOMPLETE flag is set in
* @code * @code
* aiScene::mFlags * aiScene::mFlags
* @endcode * @endcode
*/ */
struct aiMesh struct aiMesh
{ {
/** Bitwise combination of the members of the #aiPrimitiveType enum. /** Bitwise combination of the members of the #aiPrimitiveType enum.
* This specifies which types of primitives are present in the mesh. * This specifies which types of primitives are present in the mesh.
* The "SortByPrimitiveType"-Step can be used to make sure the * The "SortByPrimitiveType"-Step can be used to make sure the
* output meshes consist of one primitive type each. * output meshes consist of one primitive type each.
*/ */
unsigned int mPrimitiveTypes; unsigned int mPrimitiveTypes;
/** The number of vertices in this mesh. /** The number of vertices in this mesh.
* This is also the size of all of the per-vertex data arrays * This is also the size of all of the per-vertex data arrays.
* The maximum value for this member is #AI_MAX_VERTICES.
*/ */
unsigned int mNumVertices; unsigned int mNumVertices;
/** The number of primitives (triangles, polygons, lines) in this m esh. /** The number of primitives (triangles, polygons, lines) in this m esh.
* This is also the size of the mFaces array * This is also the size of the mFaces array.
* The maximum value for this member is #AI_MAX_FACES.
*/ */
unsigned int mNumFaces; unsigned int mNumFaces;
/** Vertex positions. /** Vertex positions.
* This array is always present in a mesh. The array is * This array is always present in a mesh. The array is
* mNumVertices in size. * mNumVertices in size.
*/ */
C_STRUCT aiVector3D* mVertices; C_STRUCT aiVector3D* mVertices;
/** Vertex normals. /** Vertex normals.
skipping to change at line 416 skipping to change at line 551
* or cube maps). If the value is 2 for a given channel n, the * or cube maps). If the value is 2 for a given channel n, the
* component p.z of mTextureCoords[n][p] is set to 0.0f. * component p.z of mTextureCoords[n][p] is set to 0.0f.
* If the value is 1 for a given channel, p.y is set to 0.0f, too. * If the value is 1 for a given channel, p.y is set to 0.0f, too.
* @note 4D coords are not supported * @note 4D coords are not supported
*/ */
unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS]; unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
/** The faces the mesh is constructed from. /** The faces the mesh is constructed from.
* Each face refers to a number of vertices by their indices. * Each face refers to a number of vertices by their indices.
* This array is always present in a mesh, its size is given * This array is always present in a mesh, its size is given
* in mNumFaces. If the AI_SCENE_FLAGS_NON_VERBOSE_FORMAT * in mNumFaces. If the #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
* is NOT set each face references an unique set of vertices. * 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. /** The number of bones this mesh contains.
* Can be 0, in which case the mBones array is NULL. * Can be 0, in which case the mBones array is NULL.
*/ */
unsigned int mNumBones; unsigned int mNumBones;
/** The bones of this mesh. /** The bones of this mesh.
skipping to change at line 439 skipping to change at line 574
*/ */
C_STRUCT aiBone** mBones; C_STRUCT aiBone** mBones;
/** The material used by this mesh. /** The material used by this mesh.
* A mesh does use only a single material. If an imported model uses * A mesh does use only a single material. If an imported model uses
* multiple materials, the import splits up the mesh. Use this value * multiple materials, the import splits up the mesh. Use this value
* as index into the scene's material list. * as index into the scene's material list.
*/ */
unsigned int mMaterialIndex; unsigned int mMaterialIndex;
/** Name of the mesh. Meshes can be named, but this is not a
* requirement and leaving this field empty is totally fine.
* There are mainly three uses for mesh names:
* - some formats name nodes and meshes independently.
* - importers tend to split meshes up to meet the
* one-material-per-mesh requirement. Assigning
* the same (dummy) name to each of the result meshes
* aids the caller at recovering the original mesh
* partitioning.
* - Vertex animations refer to meshes by their names.
**/
C_STRUCT aiString mName;
/** NOT CURRENTLY IN USE. The number of attachment meshes */
unsigned int mNumAnimMeshes;
/** NOT CURRENTLY IN USE. Attachment meshes for this mesh, for verte
x-based animation.
* Attachment meshes carry replacement data for some of the
* mesh'es vertex components (usually positions, normals). */
C_STRUCT aiAnimMesh** mAnimMeshes;
#ifdef __cplusplus #ifdef __cplusplus
//! Default constructor. Initializes all members to 0 //! Default constructor. Initializes all members to 0
aiMesh() aiMesh()
{ {
mNumVertices = 0; mNumVertices = 0;
mNumFaces = 0; mNumFaces = 0;
mNumAnimMeshes = 0;
mPrimitiveTypes = 0; mPrimitiveTypes = 0;
mVertices = NULL; mFaces = NULL; mVertices = NULL; mFaces = NULL;
mNormals = NULL; mTangents = NULL; mNormals = NULL; mTangents = NULL;
mBitangents = NULL; mBitangents = NULL;
mAnimMeshes = NULL;
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++)
{ {
mNumUVComponents[a] = 0; mNumUVComponents[a] = 0;
mTextureCoords[a] = NULL; mTextureCoords[a] = NULL;
} }
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] = NULL; mColors[a] = NULL;
mNumBones = 0; mBones = NULL; mNumBones = 0; mBones = NULL;
mMaterialIndex = 0; mMaterialIndex = 0;
} }
//! Deletes all storage allocated for the mesh //! Deletes all storage allocated for the mesh
~aiMesh() ~aiMesh()
{ {
delete [] mVertices; delete [] mVertices;
delete [] mNormals; delete [] mNormals;
delete [] mTangents; delete [] mTangents;
delete [] mBitangents; delete [] mBitangents;
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
delete [] mTextureCoords[a]; delete [] mTextureCoords[a];
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+
+) {
delete [] mColors[a]; delete [] mColors[a];
) <span class="insert">{</span>
}
// DO NOT REMOVE THIS ADDITIONAL CHECK // DO NOT REMOVE THIS ADDITIONAL CHECK
if (mNumBones && mBones) if (mNumBones && mBones) {
{ for( unsigned int a = 0; a < mNumBones; a++) {
for( unsigned int a = 0; a < mNumBones; a++)
delete mBones[a]; delete mBones[a];
}
delete [] mBones; delete [] mBones;
} }
if (mNumAnimMeshes && mAnimMeshes) {
for( unsigned int a = 0; a < mNumAnimMeshes; a++) {
delete mAnimMeshes[a];
}
delete [] mAnimMeshes;
}
delete [] mFaces; delete [] mFaces;
} }
//! Check whether the mesh contains positions. If no special scene f //! Check whether the mesh contains positions. Provided no special
lags //! scene flags are set (such as #AI_SCENE_FLAGS_ANIM_SKELETON_ONLY)
//! (such as AI_SCENE_FLAGS_ANIM_SKELETON_ONLY) are set this will ,
//! always return true //! this will always be true
bool HasPositions() const bool HasPositions() const
{ return mVertices != NULL && mNumVertices > 0; } { return mVertices != NULL && mNumVertices > 0; }
//! Check whether the mesh contains faces. If no special scene flags //! Check whether the mesh contains faces. If no special scene flags
//! are set this should always return true //! are set this should always return true
bool HasFaces() const bool HasFaces() const
{ return mFaces != NULL && mNumFaces > 0; } { return mFaces != NULL && mNumFaces > 0; }
//! Check whether the mesh contains normal vectors //! Check whether the mesh contains normal vectors
bool HasNormals() const bool HasNormals() const
 End of changes. 19 change blocks. 
48 lines changed or deleted 233 lines changed or added


 aiTypes.h   aiTypes.h 
skipping to change at line 85 skipping to change at line 85
* *
* By doing this you can safely share class objects between Assimp * By doing this you can safely share class objects between Assimp
* and the application - it works even over DLL boundaries. A good * and the application - it works even over DLL boundaries. A good
* example is the #IOSystem where the application allocates its cust om * example is the #IOSystem where the application allocates its cust om
* #IOSystem, then calls #Importer::SetIOSystem(). When the Importer * #IOSystem, then calls #Importer::SetIOSystem(). When the Importer
* destructs, Assimp calls operator delete on the stored #IOSystem. * destructs, Assimp calls operator delete on the stored #IOSystem.
* If it lies on a different heap than Assimp is working with, * If it lies on a different heap than Assimp is working with,
* the application is determined to crash. * the application is determined to crash.
*/ */
// ----------------------------------------------------------------- --- // ----------------------------------------------------------------- ---
#ifndef SWIG
struct ASSIMP_API AllocateFromAssimpHeap { struct ASSIMP_API AllocateFromAssimpHeap {
// http://www.gotw.ca/publications/mill15.htm // http://www.gotw.ca/publications/mill15.htm
// new/delete overload // new/delete overload
void *operator new ( size_t num_bytes) /* throw( std::bad _alloc ) */; 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 new ( size_t num_bytes, const std::nothrow _t& ) throw();
void operator delete ( void* data); void operator delete ( void* data);
// array new/delete overload // array new/delete overload
void *operator new[] ( size_t num_bytes) /* throw( std::b ad_alloc ) */; void *operator new[] ( size_t num_bytes) /* throw( std::b ad_alloc ) */;
void *operator new[] ( size_t num_bytes, const std::nothr ow_t& ) throw(); void *operator new[] ( size_t num_bytes, const std::nothr ow_t& ) throw();
void operator delete[] ( void* data); void operator delete[] ( void* data);
}; // struct AllocateFromAssimpHeap }; // struct AllocateFromAssimpHeap
#endif
} // namespace Intern } // namespace Intern
//! @endcond //! @endcond
} // namespace Assimp } // namespace Assimp
extern "C" { extern "C" {
#endif #endif
/** Maximum dimension for strings, ASSIMP strings are zero terminated. */ /** Maximum dimension for strings, ASSIMP strings are zero terminated. */
#ifdef __cplusplus #ifdef __cplusplus
const size_t MAXLEN = 1024; const size_t MAXLEN = 1024;
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/