diff options
Diffstat (limited to 'src/3rdparty/assimp/code/ColladaHelper.h')
-rw-r--r-- | src/3rdparty/assimp/code/ColladaHelper.h | 101 |
1 files changed, 55 insertions, 46 deletions
diff --git a/src/3rdparty/assimp/code/ColladaHelper.h b/src/3rdparty/assimp/code/ColladaHelper.h index 130363186..e691a6062 100644 --- a/src/3rdparty/assimp/code/ColladaHelper.h +++ b/src/3rdparty/assimp/code/ColladaHelper.h @@ -4,7 +4,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -43,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLLADAHELPER_H_INC #define AI_COLLADAHELPER_H_INC -#include <string> #include <map> #include <vector> #include <stdint.h> @@ -103,12 +103,13 @@ enum MorphMethod Relative }; + /** Contains all data for one of the different transformation types */ struct Transform { std::string mID; ///< SID of the transform step, by which anim channels address their target node TransformType mType; - float f[16]; ///< Interpretation of data depends on the type of the transformation + ai_real f[16]; ///< Interpretation of data depends on the type of the transformation }; /** A collada camera. */ @@ -130,16 +131,16 @@ struct Camera bool mOrtho; //! Horizontal field of view in degrees - float mHorFov; + ai_real mHorFov; //! Vertical field of view in degrees - float mVerFov; + ai_real mVerFov; //! Screen aspect - float mAspect; + ai_real mAspect; //! Near& far z - float mZNear, mZFar; + ai_real mZNear, mZFar; }; #define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f @@ -166,21 +167,21 @@ struct Light aiColor3D mColor; //! Light attenuation - float mAttConstant,mAttLinear,mAttQuadratic; + ai_real mAttConstant,mAttLinear,mAttQuadratic; //! Spot light falloff - float mFalloffAngle; - float mFalloffExponent; + ai_real mFalloffAngle; + ai_real mFalloffExponent; // ----------------------------------------------------- // FCOLLADA extension from here //! ... related stuff from maja and max extensions - float mPenumbraAngle; - float mOuterAngle; + ai_real mPenumbraAngle; + ai_real mOuterAngle; //! Common light intensity - float mIntensity; + ai_real mIntensity; }; /** Short vertex index description */ @@ -289,7 +290,7 @@ struct Node struct Data { bool mIsStringArray; - std::vector<float> mValues; + std::vector<ai_real> mValues; std::vector<std::string> mStrings; }; @@ -301,7 +302,7 @@ struct Accessor size_t mOffset; // in number of values size_t mStride; // Stride in number of values std::vector<std::string> mParams; // names of the data streams in the accessors. Empty string tells to ignore. - size_t mSubOffset[4]; // Suboffset inside the object for the common 4 elements. For a vector, thats XYZ, for a color RGBA and so on. + size_t mSubOffset[4]; // Suboffset inside the object for the common 4 elements. For a vector, that's XYZ, for a color RGBA and so on. // For example, SubOffset[0] denotes which of the values inside the object is the vector X component. std::string mSource; // URL of the source array mutable const Data* mData; // Pointer to the source array, if resolved. NULL else @@ -391,7 +392,7 @@ enum PrimitiveType Prim_Polygon }; -/** A skeleton or morph controller to deform a mesh with the use of joints or morph targets */ +/** A skeleton controller to deform a mesh with the use of joints */ struct Controller { // controller type @@ -400,14 +401,14 @@ struct Controller // Morphing method if type is Morph MorphMethod mMethod; - // the URL of the mesh deformed by the controller. - std::string mMeshId; + // the URL of the mesh deformed by the controller. + std::string mMeshId; // accessor URL of the joint names std::string mJointNameSource; ///< The bind shape matrix, as array of floats. I'm not sure what this matrix actually describes, but it can't be ignored in all cases - float mBindShapeMatrix[16]; + ai_real mBindShapeMatrix[16]; // accessor URL of the joint inverse bind matrices std::string mJointOffsetMatrixSource; @@ -420,8 +421,8 @@ struct Controller // Number of weights per vertex. std::vector<size_t> mWeightCounts; - // JointIndex-WeightIndex pairs for all vertices - std::vector< std::pair<size_t, size_t> > mWeights; + // JointIndex-WeightIndex pairs for all vertices + std::vector< std::pair<size_t, size_t> > mWeights; std::string mMorphTarget; std::string mMorphWeight; @@ -513,11 +514,11 @@ struct Sampler /** Weighting factor */ - float mWeighting; + ai_real mWeighting; /** Mixing factor from OKINO */ - float mMixWithPrevious; + ai_real mMixWithPrevious; }; /** A collada effect. Can contain about anything according to the Collada spec, @@ -536,8 +537,8 @@ struct Effect mTexTransparent, mTexBump, mTexReflective; // Scalar factory - float mShininess, mRefractIndex, mReflectivity; - float mTransparency; + ai_real mShininess, mRefractIndex, mReflectivity; + ai_real mTransparency; bool mHasTransparency; bool mRGBTransparency; bool mInvertTransparency; @@ -591,21 +592,21 @@ struct Image /** An animation channel. */ struct AnimationChannel { - /** URL of the data to animate. Could be about anything, but we support only the - * "NodeID/TransformID.SubElement" notation - */ - std::string mTarget; + /** URL of the data to animate. Could be about anything, but we support only the + * "NodeID/TransformID.SubElement" notation + */ + std::string mTarget; - /** Source URL of the time values. Collada calls them "input". Meh. */ - std::string mSourceTimes; - /** Source URL of the value values. Collada calls them "output". */ - std::string mSourceValues; - /** Source URL of the IN_TANGENT semantic values. */ - std::string mInTanValues; - /** Source URL of the OUT_TANGENT semantic values. */ - std::string mOutTanValues; - /** Source URL of the INTERPOLATION semantic values. */ - std::string mInterpolationValues; + /** Source URL of the time values. Collada calls them "input". Meh. */ + std::string mSourceTimes; + /** Source URL of the value values. Collada calls them "output". */ + std::string mSourceValues; + /** Source URL of the IN_TANGENT semantic values. */ + std::string mInTanValues; + /** Source URL of the OUT_TANGENT semantic values. */ + std::string mOutTanValues; + /** Source URL of the INTERPOLATION semantic values. */ + std::string mInterpolationValues; }; /** An animation. Container for 0-x animation channels or 0-x animations */ @@ -679,13 +680,21 @@ struct ChannelEntry size_t mTransformIndex; // Index into the node's transform chain to apply the channel to size_t mSubElement; // starting index inside the transform data - // resolved data references - const Collada::Accessor* mTimeAccessor; ///> Collada accessor to the time values - const Collada::Data* mTimeData; ///> Source data array for the time values - const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values - const Collada::Data* mValueData; ///> Source datat array for the key value values - - ChannelEntry() { mChannel = NULL; mSubElement = 0; } + // resolved data references + const Collada::Accessor* mTimeAccessor; ///> Collada accessor to the time values + const Collada::Data* mTimeData; ///> Source data array for the time values + const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values + const Collada::Data* mValueData; ///> Source datat array for the key value values + + ChannelEntry() + : mChannel() + , mTransformIndex() + , mSubElement() + , mTimeAccessor() + , mTimeData() + , mValueAccessor() + , mValueData() + {} }; } // end of namespace Collada |