mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -1,9 +1,7 @@
|
|||
# Open Asset Import Library (assimp)
|
||||
# ----------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) 2006-2022, assimp team
|
||||
|
||||
|
||||
# Copyright (c) 2006-2024, assimp team
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this software in source and binary forms,
|
||||
|
|
@ -62,6 +60,14 @@ ADD_EXECUTABLE( assimp_cmd
|
|||
${ASSIMP_CMD_RC}
|
||||
)
|
||||
|
||||
IF (ASSIMP_WARNINGS_AS_ERRORS)
|
||||
IF (MSVC)
|
||||
TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE /W4 /WX)
|
||||
ELSE()
|
||||
TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE -Wall -Werror)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp_cmd)
|
||||
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
|
||||
|
|
@ -910,7 +910,7 @@ int Assimp_CompareDump (const char* const* params, unsigned int num)
|
|||
if (m_file)
|
||||
{
|
||||
fclose(m_file);
|
||||
m_file = NULL;
|
||||
m_file = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -50,27 +48,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
const char *AICMD_MSG_INFO_HELP_E =
|
||||
constexpr char AICMD_MSG_INFO_HELP_E[] =
|
||||
"assimp info <file> [-r] [-v]\n"
|
||||
"\tPrint basic structure of a 3D model\n"
|
||||
"\t-r,--raw: No postprocessing, do a raw import\n"
|
||||
"\t-v,--verbose: Print verbose info such as node transform data\n"
|
||||
"\t-s, --silent: Print only minimal info\n";
|
||||
|
||||
const char *TREE_BRANCH_ASCII = "|-";
|
||||
const char *TREE_BRANCH_UTF8 = "\xe2\x94\x9c\xe2\x95\xb4";
|
||||
const char *TREE_STOP_ASCII = "'-";
|
||||
const char *TREE_STOP_UTF8 = "\xe2\x94\x94\xe2\x95\xb4";
|
||||
const char *TREE_CONTINUE_ASCII = "| ";
|
||||
const char *TREE_CONTINUE_UTF8 = "\xe2\x94\x82 ";
|
||||
|
||||
// note: by default this is using utf-8 text.
|
||||
// this is well supported on pretty much any linux terminal.
|
||||
// if this causes problems on some platform,
|
||||
// put an #ifdef to use the ascii version for that platform.
|
||||
#ifdef _WIN32
|
||||
constexpr char TREE_BRANCH_ASCII[] = "|-";
|
||||
constexpr char TREE_STOP_ASCII[] = "'-";
|
||||
constexpr char TREE_CONTINUE_ASCII[] = "| ";
|
||||
|
||||
const char *TREE_BRANCH = TREE_BRANCH_ASCII;
|
||||
const char *TREE_STOP = TREE_STOP_ASCII;
|
||||
const char *TREE_CONTINUE = TREE_CONTINUE_ASCII;
|
||||
#else // _WIN32
|
||||
constexpr char TREE_BRANCH_UTF8[] = "\xe2\x94\x9c\xe2\x95\xb4";
|
||||
constexpr char TREE_STOP_UTF8[] = "\xe2\x94\x94\xe2\x95\xb4";
|
||||
constexpr char TREE_CONTINUE_UTF8[] = "\xe2\x94\x82 ";
|
||||
|
||||
const char *TREE_BRANCH = TREE_BRANCH_UTF8;
|
||||
const char *TREE_STOP = TREE_STOP_UTF8;
|
||||
const char *TREE_CONTINUE = TREE_CONTINUE_UTF8;
|
||||
#endif // _WIN32
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
unsigned int CountNodes(const aiNode *root) {
|
||||
|
|
@ -173,7 +179,7 @@ void FindSpecialPoints(const aiScene *scene, aiVector3D special_points[3]) {
|
|||
|
||||
// -----------------------------------------------------------------------------------
|
||||
std::string FindPTypes(const aiScene *scene) {
|
||||
bool haveit[4] = { 0 };
|
||||
bool haveit[4] = { false };
|
||||
for (unsigned int i = 0; i < scene->mNumMeshes; ++i) {
|
||||
const unsigned int pt = scene->mMeshes[i]->mPrimitiveTypes;
|
||||
if (pt & aiPrimitiveType_POINT) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -58,11 +58,12 @@ public:
|
|||
~ConsoleProgressHandler() override = default;
|
||||
|
||||
bool Update(float percentage) override {
|
||||
std::cout << percentage * 100.0f << " %\n";
|
||||
std::cout << "\r" << percentage * 100.0f << " %";
|
||||
return true;
|
||||
}
|
||||
};
|
||||
const char* AICMD_MSG_ABOUT =
|
||||
|
||||
constexpr char AICMD_MSG_ABOUT[] =
|
||||
"------------------------------------------------------ \n"
|
||||
"Open Asset Import Library (\"Assimp\", https://github.com/assimp/assimp) \n"
|
||||
" -- Commandline toolchain --\n"
|
||||
|
|
@ -70,7 +71,7 @@ const char* AICMD_MSG_ABOUT =
|
|||
|
||||
"Version %i.%i %s%s%s%s%s(GIT commit %x)\n\n";
|
||||
|
||||
const char* AICMD_MSG_HELP =
|
||||
constexpr char AICMD_MSG_HELP[] =
|
||||
"assimp <verb> <parameters>\n\n"
|
||||
" verbs:\n"
|
||||
" \tinfo - Quick file stats\n"
|
||||
|
|
@ -96,8 +97,7 @@ const char* AICMD_MSG_HELP =
|
|||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Application entry point
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
int main (int argc, char* argv[]) {
|
||||
if (argc <= 1) {
|
||||
printf("assimp: No command specified. Use \'assimp help\' for a detailed command list\n");
|
||||
return AssimpCmdError::Success;
|
||||
|
|
@ -291,7 +291,7 @@ const aiScene* ImportModel(
|
|||
// Now validate this flag combination
|
||||
if(!globalImporter->ValidateFlags(imp.ppFlags)) {
|
||||
printf("ERROR: Unsupported post-processing flags \n");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
printf("Validating postprocessing flags ... OK\n");
|
||||
if (imp.showLog) {
|
||||
|
|
@ -303,7 +303,7 @@ const aiScene* ImportModel(
|
|||
const clock_t first = clock();
|
||||
ConsoleProgressHandler *ph = new ConsoleProgressHandler;
|
||||
globalImporter->SetProgressHandler(ph);
|
||||
|
||||
|
||||
const aiScene* scene = globalImporter->ReadFile(path,imp.ppFlags);
|
||||
|
||||
if (imp.showLog) {
|
||||
|
|
@ -311,7 +311,7 @@ const aiScene* ImportModel(
|
|||
}
|
||||
if (!scene) {
|
||||
printf("ERROR: Failed to load file: %s\n", globalImporter->GetErrorString());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const clock_t second = ::clock();
|
||||
|
|
@ -550,10 +550,7 @@ int ProcessStandardArguments(
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
int Assimp_TestBatchLoad (
|
||||
const char* const* params,
|
||||
unsigned int num)
|
||||
{
|
||||
int Assimp_TestBatchLoad(const char* const* params, unsigned int num) {
|
||||
for(unsigned int i = 0; i < num; ++i) {
|
||||
globalImporter->ReadFile(params[i],aiProcessPreset_TargetRealtime_MaxQuality);
|
||||
// we're totally silent. scene destructs automatically.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#define AICMD_MAIN_INCLUDED
|
||||
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -60,26 +60,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include "../code/Common/Compression.h"
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||
# include <assimp/Exporter.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
#include <zlib.h>
|
||||
#else
|
||||
#include <../contrib/zlib/zlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX (std::numeric_limits<size_t>::max())
|
||||
#endif
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
|
||||
// Global assimp importer instance
|
||||
extern Assimp::Importer* globalImporter;
|
||||
|
||||
|
|
@ -118,8 +110,8 @@ struct ImportData {
|
|||
aiVector3D rot;
|
||||
};
|
||||
|
||||
/// \enum AssimpCmdError
|
||||
/// \brief General error codes used among assimp_cmd's utilities.
|
||||
// ------------------------------------------------------------------------------
|
||||
/// @brief General error codes used among assimp_cmd's utilities.
|
||||
enum AssimpCmdError {
|
||||
Success = 0,
|
||||
InvalidNumberOfArguments,
|
||||
|
|
@ -179,8 +171,8 @@ int Assimp_Dump (
|
|||
const char* const* params,
|
||||
unsigned int num);
|
||||
|
||||
/// \enum AssimpCmdExportError
|
||||
/// \brief Error codes used by the 'Export' utility.
|
||||
// ------------------------------------------------------------------------------
|
||||
/// @brief Error codes used by the 'Export' utility.
|
||||
enum AssimpCmdExportError {
|
||||
FailedToImportModel = AssimpCmdError::LastAssimpCmdError,
|
||||
FailedToExportModel,
|
||||
|
|
@ -199,8 +191,8 @@ int Assimp_Export (
|
|||
const char* const* params,
|
||||
unsigned int num);
|
||||
|
||||
/// \enum AssimpCmdExtractError
|
||||
/// \brief Error codes used by the 'Image Extractor' utility.
|
||||
// ------------------------------------------------------------------------------
|
||||
/// @brief Error codes used by the 'Image Extractor' utility.
|
||||
enum AssimpCmdExtractError {
|
||||
TextureIndexIsOutOfRange = AssimpCmdError::LastAssimpCmdError,
|
||||
NoAvailableTextureEncoderFound,
|
||||
|
|
@ -220,8 +212,8 @@ int Assimp_Extract (
|
|||
const char* const* params,
|
||||
unsigned int num);
|
||||
|
||||
/// \enum AssimpCmdCompareDumpError
|
||||
/// \brief Error codes used by the 'Compare Dump' utility.
|
||||
// ------------------------------------------------------------------------------
|
||||
/// @brief Error codes used by the 'Compare Dump' utility.
|
||||
enum AssimpCmdCompareDumpError {
|
||||
FailedToLoadExpectedInputFile = AssimpCmdError::LastAssimpCmdError,
|
||||
FileComparaisonFailure,
|
||||
|
|
@ -241,8 +233,7 @@ int Assimp_CompareDump (
|
|||
const char* const* params,
|
||||
unsigned int num);
|
||||
|
||||
/// \enum AssimpCmdInfoError
|
||||
/// \brief Error codes used by the 'Info' utility.
|
||||
/// @brief Error codes used by the 'Info' utility.
|
||||
enum AssimpCmdInfoError {
|
||||
InvalidCombinaisonOfArguments = AssimpCmdError::LastAssimpCmdError,
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "revision.h"
|
||||
#include <assimp/revision.h>
|
||||
#if defined(__GNUC__) && defined(_WIN32)
|
||||
#include "winresrc.h"
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue