|
@@ -2,7 +2,8 @@
|
|
Open Asset Import Library (assimp)
|
|
Open Asset Import Library (assimp)
|
|
----------------------------------------------------------------------
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
-Copyright (c) 2006-2017, assimp team
|
|
|
|
|
|
+Copyright (c) 2006-2018, assimp team
|
|
|
|
+
|
|
|
|
|
|
All rights reserved.
|
|
All rights reserved.
|
|
|
|
|
|
@@ -168,15 +169,7 @@ struct Face : public FaceWithSmoothingGroup
|
|
struct Bone
|
|
struct Bone
|
|
{
|
|
{
|
|
//! Constructor
|
|
//! Constructor
|
|
- Bone()
|
|
|
|
- {
|
|
|
|
- static int iCnt = 0;
|
|
|
|
-
|
|
|
|
- // Generate a default name for the bone
|
|
|
|
- char szTemp[128];
|
|
|
|
- ::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
|
|
|
|
- mName = szTemp;
|
|
|
|
- }
|
|
|
|
|
|
+ Bone() = delete;
|
|
|
|
|
|
//! Construction from an existing name
|
|
//! Construction from an existing name
|
|
explicit Bone( const std::string& name)
|
|
explicit Bone( const std::string& name)
|
|
@@ -256,22 +249,19 @@ struct BaseNode
|
|
{
|
|
{
|
|
enum Type {Light, Camera, Mesh, Dummy} mType;
|
|
enum Type {Light, Camera, Mesh, Dummy} mType;
|
|
|
|
|
|
- //! Constructor. Creates a default name for the node
|
|
|
|
- explicit BaseNode(Type _mType)
|
|
|
|
- : mType (_mType)
|
|
|
|
- , mProcessed (false)
|
|
|
|
- {
|
|
|
|
- // generate a default name for the node
|
|
|
|
- static int iCnt = 0;
|
|
|
|
- char szTemp[128]; // should be sufficiently large
|
|
|
|
- ::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
|
|
|
|
- mName = szTemp;
|
|
|
|
|
|
|
|
|
|
+ //! Construction from an existing name
|
|
|
|
+ BaseNode(Type _mType, const std::string &name)
|
|
|
|
+ : mType (_mType)
|
|
|
|
+ , mName (name)
|
|
|
|
+ , mProcessed (false)
|
|
|
|
+ {
|
|
// Set mTargetPosition to qnan
|
|
// Set mTargetPosition to qnan
|
|
const ai_real qnan = get_qnan();
|
|
const ai_real qnan = get_qnan();
|
|
mTargetPosition.x = qnan;
|
|
mTargetPosition.x = qnan;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
//! Name of the mesh
|
|
//! Name of the mesh
|
|
std::string mName;
|
|
std::string mName;
|
|
|
|
|
|
@@ -303,19 +293,22 @@ struct BaseNode
|
|
/** Helper structure to represent an ASE file mesh */
|
|
/** Helper structure to represent an ASE file mesh */
|
|
struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
|
|
struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
|
|
{
|
|
{
|
|
- //! Constructor.
|
|
|
|
- Mesh()
|
|
|
|
- : BaseNode (BaseNode::Mesh)
|
|
|
|
- , bSkip (false)
|
|
|
|
|
|
+ //! Default constructor has been deleted
|
|
|
|
+ Mesh() = delete;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //! Construction from an existing name
|
|
|
|
+ explicit Mesh(const std::string &name)
|
|
|
|
+ : BaseNode (BaseNode::Mesh, name)
|
|
|
|
+ , iMaterialIndex(Face::DEFAULT_MATINDEX)
|
|
|
|
+ , bSkip (false)
|
|
{
|
|
{
|
|
// use 2 texture vertex components by default
|
|
// use 2 texture vertex components by default
|
|
for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
|
|
for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
|
|
this->mNumUVComponents[c] = 2;
|
|
this->mNumUVComponents[c] = 2;
|
|
-
|
|
|
|
- // setup the default material index by default
|
|
|
|
- iMaterialIndex = Face::DEFAULT_MATINDEX;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
//! List of all texture coordinate sets
|
|
//! List of all texture coordinate sets
|
|
std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
|
|
std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
|
|
|
|
|
|
@@ -350,17 +343,21 @@ struct Light : public BaseNode
|
|
DIRECTIONAL
|
|
DIRECTIONAL
|
|
};
|
|
};
|
|
|
|
|
|
- //! Constructor.
|
|
|
|
- Light()
|
|
|
|
- : BaseNode (BaseNode::Light)
|
|
|
|
- , mLightType (OMNI)
|
|
|
|
- , mColor (1.f,1.f,1.f)
|
|
|
|
- , mIntensity (1.f) // light is white by default
|
|
|
|
- , mAngle (45.f)
|
|
|
|
- , mFalloff (0.f)
|
|
|
|
|
|
+ //! Default constructor has been deleted
|
|
|
|
+ Light() = delete;
|
|
|
|
+
|
|
|
|
+ //! Construction from an existing name
|
|
|
|
+ explicit Light(const std::string &name)
|
|
|
|
+ : BaseNode (BaseNode::Light, name)
|
|
|
|
+ , mLightType (OMNI)
|
|
|
|
+ , mColor (1.f,1.f,1.f)
|
|
|
|
+ , mIntensity (1.f) // light is white by default
|
|
|
|
+ , mAngle (45.f)
|
|
|
|
+ , mFalloff (0.f)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
LightType mLightType;
|
|
LightType mLightType;
|
|
aiColor3D mColor;
|
|
aiColor3D mColor;
|
|
ai_real mIntensity;
|
|
ai_real mIntensity;
|
|
@@ -378,16 +375,21 @@ struct Camera : public BaseNode
|
|
TARGET
|
|
TARGET
|
|
};
|
|
};
|
|
|
|
|
|
- //! Constructor
|
|
|
|
- Camera()
|
|
|
|
- : BaseNode (BaseNode::Camera)
|
|
|
|
- , mFOV (0.75f) // in radians
|
|
|
|
- , mNear (0.1f)
|
|
|
|
- , mFar (1000.f) // could be zero
|
|
|
|
- , mCameraType (FREE)
|
|
|
|
|
|
+ //! Default constructor has been deleted
|
|
|
|
+ Camera() = delete;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //! Construction from an existing name
|
|
|
|
+ explicit Camera(const std::string &name)
|
|
|
|
+ : BaseNode (BaseNode::Camera, name)
|
|
|
|
+ , mFOV (0.75f) // in radians
|
|
|
|
+ , mNear (0.1f)
|
|
|
|
+ , mFar (1000.f) // could be zero
|
|
|
|
+ , mCameraType (FREE)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
ai_real mFOV, mNear, mFar;
|
|
ai_real mFOV, mNear, mFar;
|
|
CameraType mCameraType;
|
|
CameraType mCameraType;
|
|
};
|
|
};
|
|
@@ -398,7 +400,7 @@ struct Dummy : public BaseNode
|
|
{
|
|
{
|
|
//! Constructor
|
|
//! Constructor
|
|
Dummy()
|
|
Dummy()
|
|
- : BaseNode (BaseNode::Dummy)
|
|
|
|
|
|
+ : BaseNode (BaseNode::Dummy, "DUMMY")
|
|
{
|
|
{
|
|
}
|
|
}
|
|
};
|
|
};
|