Merge branch 'master' of https://github.com/assimp/assimp
commit
ebb209a0d6
|
@ -1,6 +1,6 @@
|
||||||
# Open Asset Import Library (assimp)
|
# Open Asset Import Library (assimp)
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006-2016, assimp team
|
# Copyright (c) 2006-2016, assimp team
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
@ -81,7 +81,8 @@ IF(NOT GIT_COMMIT_HASH)
|
||||||
ENDIF(NOT GIT_COMMIT_HASH)
|
ENDIF(NOT GIT_COMMIT_HASH)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in
|
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -175,7 +176,15 @@ ENDIF( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
|
||||||
# Search for external dependencies, and build them from source if not found
|
# Search for external dependencies, and build them from source if not found
|
||||||
# Search for zlib
|
# Search for zlib
|
||||||
find_package(ZLIB)
|
OPTION(ASSIMP_BUILD_ZLIB
|
||||||
|
"Build your own zlib"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
|
||||||
|
IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||||
|
find_package(ZLIB)
|
||||||
|
ENDIF(ASSIMP_BUILD_ZLIB)
|
||||||
|
|
||||||
IF( NOT ZLIB_FOUND )
|
IF( NOT ZLIB_FOUND )
|
||||||
message(STATUS "compiling zlib from souces")
|
message(STATUS "compiling zlib from souces")
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
@ -228,31 +237,33 @@ SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL
|
||||||
|
|
||||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
IF ( MSVC )
|
IF ( MSVC )
|
||||||
SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/includes")
|
SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes")
|
||||||
|
|
||||||
# pick the correct prebuilt library
|
# pick the correct prebuilt library
|
||||||
IF(MSVC11)
|
IF(MSVC14)
|
||||||
SET(C4D_LIB_POSTFIX "_2012md")
|
SET(C4D_LIB_POSTFIX "_2015")
|
||||||
|
ELSEIF(MSVC12)
|
||||||
|
SET(C4D_LIB_POSTFIX "_2013")
|
||||||
|
ELSEIF(MSVC11)
|
||||||
|
SET(C4D_LIB_POSTFIX "_2012")
|
||||||
ELSEIF(MSVC10)
|
ELSEIF(MSVC10)
|
||||||
SET(C4D_LIB_POSTFIX "_2010md")
|
SET(C4D_LIB_POSTFIX "_2010")
|
||||||
ELSEIF(MSVC90)
|
|
||||||
SET(C4D_LIB_POSTFIX "_2008md")
|
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE( FATAL_ERROR
|
MESSAGE( FATAL_ERROR
|
||||||
"C4D is currently only supported with MSVC 9, 10, 11"
|
"C4D is currently only supported with MSVC 10, 11, 12, 14"
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(CMAKE_CL_64)
|
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win")
|
||||||
SET(C4D_LIB_ARCH_POSTFIX "_x64")
|
|
||||||
ELSE()
|
|
||||||
SET(C4D_LIB_ARCH_POSTFIX "")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/lib/WIN")
|
SET(C4D_DEBUG_LIBRARIES
|
||||||
|
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib"
|
||||||
SET(C4D_DEBUG_LIBRARY "${C4D_LIB_BASE_PATH}/debug/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib")
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib"
|
||||||
SET(C4D_RELEASE_LIBRARY "${C4D_LIB_BASE_PATH}/release/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib")
|
)
|
||||||
|
SET(C4D_RELEASE_LIBRARIES
|
||||||
|
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib"
|
||||||
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib"
|
||||||
|
)
|
||||||
|
|
||||||
# winsock and winmm are necessary dependencies of melange (this is undocumented, but true.)
|
# winsock and winmm are necessary dependencies of melange (this is undocumented, but true.)
|
||||||
SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib)
|
SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib)
|
||||||
|
@ -278,7 +289,7 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||||
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
||||||
ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
||||||
ENDIF ( WIN32 )
|
ENDIF ( WIN32 )
|
||||||
|
|
||||||
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
||||||
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "C4DImporter.h"
|
#include "C4DImporter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
#include <memory>
|
||||||
|
#include <assimp/IOSystem.hpp>
|
||||||
|
#include <assimp/scene.h>
|
||||||
|
#include <assimp/ai_assert.h>
|
||||||
|
|
||||||
#if defined(_M_X64) || defined(__amd64__)
|
#if defined(_M_X64) || defined(__amd64__)
|
||||||
# define __C4D_64BIT
|
# define __C4D_64BIT
|
||||||
|
@ -61,10 +65,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "c4d_file.h"
|
#include "c4d_file.h"
|
||||||
#include "default_alien_overloads.h"
|
#include "default_alien_overloads.h"
|
||||||
|
|
||||||
using namespace _melange_;
|
using namespace melange;
|
||||||
|
|
||||||
// overload this function and fill in your own unique data
|
// overload this function and fill in your own unique data
|
||||||
void GetWriterInfo(LONG &id, String &appname)
|
void GetWriterInfo(int &id, String &appname)
|
||||||
{
|
{
|
||||||
id = 2424226;
|
id = 2424226;
|
||||||
appname = "Open Asset Import Library";
|
appname = "Open Asset Import Library";
|
||||||
|
@ -197,7 +201,7 @@ void C4DImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
|
bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader)
|
||||||
{
|
{
|
||||||
// based on Melange sample code (C4DImportExport.cpp)
|
// based on Melange sample code (C4DImportExport.cpp)
|
||||||
while(shader) {
|
while(shader) {
|
||||||
|
@ -263,7 +267,7 @@ bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void C4DImporter::ReadMaterials(_melange_::BaseMaterial* mat)
|
void C4DImporter::ReadMaterials(melange::BaseMaterial* mat)
|
||||||
{
|
{
|
||||||
// based on Melange sample code
|
// based on Melange sample code
|
||||||
while (mat)
|
while (mat)
|
||||||
|
@ -288,7 +292,7 @@ void C4DImporter::ReadMaterials(_melange_::BaseMaterial* mat)
|
||||||
mat->GetParameter(MATERIAL_COLOR_COLOR, data);
|
mat->GetParameter(MATERIAL_COLOR_COLOR, data);
|
||||||
Vector color = data.GetVector();
|
Vector color = data.GetVector();
|
||||||
mat->GetParameter(MATERIAL_COLOR_BRIGHTNESS, data);
|
mat->GetParameter(MATERIAL_COLOR_BRIGHTNESS, data);
|
||||||
const Real brightness = data.GetReal();
|
const Float brightness = data.GetFloat();
|
||||||
|
|
||||||
color *= brightness;
|
color *= brightness;
|
||||||
|
|
||||||
|
@ -507,11 +511,13 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object)
|
||||||
|
|
||||||
// copy normals
|
// copy normals
|
||||||
if (normals_src) {
|
if (normals_src) {
|
||||||
if(i >= normals_src->GetNormalCount()) {
|
if(i >= normals_src->GetDataCount()) {
|
||||||
LogError("unexpected number of normals, ignoring");
|
LogError("unexpected number of normals, ignoring");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const NormalStruct& nor = normals_src->GetNormals(i);
|
ConstNormalHandle normal_handle = normals_src->GetDataAddressR();
|
||||||
|
NormalStruct nor;
|
||||||
|
NormalTag::Get(normal_handle, i, nor);
|
||||||
normals->x = nor.a.x;
|
normals->x = nor.a.x;
|
||||||
normals->y = nor.a.y;
|
normals->y = nor.a.y;
|
||||||
normals->z = nor.a.z;
|
normals->z = nor.a.z;
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct aiMaterial;
|
||||||
|
|
||||||
struct aiImporterDesc;
|
struct aiImporterDesc;
|
||||||
|
|
||||||
namespace _melange_ {
|
namespace melange {
|
||||||
class BaseObject; // c4d_file.h
|
class BaseObject; // c4d_file.h
|
||||||
class PolygonObject;
|
class PolygonObject;
|
||||||
class BaseMaterial;
|
class BaseMaterial;
|
||||||
|
@ -103,17 +103,17 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void ReadMaterials(_melange_::BaseMaterial* mat);
|
void ReadMaterials(melange::BaseMaterial* mat);
|
||||||
void RecurseHierarchy(_melange_::BaseObject* object, aiNode* parent);
|
void RecurseHierarchy(melange::BaseObject* object, aiNode* parent);
|
||||||
aiMesh* ReadMesh(_melange_::BaseObject* object);
|
aiMesh* ReadMesh(melange::BaseObject* object);
|
||||||
unsigned int ResolveMaterial(_melange_::PolygonObject* obj);
|
unsigned int ResolveMaterial(melange::PolygonObject* obj);
|
||||||
|
|
||||||
bool ReadShader(aiMaterial* out, _melange_::BaseShader* shader);
|
bool ReadShader(aiMaterial* out, melange::BaseShader* shader);
|
||||||
|
|
||||||
std::vector<aiMesh*> meshes;
|
std::vector<aiMesh*> meshes;
|
||||||
std::vector<aiMaterial*> materials;
|
std::vector<aiMaterial*> materials;
|
||||||
|
|
||||||
typedef std::map<_melange_::BaseMaterial*, unsigned int> MaterialMap;
|
typedef std::map<melange::BaseMaterial*, unsigned int> MaterialMap;
|
||||||
MaterialMap material_mapping;
|
MaterialMap material_mapping;
|
||||||
|
|
||||||
}; // !class C4DImporter
|
}; // !class C4DImporter
|
||||||
|
|
|
@ -775,8 +775,8 @@ if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||||
endif(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
|
endif(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||||
|
|
||||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
TARGET_LINK_LIBRARIES(assimp optimized ${C4D_RELEASE_LIBRARY})
|
TARGET_LINK_LIBRARIES(assimp optimized ${C4D_RELEASE_LIBRARIES})
|
||||||
TARGET_LINK_LIBRARIES(assimp debug ${C4D_DEBUG_LIBRARY})
|
TARGET_LINK_LIBRARIES(assimp debug ${C4D_DEBUG_LIBRARIES})
|
||||||
TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES})
|
TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES})
|
||||||
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
|
|
||||||
|
|
|
@ -240,6 +240,8 @@ struct Mesh {
|
||||||
unsigned int m_uiMaterialIndex;
|
unsigned int m_uiMaterialIndex;
|
||||||
/// True, if normals are stored.
|
/// True, if normals are stored.
|
||||||
bool m_hasNormals;
|
bool m_hasNormals;
|
||||||
|
/// True, if vertex colors are stored.
|
||||||
|
bool m_hasVertexColors;
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
explicit Mesh( const std::string &name )
|
explicit Mesh( const std::string &name )
|
||||||
|
@ -289,6 +291,8 @@ struct Model
|
||||||
std::vector<aiVector3D> m_Vertices;
|
std::vector<aiVector3D> m_Vertices;
|
||||||
//! vector with all generated normals
|
//! vector with all generated normals
|
||||||
std::vector<aiVector3D> m_Normals;
|
std::vector<aiVector3D> m_Normals;
|
||||||
|
//! vector with all vertex colors
|
||||||
|
std::vector<aiVector3D> m_VertexColors;
|
||||||
//! Group map
|
//! Group map
|
||||||
GroupMap m_Groups;
|
GroupMap m_Groups;
|
||||||
//! Group to face id assignment
|
//! Group to face id assignment
|
||||||
|
|
|
@ -416,6 +416,10 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
|
||||||
if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals )
|
if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals )
|
||||||
pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
|
pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
|
||||||
|
|
||||||
|
// Allocate buffer for vertex-color vectors
|
||||||
|
if ( !pModel->m_VertexColors.empty() )
|
||||||
|
pMesh->mColors[0] = new aiColor4D[ pMesh->mNumVertices ];
|
||||||
|
|
||||||
// Allocate buffer for texture coordinates
|
// Allocate buffer for texture coordinates
|
||||||
if ( !pModel->m_TextureCoord.empty() && pObjMesh->m_uiUVCoordinates[0] )
|
if ( !pModel->m_TextureCoord.empty() && pObjMesh->m_uiUVCoordinates[0] )
|
||||||
{
|
{
|
||||||
|
@ -449,6 +453,13 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
|
||||||
pMesh->mNormals[ newIndex ] = pModel->m_Normals[ normal ];
|
pMesh->mNormals[ newIndex ] = pModel->m_Normals[ normal ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy all vertex colors
|
||||||
|
if ( !pModel->m_VertexColors.empty())
|
||||||
|
{
|
||||||
|
const aiVector3D color = pModel->m_VertexColors[ vertex ];
|
||||||
|
pMesh->mColors[0][ newIndex ] = aiColor4D(color.x, color.y, color.z, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
// Copy all texture coordinates
|
// Copy all texture coordinates
|
||||||
if ( !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_pTexturCoords->size())
|
if ( !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_pTexturCoords->size())
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,8 +136,14 @@ void ObjFileParser::parseFile()
|
||||||
{
|
{
|
||||||
++m_DataIt;
|
++m_DataIt;
|
||||||
if (*m_DataIt == ' ' || *m_DataIt == '\t') {
|
if (*m_DataIt == ' ' || *m_DataIt == '\t') {
|
||||||
// read in vertex definition
|
size_t numComponents = getNumComponentsInLine();
|
||||||
getVector3(m_pModel->m_Vertices);
|
if (numComponents == 3) {
|
||||||
|
// read in vertex definition
|
||||||
|
getVector3(m_pModel->m_Vertices);
|
||||||
|
} else if (numComponents == 6) {
|
||||||
|
// read vertex and vertex-color
|
||||||
|
getTwoVectors3(m_pModel->m_Vertices, m_pModel->m_VertexColors);
|
||||||
|
}
|
||||||
} else if (*m_DataIt == 't') {
|
} else if (*m_DataIt == 't') {
|
||||||
// read in texture coordinate ( 2D or 3D )
|
// read in texture coordinate ( 2D or 3D )
|
||||||
++m_DataIt;
|
++m_DataIt;
|
||||||
|
@ -257,8 +263,7 @@ void ObjFileParser::copyNextLine(char *pBuffer, size_t length)
|
||||||
pBuffer[ index ] = '\0';
|
pBuffer[ index ] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t ObjFileParser::getNumComponentsInLine() {
|
||||||
void ObjFileParser::getVector( std::vector<aiVector3D> &point3d_array ) {
|
|
||||||
size_t numComponents( 0 );
|
size_t numComponents( 0 );
|
||||||
const char* tmp( &m_DataIt[0] );
|
const char* tmp( &m_DataIt[0] );
|
||||||
while( !IsLineEnd( *tmp ) ) {
|
while( !IsLineEnd( *tmp ) ) {
|
||||||
|
@ -268,6 +273,12 @@ void ObjFileParser::getVector( std::vector<aiVector3D> &point3d_array ) {
|
||||||
SkipToken( tmp );
|
SkipToken( tmp );
|
||||||
++numComponents;
|
++numComponents;
|
||||||
}
|
}
|
||||||
|
return numComponents;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
void ObjFileParser::getVector( std::vector<aiVector3D> &point3d_array ) {
|
||||||
|
size_t numComponents = getNumComponentsInLine();
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
if( 2 == numComponents ) {
|
if( 2 == numComponents ) {
|
||||||
copyNextWord( m_buffer, Buffersize );
|
copyNextWord( m_buffer, Buffersize );
|
||||||
|
@ -309,6 +320,35 @@ void ObjFileParser::getVector3( std::vector<aiVector3D> &point3d_array ) {
|
||||||
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Get values for two 3D vectors on the same line
|
||||||
|
void ObjFileParser::getTwoVectors3( std::vector<aiVector3D> &point3d_array_a, std::vector<aiVector3D> &point3d_array_b ) {
|
||||||
|
float x, y, z;
|
||||||
|
copyNextWord(m_buffer, Buffersize);
|
||||||
|
x = (float) fast_atof(m_buffer);
|
||||||
|
|
||||||
|
copyNextWord(m_buffer, Buffersize);
|
||||||
|
y = (float) fast_atof(m_buffer);
|
||||||
|
|
||||||
|
copyNextWord( m_buffer, Buffersize );
|
||||||
|
z = ( float ) fast_atof( m_buffer );
|
||||||
|
|
||||||
|
point3d_array_a.push_back( aiVector3D( x, y, z ) );
|
||||||
|
|
||||||
|
copyNextWord(m_buffer, Buffersize);
|
||||||
|
x = (float) fast_atof(m_buffer);
|
||||||
|
|
||||||
|
copyNextWord(m_buffer, Buffersize);
|
||||||
|
y = (float) fast_atof(m_buffer);
|
||||||
|
|
||||||
|
copyNextWord( m_buffer, Buffersize );
|
||||||
|
z = ( float ) fast_atof( m_buffer );
|
||||||
|
|
||||||
|
point3d_array_b.push_back( aiVector3D( x, y, z ) );
|
||||||
|
|
||||||
|
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Get values for a new 2D vector instance
|
// Get values for a new 2D vector instance
|
||||||
void ObjFileParser::getVector2( std::vector<aiVector2D> &point2d_array ) {
|
void ObjFileParser::getVector2( std::vector<aiVector2D> &point2d_array ) {
|
||||||
|
|
|
@ -89,6 +89,8 @@ private:
|
||||||
void getVector( std::vector<aiVector3D> &point3d_array );
|
void getVector( std::vector<aiVector3D> &point3d_array );
|
||||||
/// Stores the following 3d vector.
|
/// Stores the following 3d vector.
|
||||||
void getVector3( std::vector<aiVector3D> &point3d_array );
|
void getVector3( std::vector<aiVector3D> &point3d_array );
|
||||||
|
/// Stores the following two 3d vectors on the line.
|
||||||
|
void getTwoVectors3( std::vector<aiVector3D> &point3d_array_a, std::vector<aiVector3D> &point3d_array_b );
|
||||||
/// Stores the following 3d vector.
|
/// Stores the following 3d vector.
|
||||||
void getVector2(std::vector<aiVector2D> &point2d_array);
|
void getVector2(std::vector<aiVector2D> &point2d_array);
|
||||||
/// Stores the following face.
|
/// Stores the following face.
|
||||||
|
@ -119,6 +121,8 @@ private:
|
||||||
bool needsNewMesh( const std::string &rMaterialName );
|
bool needsNewMesh( const std::string &rMaterialName );
|
||||||
/// Error report in token
|
/// Error report in token
|
||||||
void reportErrorTokenInFace();
|
void reportErrorTokenInFace();
|
||||||
|
/// Get the number of components in a line.
|
||||||
|
size_t getNumComponentsInLine();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Copy and assignment constructor should be private
|
// Copy and assignment constructor should be private
|
||||||
|
|
|
@ -557,7 +557,7 @@ public:
|
||||||
flags_ |= kIntFlag;
|
flags_ |= kIntFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__x86_64__)
|
#if !defined(__x86_64__) && !defined(__arm64__)
|
||||||
//! Constructor for size_t value.
|
//! Constructor for size_t value.
|
||||||
explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) {
|
explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) {
|
||||||
data_.n.u64 = u;
|
data_.n.u64 = u;
|
||||||
|
|
|
@ -22,6 +22,8 @@ CPP_DEV_TARGET_LIST=(miphoneos-version-min mios-simulator-version-min)
|
||||||
CPP_DEV_TARGET=
|
CPP_DEV_TARGET=
|
||||||
CPP_STD_LIB_LIST=(libc++ libstdc++)
|
CPP_STD_LIB_LIST=(libc++ libstdc++)
|
||||||
CPP_STD_LIB=
|
CPP_STD_LIB=
|
||||||
|
CPP_STD_LIST=(c++03 c++11 c++14)
|
||||||
|
CPP_STD=
|
||||||
|
|
||||||
function join { local IFS="$1"; shift; echo "$*"; }
|
function join { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ build_arch()
|
||||||
export CFLAGS="-arch $1 -pipe -no-cpp-precomp -stdlib=$CPP_STD_LIB -isysroot $SDKROOT -$CPP_DEV_TARGET=$IOS_SDK_TARGET -I$SDKROOT/usr/include/"
|
export CFLAGS="-arch $1 -pipe -no-cpp-precomp -stdlib=$CPP_STD_LIB -isysroot $SDKROOT -$CPP_DEV_TARGET=$IOS_SDK_TARGET -I$SDKROOT/usr/include/"
|
||||||
export LDFLAGS="-L$SDKROOT/usr/lib/"
|
export LDFLAGS="-L$SDKROOT/usr/lib/"
|
||||||
export CPPFLAGS=$CFLAGS
|
export CPPFLAGS=$CFLAGS
|
||||||
export CXXFLAGS=$CFLAGS
|
export CXXFLAGS="$CFLAGS -std=$CPP_STD"
|
||||||
|
|
||||||
rm CMakeCache.txt
|
rm CMakeCache.txt
|
||||||
|
|
||||||
|
@ -65,11 +67,16 @@ build_arch()
|
||||||
echo "[!] $0 - assimp iOS build script"
|
echo "[!] $0 - assimp iOS build script"
|
||||||
|
|
||||||
CPP_STD_LIB=${CPP_STD_LIB_LIST[0]}
|
CPP_STD_LIB=${CPP_STD_LIB_LIST[0]}
|
||||||
|
CPP_STD=${CPP_STD_LIST[0]}
|
||||||
DEPLOY_ARCHS=${BUILD_ARCHS_ALL[*]}
|
DEPLOY_ARCHS=${BUILD_ARCHS_ALL[*]}
|
||||||
DEPLOY_FAT=1
|
DEPLOY_FAT=1
|
||||||
|
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
case $i in
|
case $i in
|
||||||
|
-s=*|--std=*)
|
||||||
|
CPP_STD=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
||||||
|
echo "[!] Selecting c++ standard: $CPP_STD"
|
||||||
|
;;
|
||||||
-l=*|--stdlib=*)
|
-l=*|--stdlib=*)
|
||||||
CPP_STD_LIB=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
CPP_STD_LIB=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
||||||
echo "[!] Selecting c++ std lib: $CPP_STD_LIB"
|
echo "[!] Selecting c++ std lib: $CPP_STD_LIB"
|
||||||
|
@ -85,7 +92,8 @@ for i in "$@"; do
|
||||||
-h|--help)
|
-h|--help)
|
||||||
echo " - don't build fat library (--no-fat)."
|
echo " - don't build fat library (--no-fat)."
|
||||||
echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')"
|
echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')"
|
||||||
echo " - supported C++ STD libs. (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')"
|
echo " - supported C++ STD libs (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')"
|
||||||
|
echo " - supported C++ standards (--std): $(echo $(join , ${CPP_STD_LIST[*]}) | sed 's/,/, /g')"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in New Issue