Compare commits
45 Commits
master
...
iamAdrianI
Author | SHA1 | Date |
---|---|---|
Kim Kulling | 1607c8e6e0 | |
Kim Kulling | 08f945b7ec | |
Kim Kulling | 608e3102a0 | |
Kim Kulling | 0be78e0ca3 | |
kimkulling | 81c15b38ae | |
Adrian Iusca | 85114117d1 | |
iamAdrianIusca | d527939881 | |
iamAdrianIusca | 5b7e9ccb5f | |
Adrian Iusca | 40b611b478 | |
iamAdrianIusca | f1817598b0 | |
iamAdrianIusca | d777070eb1 | |
iamAdrianIusca | d02be05862 | |
iamAdrianIusca | a77a18693d | |
iamAdrianIusca | 1450b5b29c | |
iamAdrianIusca | f8024188f0 | |
iamAdrianIusca | 798f6cf083 | |
iamAdrianIusca | efa6ead1a5 | |
iamAdrianIusca | 74931fe6d9 | |
iamAdrianIusca | bcd86ccc76 | |
iamAdrianIusca | e5f69d55bb | |
iamAdrianIusca | 871f3fd337 | |
iamAdrianIusca | 287030e720 | |
Adrian Iusca | 5ec896af49 | |
Kim Kulling | 5eeea82793 | |
Adrian Iusca | 951ec9e0d9 | |
Adrian Iusca | c45a168839 | |
Adrian Iusca | 3bf62cf6e4 | |
Adrian Iusca | df8511e1b0 | |
Adrian Iusca | b4c97f3903 | |
Adrian Iusca | 47e05470ff | |
Adrian Iusca | 6e13baf89c | |
iamAdrianIusca | 691dfe7012 | |
iamAdrianIusca | 18cb5745bc | |
iamAdrianIusca | 8f41516637 | |
iamAdrianIusca | 051d01e339 | |
Adrian Iusca | 067677595c | |
iamAdrianIusca | 66288df49b | |
iamAdrianIusca | ffaa3629d8 | |
Adrian Iusca | ec61318443 | |
iamAdrianIusca | 0d8434ed34 | |
iamAdrianIusca | 2917ab04b7 | |
iamAdrianIusca | 89ca66f300 | |
iamAdrianIusca | 1f4b99479d | |
iamAdrianIusca | 3bef9382bb | |
iamAdrianIusca | aca6aaf35d |
|
@ -74,15 +74,13 @@ struct Face {
|
|||
Material *m_pMaterial;
|
||||
|
||||
//! \brief Default constructor
|
||||
Face(aiPrimitiveType pt = aiPrimitiveType_POLYGON) :
|
||||
explicit Face(aiPrimitiveType pt = aiPrimitiveType_POLYGON) :
|
||||
m_PrimitiveType(pt), m_vertices(), m_normals(), m_texturCoords(), m_pMaterial(0L) {
|
||||
// empty
|
||||
}
|
||||
|
||||
//! \brief Destructor
|
||||
~Face() {
|
||||
// empty
|
||||
}
|
||||
~Face() = default;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -296,19 +294,16 @@ struct Model {
|
|||
it != m_Objects.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
m_Objects.clear();
|
||||
|
||||
// Clear all stored mesh instances
|
||||
for (std::vector<Mesh *>::iterator it = m_Meshes.begin();
|
||||
it != m_Meshes.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
m_Meshes.clear();
|
||||
|
||||
for (GroupMapIt it = m_Groups.begin(); it != m_Groups.end(); ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
m_Groups.clear();
|
||||
|
||||
for (std::map<std::string, Material *>::iterator it = m_MaterialMap.begin(); it != m_MaterialMap.end(); ++it) {
|
||||
delete it->second;
|
||||
|
|
|
@ -60,6 +60,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <list>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <cctype>
|
||||
#include <utility>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
|
|
@ -129,14 +129,8 @@ ImporterPimpl::ImporterPimpl() AI_NO_EXCEPT
|
|||
, mIsDefaultHandler( false )
|
||||
, mProgressHandler( nullptr )
|
||||
, mIsDefaultProgressHandler( false )
|
||||
, mImporter()
|
||||
, mPostProcessingSteps()
|
||||
, mScene( nullptr )
|
||||
, mErrorString()
|
||||
, mIntProperties()
|
||||
, mFloatProperties()
|
||||
, mStringProperties()
|
||||
, mMatrixProperties()
|
||||
, bExtraVerbose( false )
|
||||
, mPPShared( nullptr ) {
|
||||
// empty
|
||||
|
|
|
@ -66,10 +66,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
namespace Assimp {
|
||||
|
||||
// clang-format off
|
||||
#if (__GNUC__ >= 8 && __GNUC_MINOR__ >= 0)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Add a prefix to a string
|
||||
|
@ -495,7 +497,7 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
OffsetNodeMeshIndices(node, offset[n]);
|
||||
}
|
||||
if (n) // src[0] is the master node
|
||||
nodes.push_back(NodeAttachmentInfo(node, srcList[n - 1].attachToNode, n));
|
||||
nodes.emplace_back( node,srcList[n-1].attachToNode,n );
|
||||
|
||||
// add name prefixes?
|
||||
if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES) {
|
||||
|
@ -1331,8 +1333,10 @@ void SceneCombiner::Copy(aiMetadata **_dest, const aiMetadata *src) {
|
|||
}
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
#if (__GNUC__ >= 8 && __GNUC_MINOR__ >= 0)
|
||||
#pragma GCC diagnostic pop
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
} // Namespace Assimp
|
||||
|
|
|
@ -57,7 +57,7 @@ SkeletonMeshBuilder::SkeletonMeshBuilder(aiScene *pScene, aiNode *root, bool bKn
|
|||
return;
|
||||
}
|
||||
|
||||
if (!root) {
|
||||
if (nullptr != root) {
|
||||
root = pScene->mRootNode;
|
||||
}
|
||||
|
||||
|
@ -251,8 +251,8 @@ aiMaterial *SkeletonMeshBuilder::CreateMaterial() {
|
|||
aiMaterial *matHelper = new aiMaterial;
|
||||
|
||||
// Name
|
||||
aiString matName(std::string("SkeletonMaterial"));
|
||||
matHelper->AddProperty(&matName, AI_MATKEY_NAME);
|
||||
aiString matName("SkeletonMaterial");
|
||||
matHelper->AddProperty( &matName, AI_MATKEY_NAME);
|
||||
|
||||
// Prevent backface culling
|
||||
const int no_cull = 1;
|
||||
|
|
|
@ -101,7 +101,7 @@ void SpatialSort::Append(const aiVector3D *pPositions, unsigned int pNumPosition
|
|||
|
||||
// store position by index and distance
|
||||
ai_real distance = *vec * mPlaneNormal;
|
||||
mPositions.push_back(Entry(static_cast<unsigned int>(a + initial), *vec, distance));
|
||||
mPositions.emplace_back(Entry(static_cast<unsigned int>(a + initial), *vec, distance));
|
||||
}
|
||||
|
||||
if (pFinalize) {
|
||||
|
@ -121,7 +121,7 @@ void SpatialSort::FindPositions(const aiVector3D &pPosition,
|
|||
poResults.clear();
|
||||
|
||||
// quick check for positions outside the range
|
||||
if (mPositions.size() == 0)
|
||||
if( mPositions.empty())
|
||||
return;
|
||||
if (maxDist < mPositions.front().mDistance)
|
||||
return;
|
||||
|
|
|
@ -423,17 +423,18 @@ void StandardShapes::MakeCone(ai_real height, ai_real radius1,
|
|||
|
||||
if (!bOpen) {
|
||||
// generate the end 'cap'
|
||||
positions.push_back(aiVector3D(s * radius2, halfHeight, t * radius2));
|
||||
positions.push_back(aiVector3D(s2 * radius2, halfHeight, t2 * radius2));
|
||||
positions.push_back(aiVector3D(0.0, halfHeight, 0.0));
|
||||
positions.emplace_back(s * radius2, halfHeight, t * radius2 );
|
||||
positions.emplace_back(s2 * radius2, halfHeight, t2 * radius2 );
|
||||
positions.emplace_back(ai_real(0.0), halfHeight, ai_real(0.0));
|
||||
|
||||
if (radius1) {
|
||||
// generate the other end 'cap'
|
||||
positions.push_back(aiVector3D(s * radius1, -halfHeight, t * radius1));
|
||||
positions.push_back(aiVector3D(s2 * radius1, -halfHeight, t2 * radius1));
|
||||
positions.push_back(aiVector3D(0.0, -halfHeight, 0.0));
|
||||
positions.emplace_back(s * radius1, -halfHeight, t * radius1 );
|
||||
positions.emplace_back(s2 * radius1, -halfHeight, t2 * radius1 );
|
||||
positions.emplace_back(ai_real(0.0), -halfHeight, ai_real(0.0));
|
||||
}
|
||||
}
|
||||
|
||||
s = s2;
|
||||
t = t2;
|
||||
angle = next;
|
||||
|
@ -467,13 +468,13 @@ void StandardShapes::MakeCircle(ai_real radius, unsigned int tess,
|
|||
ai_real t = 0.0; // std::sin(angle == 0);
|
||||
|
||||
for (ai_real angle = 0.0; angle < angle_max;) {
|
||||
positions.push_back(aiVector3D(s * radius, 0.0, t * radius));
|
||||
positions.emplace_back(aiVector3D(s * radius, 0.0, t * radius));
|
||||
angle += angle_delta;
|
||||
s = std::cos(angle);
|
||||
t = std::sin(angle);
|
||||
positions.push_back(aiVector3D(s * radius, 0.0, t * radius));
|
||||
positions.emplace_back(aiVector3D(s * radius, 0.0, t * radius));
|
||||
|
||||
positions.push_back(aiVector3D(0.0, 0.0, 0.0));
|
||||
positions.emplace_back(aiVector3D(0.0, 0.0, 0.0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ void TargetAnimationHelper::Process(std::vector<aiVectorKey> *distanceTrack) {
|
|||
// diff is now the vector in which our camera is pointing
|
||||
}
|
||||
|
||||
if (real.size()) {
|
||||
if (!real.empty()) {
|
||||
*distanceTrack = real;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,10 +51,10 @@ using namespace Assimp;
|
|||
|
||||
namespace {
|
||||
|
||||
const static aiVector3D base_axis_y(0.0,1.0,0.0);
|
||||
const static aiVector3D base_axis_x(1.0,0.0,0.0);
|
||||
const static aiVector3D base_axis_z(0.0,0.0,1.0);
|
||||
const static ai_real angle_epsilon = ai_real( 0.95 );
|
||||
const aiVector3D base_axis_y(0.0,1.0,0.0);
|
||||
const aiVector3D base_axis_x(1.0,0.0,0.0);
|
||||
const aiVector3D base_axis_z(0.0,0.0,1.0);
|
||||
const ai_real angle_epsilon = ai_real( 0.95 );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
// internal headers of the post-processing framework
|
||||
#include "ProcessHelper.h"
|
||||
#include "DeboneProcess.h"
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
@ -83,7 +83,7 @@ bool DeboneProcess::IsActive( unsigned int pFlags) const
|
|||
void DeboneProcess::SetupProperties(const Importer* pImp)
|
||||
{
|
||||
// get the current value of the property
|
||||
mAllOrNone = pImp->GetPropertyInteger(AI_CONFIG_PP_DB_ALL_OR_NONE,0)?true:false;
|
||||
mAllOrNone = pImp->GetPropertyInteger(AI_CONFIG_PP_DB_ALL_OR_NONE, 0) != 0;
|
||||
mThreshold = pImp->GetPropertyFloat(AI_CONFIG_PP_DB_THRESHOLD,AI_DEBONE_THRESHOLD);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ void DeboneProcess::Execute( aiScene* pScene)
|
|||
|
||||
int numSplits = 0;
|
||||
|
||||
if(!!mNumBonesCanDoWithout && (!mAllOrNone||mNumBonesCanDoWithout==mNumBones)) {
|
||||
if(mNumBonesCanDoWithout != 0 && (!mAllOrNone || mNumBonesCanDoWithout == mNumBones)) {
|
||||
for(unsigned int a = 0; a < pScene->mNumMeshes; a++) {
|
||||
if(splitList[a]) {
|
||||
numSplits++;
|
||||
|
@ -156,7 +156,7 @@ void DeboneProcess::Execute( aiScene* pScene)
|
|||
}
|
||||
else {
|
||||
// Mesh is kept unchanged - store it's new place in the mesh array
|
||||
mSubMeshIndices[a].push_back(std::pair<unsigned int,aiNode*>(static_cast<unsigned int>(meshes.size()),(aiNode*)0));
|
||||
mSubMeshIndices[a].emplace_back(static_cast<unsigned int>(meshes.size()),(aiNode*)0);
|
||||
meshes.push_back(srcMesh);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ inline const char *ValidateArrayContents<aiVector3D>(const aiVector3D *arr, unsi
|
|||
unsigned int cnt = 0;
|
||||
for (unsigned int i = 0; i < size; ++i) {
|
||||
|
||||
if (dirtyMask.size() && dirtyMask[i]) {
|
||||
if (!dirtyMask.empty() && dirtyMask[i]) {
|
||||
continue;
|
||||
}
|
||||
++cnt;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -423,7 +423,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
|
|||
ASSIMP_LOG_ERROR( "X-Export: aiBone shall contain weights, but pointer to them is nullptr." );
|
||||
}
|
||||
|
||||
if (newWeights.size() > 0) {
|
||||
if (!newWeights.empty()) {
|
||||
// kill the old and replace them with the translated weights
|
||||
delete [] bone->mWeights;
|
||||
bone->mNumWeights = (unsigned int)newWeights.size();
|
||||
|
|
|
@ -55,22 +55,19 @@ using namespace Assimp;
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor to be privately used by Importer
|
||||
LimitBoneWeightsProcess::LimitBoneWeightsProcess()
|
||||
{
|
||||
LimitBoneWeightsProcess::LimitBoneWeightsProcess() {
|
||||
mMaxWeights = AI_LMW_MAX_WEIGHTS;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor, private as well
|
||||
LimitBoneWeightsProcess::~LimitBoneWeightsProcess()
|
||||
{
|
||||
LimitBoneWeightsProcess::~LimitBoneWeightsProcess() {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns whether the processing step is present in the given flag field.
|
||||
bool LimitBoneWeightsProcess::IsActive( unsigned int pFlags) const
|
||||
{
|
||||
bool LimitBoneWeightsProcess::IsActive(unsigned int pFlags) const {
|
||||
return (pFlags & aiProcess_LimitBoneWeights) != 0;
|
||||
}
|
||||
|
||||
|
@ -89,10 +86,9 @@ void LimitBoneWeightsProcess::Execute( aiScene* pScene)
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Executes the post processing step on the given imported data.
|
||||
void LimitBoneWeightsProcess::SetupProperties(const Importer* pImp)
|
||||
{
|
||||
void LimitBoneWeightsProcess::SetupProperties(const Importer *pImp) {
|
||||
// get the current value of the property
|
||||
this->mMaxWeights = pImp->GetPropertyInteger(AI_CONFIG_PP_LBW_MAX_WEIGHTS,AI_LMW_MAX_WEIGHTS);
|
||||
this->mMaxWeights = pImp->GetPropertyInteger(AI_CONFIG_PP_LBW_MAX_WEIGHTS, AI_LMW_MAX_WEIGHTS);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -140,7 +140,7 @@ void OptimizeMeshesProcess::Execute( aiScene* pScene)
|
|||
|
||||
// and process all nodes in the scenegraph recursively
|
||||
ProcessNode(pScene->mRootNode);
|
||||
if (!output.size()) {
|
||||
if (output.empty()) {
|
||||
throw DeadlyImportError("OptimizeMeshes: No meshes remaining; there's definitely something wrong");
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -63,7 +62,7 @@ void ConvertListToStrings(const std::string &in, std::list<std::string> &out) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
out.push_back(std::string(base, (size_t)(s - base)));
|
||||
out.emplace_back(base,(size_t)(s-base));
|
||||
++s;
|
||||
} else {
|
||||
out.push_back(GetNextToken(s));
|
||||
|
|
|
@ -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,
|
||||
|
@ -269,7 +267,7 @@ void SortByPTypeProcess::Execute(aiScene *pScene) {
|
|||
VertexWeightTable &tbl = avw[idx];
|
||||
for (VertexWeightTable::const_iterator it = tbl.begin(), end = tbl.end();
|
||||
it != end; ++it) {
|
||||
tempBones[(*it).first].push_back(aiVertexWeight(outIdx, (*it).second));
|
||||
tempBones[(*it).first].emplace_back(aiVertexWeight(outIdx, (*it).second));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -316,13 +316,13 @@ void SplitLargeMeshesProcess_Triangle::SplitMesh(
|
|||
}
|
||||
|
||||
// add the newly created mesh to the list
|
||||
avList.push_back(std::pair<aiMesh*, unsigned int>(pcMesh,a));
|
||||
avList.emplace_back(pcMesh,a);
|
||||
}
|
||||
|
||||
// now delete the old mesh data
|
||||
delete pMesh;
|
||||
} else {
|
||||
avList.push_back(std::pair<aiMesh*, unsigned int>(pMesh,a));
|
||||
avList.emplace_back(pMesh,a);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
|
|||
aiFace& face = pMesh->mFaces[a];
|
||||
|
||||
unsigned int* idx = face.mIndices;
|
||||
int num = (int)face.mNumIndices, ear = 0, tmp, prev = num-1, next = 0, max = num;
|
||||
int num = (int)face.mNumIndices, ear, tmp, prev = num - 1, next = 0, max = num;
|
||||
|
||||
// Apply vertex colors to represent the face winding?
|
||||
#ifdef AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
|
||||
|
@ -476,7 +476,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
|
|||
|
||||
for(aiFace* f = last_face; f != curOut; ++f) {
|
||||
unsigned int* i = f->mIndices;
|
||||
fprintf(fout," (%i %i %i)",i[0],i[1],i[2]);
|
||||
fprintf(fout," (%u %u %u)",i[0],i[1],i[2]);
|
||||
}
|
||||
|
||||
fprintf(fout,"\n*********************************************************************\n");
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue