Merge branch 'master' into kimkulling-issue_2656_add_cppcoverall
commit
dc6b49a12a
|
@ -40,6 +40,9 @@ SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
|
|||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 3.10 )
|
||||
|
||||
# Disabled importers: m3d for 5.1
|
||||
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER)
|
||||
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER)
|
||||
# Toggles the use of the hunter package manager
|
||||
option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF)
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#define M3D_EXPORTER
|
||||
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#define M3D_NODUP
|
||||
#endif
|
||||
|
||||
|
||||
// Header files, standard library.
|
||||
#include <memory> // shared_ptr
|
||||
|
@ -437,6 +437,6 @@ void M3DExporter::NodeWalk(const M3DWrapper &m3d, const aiNode *pNode, aiMatrix4
|
|||
}
|
||||
}
|
||||
} // namespace Assimp
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_M3D_EXPORTER
|
||||
#endif // ASSIMP_BUILD_NO_EXPORT
|
||||
|
|
|
@ -46,10 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef AI_M3DEXPORTER_H_INC
|
||||
#define AI_M3DEXPORTER_H_INC
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#ifndef ASSIMP_BUILD_NO_M3D_EXPORTER
|
||||
|
||||
#include <assimp/types.h>
|
||||
//#include <assimp/material.h>
|
||||
#include <assimp/StreamWriter.h> // StreamWriterLE
|
||||
#include <assimp/Exceptional.h> // DeadlyExportError
|
||||
|
||||
|
@ -60,8 +60,7 @@ struct aiNode;
|
|||
struct aiMaterial;
|
||||
struct aiFace;
|
||||
|
||||
namespace Assimp
|
||||
{
|
||||
namespace Assimp {
|
||||
class IOSystem;
|
||||
class IOStream;
|
||||
class ExportProperties;
|
||||
|
@ -71,8 +70,7 @@ namespace Assimp
|
|||
// ---------------------------------------------------------------------
|
||||
/** Helper class to export a given scene to an M3D file. */
|
||||
// ---------------------------------------------------------------------
|
||||
class M3DExporter
|
||||
{
|
||||
class M3DExporter {
|
||||
public:
|
||||
/// Constructor for a specific scene to export
|
||||
M3DExporter(const aiScene* pScene, const ExportProperties* pProperties);
|
||||
|
@ -89,6 +87,7 @@ namespace Assimp
|
|||
};
|
||||
}
|
||||
|
||||
#endif // #ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#endif // ASSIMP_BUILD_NO_M3D_EXPORTER
|
||||
|
||||
#endif // AI_M3DEXPORTER_H_INC
|
||||
|
|
|
@ -39,8 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
|
||||
|
||||
#include "M3DWrapper.h"
|
||||
|
||||
|
@ -141,10 +141,12 @@ unsigned char *M3DWrapper::Save(int quality, int flags, unsigned int &size) {
|
|||
}
|
||||
|
||||
void M3DWrapper::ClearSave() {
|
||||
if (saved_output_)
|
||||
if (saved_output_) {
|
||||
M3D_FREE(saved_output_);
|
||||
}
|
||||
saved_output_ = nullptr;
|
||||
}
|
||||
} // namespace Assimp
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -47,7 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef AI_M3DWRAPPER_H_INC
|
||||
#define AI_M3DWRAPPER_H_INC
|
||||
|
||||
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
@ -128,5 +129,6 @@ inline m3d_t *M3DWrapper::M3D() const {
|
|||
} // namespace Assimp
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_M3D_IMPORTER
|
||||
|
||||
#endif // AI_M3DWRAPPER_H_INC
|
||||
|
|
|
@ -174,6 +174,22 @@ static void IdentityMatrix4(mat4 &o) {
|
|||
o[15] = 1;
|
||||
}
|
||||
|
||||
static bool IsBoneWeightFitted(vec4 &weight) {
|
||||
return weight[0] + weight[1] + weight[2] + weight[3] >= 1.f;
|
||||
}
|
||||
|
||||
static int FitBoneWeight(vec4 &weight, float value) {
|
||||
int i = 0;
|
||||
for (; i < 4; ++i) {
|
||||
if (weight[i] < value) {
|
||||
weight[i] = value;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SetAccessorRange(Ref<Accessor> acc, void *data, size_t count,
|
||||
unsigned int numCompsIn, unsigned int numCompsOut) {
|
||||
|
@ -950,16 +966,22 @@ void ExportSkin(Asset &mAsset, const aiMesh *aimesh, Ref<Mesh> &meshRef, Ref<Buf
|
|||
unsigned int vertexId = aib->mWeights[idx_weights].mVertexId;
|
||||
float vertWeight = aib->mWeights[idx_weights].mWeight;
|
||||
|
||||
// A vertex can only have at most four joint weights. Ignore all others.
|
||||
if (jointsPerVertex[vertexId] > 3) {
|
||||
// A vertex can only have at most four joint weights, which ideally sum up to 1
|
||||
if (IsBoneWeightFitted(vertexWeightData[vertexId])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jointsPerVertex[vertexId] > 3) {
|
||||
int boneIndexFitted = FitBoneWeight(vertexWeightData[vertexId], vertWeight);
|
||||
if (boneIndexFitted) {
|
||||
vertexJointData[vertexId][boneIndexFitted] = static_cast<float>(jointNamesIndex);
|
||||
}
|
||||
}else {
|
||||
vertexJointData[vertexId][jointsPerVertex[vertexId]] = static_cast<float>(jointNamesIndex);
|
||||
vertexWeightData[vertexId][jointsPerVertex[vertexId]] = vertWeight;
|
||||
|
||||
jointsPerVertex[vertexId] += 1;
|
||||
}
|
||||
}
|
||||
|
||||
} // End: for-loop mNumMeshes
|
||||
|
||||
|
@ -974,7 +996,7 @@ void ExportSkin(Asset &mAsset, const aiMesh *aimesh, Ref<Mesh> &meshRef, Ref<Buf
|
|||
Ref<Buffer> buf = vertexJointAccessor->bufferView->buffer;
|
||||
uint8_t *arrys = new uint8_t[bytesLen];
|
||||
unsigned int i = 0;
|
||||
for (unsigned int j = 0; j <= bytesLen; j += bytesPerComp) {
|
||||
for (unsigned int j = 0; j < bytesLen; j += bytesPerComp) {
|
||||
size_t len_p = offset + j;
|
||||
float f_value = *(float *)&buf->GetPointer()[len_p];
|
||||
unsigned short c = static_cast<unsigned short>(f_value);
|
||||
|
|
|
@ -161,6 +161,7 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh *pcMesh) {
|
|||
delete[] pcMesh->mBones[i]->mWeights;
|
||||
if (!newWeights[i].empty()) {
|
||||
pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()];
|
||||
pcMesh->mBones[i]->mNumWeights = static_cast<unsigned int>(newWeights[i].size());
|
||||
aiVertexWeight *weightToCopy = &(newWeights[i][0]);
|
||||
memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,
|
||||
sizeof(aiVertexWeight) * newWeights[i].size());
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
IrrXML
|
||||
Downloaded September 2008
|
||||
|
||||
- fixed a minor compiler warning (vs 2005, shift too large)
|
||||
- fixed an issue regarding wchar_t/unsigned short
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[Setup]
|
||||
AppName=Open Asset Import Library - SDK
|
||||
AppVerName=Open Asset Import Library - SDK (v5.0.1)
|
||||
AppVerName=Open Asset Import Library - SDK (v5.1.0)
|
||||
DefaultDirName={pf}\Assimp
|
||||
DefaultGroupName=Assimp
|
||||
UninstallDisplayIcon={app}\bin\x64\assimp.exe
|
||||
|
@ -12,9 +12,9 @@ SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico
|
|||
WizardImageFile=compiler:WizModernImage-IS.BMP
|
||||
WizardSmallImageFile=compiler:WizModernSmallImage-IS.BMP
|
||||
LicenseFile=License.rtf
|
||||
OutputBaseFileName=assimp-sdk-5.0.1-setup
|
||||
VersionInfoVersion=5.0.1.0
|
||||
VersionInfoTextVersion=5.0.1
|
||||
OutputBaseFileName=assimp-sdk-5.1.0-setup
|
||||
VersionInfoVersion=5.1.0.0
|
||||
VersionInfoTextVersion=5.1.0
|
||||
VersionInfoCompany=Assimp Development Team
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[Setup]
|
||||
AppName=Open Asset Import Library - SDK
|
||||
AppVerName=Open Asset Import Library - SDK (v5.0.1)
|
||||
AppVerName=Open Asset Import Library - SDK (v5.1.0)
|
||||
DefaultDirName={pf}\Assimp
|
||||
DefaultGroupName=Assimp
|
||||
UninstallDisplayIcon={app}\bin\x86\assimp.exe
|
||||
|
@ -12,9 +12,9 @@ SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico
|
|||
WizardImageFile=compiler:WizModernImage-IS.BMP
|
||||
WizardSmallImageFile=compiler:WizModernSmallImage-IS.BMP
|
||||
LicenseFile=License.rtf
|
||||
OutputBaseFileName=assimp-sdk-5.0.1-setup
|
||||
VersionInfoVersion=5.0.1.0
|
||||
VersionInfoTextVersion=5.0.1
|
||||
OutputBaseFileName=assimp-sdk-5.1.0-setup
|
||||
VersionInfoVersion=5.1.0.0
|
||||
VersionInfoTextVersion=5.1.0
|
||||
VersionInfoCompany=Assimp Development Team
|
||||
;ArchitecturesInstallIn64BitMode=x64
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ SET( IMPORTERS
|
|||
unit/utColladaImportExport.cpp
|
||||
unit/utCSMImportExport.cpp
|
||||
unit/utB3DImportExport.cpp
|
||||
unit/utM3DImportExport.cpp
|
||||
#unit/utM3DImportExport.cpp
|
||||
unit/utMDCImportExport.cpp
|
||||
unit/utAssbinImportExport.cpp
|
||||
unit/ImportExport/utAssjsonImportExport.cpp
|
||||
|
@ -149,14 +149,13 @@ SET( IMPORTERS
|
|||
unit/ImportExport/utNFFImportExport.cpp
|
||||
unit/ImportExport/utXGLImportExport.cpp
|
||||
unit/ImportExport/utMD2Importer.cpp
|
||||
unit/ImportExport/utMD3Importer.cpp
|
||||
#unit/ImportExport/utMD3Importer.cpp
|
||||
unit/ImportExport/utMD5Importer.cpp
|
||||
unit/ImportExport/utMDLImporter.cpp
|
||||
unit/ImportExport/MDL/MDLHL1TestFiles.h
|
||||
unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp
|
||||
unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp
|
||||
unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp
|
||||
#unit/ImportExport/IRR/utIrrImportExport.cpp
|
||||
unit/ImportExport/RAW/utRAWImportExport.cpp
|
||||
unit/ImportExport/Terragen/utTerragenImportExport.cpp
|
||||
)
|
||||
|
|
|
@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
TEST(utMD3Importer, importWatercan) {
|
||||
|
|
Loading…
Reference in New Issue