* Adjustment: Update Assimp version to 5.0.1.

This commit is contained in:
Robert MacGregor 2021-10-21 21:14:55 -04:00
parent 14ebeaf3eb
commit 4758f7bdaf
679 changed files with 50502 additions and 19698 deletions

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,14 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @file Definition of the base class for all importer worker classes. */
#pragma once
#ifndef INCLUDED_AI_BASEIMPORTER_H
#define INCLUDED_AI_BASEIMPORTER_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include "Exceptional.h"
#include <vector>
@ -196,13 +191,16 @@ public:
/**
* Assimp Importer
* unit conversions available
* NOTE: Valid options are initialised in the
* constructor in the implementation file to
* work around a VS2013 compiler bug if support
* for that compiler is dropped in the future
* initialisation can be moved back here
* if you need another measurment unit add it below.
* it's currently defined in assimp that we prefer meters.
* */
std::map<ImporterUnits, double> importerUnits;
std::map<ImporterUnits, double> importerUnits = {
{ImporterUnits::M, 1},
{ImporterUnits::CM, 0.01},
{ImporterUnits::MM, 0.001},
{ImporterUnits::INCHES, 0.0254},
{ImporterUnits::FEET, 0.3048}
};
virtual void SetApplicationUnits( const ImporterUnits& unit )
{

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -46,14 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Used for file formats which embed their textures into the model file.
*/
#pragma once
#ifndef AI_BITMAP_H_INC
#define AI_BITMAP_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include "defs.h"
#include <stdint.h>
#include <cstddef>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -42,14 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Helper class tp perform various byte oder swappings
(e.g. little to big endian) */
#pragma once
#ifndef AI_BYTESWAPPER_H_INC
#define AI_BYTESWAPPER_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/ai_assert.h>
#include <assimp/types.h>
#include <stdint.h>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,26 +43,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file CreateAnimMesh.h
* Create AnimMesh from Mesh
*/
#pragma once
#ifndef INCLUDED_AI_CREATE_ANIM_MESH_H
#define INCLUDED_AI_CREATE_ANIM_MESH_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/mesh.h>
namespace Assimp {
namespace Assimp {
/**
* Create aiAnimMesh from aiMesh.
* @param mesh The input mesh to create an animated mesh from.
* @return The new created animated mesh.
*/
/** Create aiAnimMesh from aiMesh. */
ASSIMP_API aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh);
} // end of namespace Assimp
#endif // INCLUDED_AI_CREATE_ANIM_MESH_H

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,20 +41,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @file Default file I/O using fXXX()-family of functions */
#pragma once
#ifndef AI_DEFAULTIOSTREAM_H_INC
#define AI_DEFAULTIOSTREAM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <stdio.h>
#include <assimp/IOStream.hpp>
#include <assimp/importerdesc.h>
#include <assimp/Defines.h>
namespace Assimp {
namespace Assimp {
// ----------------------------------------------------------------------------------
//! @class DefaultIOStream
@ -62,7 +57,8 @@ namespace Assimp {
//! @note An instance of this class can exist without a valid file handle
//! attached to it. All calls fail, but the instance can nevertheless be
//! used with no restrictions.
class ASSIMP_API DefaultIOStream : public IOStream {
class ASSIMP_API DefaultIOStream : public IOStream
{
friend class DefaultIOSystem;
#if __ANDROID__
# if __ANDROID_API__ > 9
@ -86,6 +82,7 @@ public:
size_t pSize,
size_t pCount);
// -------------------------------------------------------------------
/// Write to stream
size_t Write(const void* pvBuffer,
@ -110,13 +107,16 @@ public:
void Flush();
private:
// File data-structure, using clib
FILE* mFile;
// Filename
std::string mFilename;
// Cached file size
mutable size_t mCachedSize;
};
// ----------------------------------------------------------------------------------
AI_FORCE_INLINE
inline
DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT
: mFile(nullptr)
, mFilename("")
@ -125,7 +125,7 @@ DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT
}
// ----------------------------------------------------------------------------------
AI_FORCE_INLINE
inline
DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename)
: mFile(pFile)
, mFilename(strFilename)
@ -137,3 +137,4 @@ DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename)
} // ns assimp
#endif //!!AI_DEFAULTIOSTREAM_H_INC

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,14 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @file Default implementation of IOSystem using the standard C file functions */
#pragma once
#ifndef AI_DEFAULTIOSYSTEM_H_INC
#define AI_DEFAULTIOSYSTEM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/IOSystem.hpp>
namespace Assimp {

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -38,14 +38,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef AI_DEFINES_H_INC
#define AI_DEFINES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
// We need those constants, workaround for any platforms where nobody defined them yet
#if (!defined SIZE_MAX)
# define SIZE_MAX (~((size_t)0))
@ -55,4 +47,3 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define UINT_MAX (~((unsigned int)0))
#endif
#endif // AI_DEINES_H_INC

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2008, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -38,17 +38,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef AI_INCLUDED_EXCEPTIONAL_H
#define AI_INCLUDED_EXCEPTIONAL_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef INCLUDED_EXCEPTIONAL_H
#define INCLUDED_EXCEPTIONAL_H
#include <stdexcept>
#include <assimp/DefaultIOStream.h>
using std::runtime_error;
#ifdef _MSC_VER
@ -59,14 +53,17 @@ using std::runtime_error;
/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
* unrecoverable error occurs while importing. Loading APIs return
* NULL instead of a valid aiScene then. */
class DeadlyImportError : public runtime_error {
class DeadlyImportError
: public runtime_error
{
public:
/** Constructor with arguments */
explicit DeadlyImportError( const std::string& errorText)
: runtime_error(errorText) {
// empty
: runtime_error(errorText)
{
}
private:
};
typedef DeadlyImportError DeadlyExportError;
@ -87,7 +84,7 @@ struct ExceptionSwallower {
template <typename T>
struct ExceptionSwallower<T*> {
T* operator ()() const {
return nullptr;
return NULL;
}
};
@ -119,20 +116,10 @@ struct ExceptionSwallower<void> {
{\
try {
#define ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING(type, ASSIMP_END_EXCEPTION_REGION_errorString)\
} catch(const DeadlyImportError& e) {\
ASSIMP_END_EXCEPTION_REGION_errorString = e.what();\
return ExceptionSwallower<type>()();\
} catch(...) {\
ASSIMP_END_EXCEPTION_REGION_errorString = "Unknown exception";\
return ExceptionSwallower<type>()();\
}\
}
#define ASSIMP_END_EXCEPTION_REGION(type)\
} catch(...) {\
return ExceptionSwallower<type>()();\
}\
}
#endif // AI_INCLUDED_EXCEPTIONAL_H
#endif // INCLUDED_EXCEPTIONAL_H

View file

@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -46,10 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_EXPORT_HPP_INC
#define AI_EXPORT_HPP_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef ASSIMP_BUILD_NO_EXPORT
#include "cexport.h"

View file

@ -2,7 +2,8 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -39,30 +40,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
#define AI_GENERIC_PROPERTY_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/Hash.h>
#include <assimp/ai_assert.h>
#include <assimp/Importer.hpp>
#include <assimp/ai_assert.h>
#include "Hash.h"
#include <map>
// ------------------------------------------------------------------------------------------------
template <class T>
inline bool SetGenericProperty(std::map<unsigned int, T> &list,
const char *szName, const T &value) {
inline
bool SetGenericProperty(std::map< unsigned int, T >& list,
const char* szName, const T& value) {
ai_assert(nullptr != szName);
const uint32_t hash = SuperFastHash(szName);
typename std::map<unsigned int, T>::iterator it = list.find(hash);
if (it == list.end()) {
list.insert(std::pair<unsigned int, T>(hash, value));
if (it == list.end()) {
list.insert(std::pair<unsigned int, T>( hash, value ));
return false;
}
(*it).second = value;
@ -72,8 +69,9 @@ inline bool SetGenericProperty(std::map<unsigned int, T> &list,
// ------------------------------------------------------------------------------------------------
template <class T>
inline const T &GetGenericProperty(const std::map<unsigned int, T> &list,
const char *szName, const T &errorReturn) {
inline
const T& GetGenericProperty(const std::map< unsigned int, T >& list,
const char* szName, const T& errorReturn) {
ai_assert(nullptr != szName);
const uint32_t hash = SuperFastHash(szName);
@ -89,21 +87,22 @@ inline const T &GetGenericProperty(const std::map<unsigned int, T> &list,
// Special version for pointer types - they will be deleted when replaced with another value
// passing NULL removes the whole property
template <class T>
inline void SetGenericPropertyPtr(std::map<unsigned int, T *> &list,
const char *szName, T *value, bool *bWasExisting = nullptr) {
inline
void SetGenericPropertyPtr(std::map< unsigned int, T* >& list,
const char* szName, T* value, bool* bWasExisting = nullptr ) {
ai_assert(nullptr != szName);
const uint32_t hash = SuperFastHash(szName);
typename std::map<unsigned int, T *>::iterator it = list.find(hash);
if (it == list.end()) {
typename std::map<unsigned int, T*>::iterator it = list.find(hash);
if (it == list.end()) {
if (bWasExisting) {
*bWasExisting = false;
}
list.insert(std::pair<unsigned int, T *>(hash, value));
list.insert(std::pair<unsigned int,T*>( hash, value ));
return;
}
if ((*it).second != value) {
if ((*it).second != value) {
delete (*it).second;
(*it).second = value;
}
@ -117,8 +116,9 @@ inline void SetGenericPropertyPtr(std::map<unsigned int, T *> &list,
// ------------------------------------------------------------------------------------------------
template <class T>
inline bool HasGenericProperty(const std::map<unsigned int, T> &list,
const char *szName) {
inline
bool HasGenericProperty(const std::map< unsigned int, T >& list,
const char* szName) {
ai_assert(nullptr != szName);
const uint32_t hash = SuperFastHash(szName);

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -39,14 +39,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef AI_HASH_H_INCLUDED
#define AI_HASH_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <stdint.h>
#include <string.h>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,18 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_IOSTREAM_H_INC
#define AI_IOSTREAM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include "types.h"
#ifndef __cplusplus
# error This header requires C++ to be used. aiFileIO.h is the \
corresponding C interface.
#endif
namespace Assimp {
namespace Assimp {
// ----------------------------------------------------------------------------------
/** @brief CPP-API: Class to handle file I/O for C++
@ -129,13 +125,13 @@ public:
}; //! class IOStream
// ----------------------------------------------------------------------------------
AI_FORCE_INLINE
inline
IOStream::IOStream() AI_NO_EXCEPT {
// empty
}
// ----------------------------------------------------------------------------------
AI_FORCE_INLINE
inline
IOStream::~IOStream() {
// empty
}

View file

@ -1,8 +1,10 @@
#pragma once
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -40,17 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef AI_IOSTREAMBUFFER_H_INC
#define AI_IOSTREAMBUFFER_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/IOStream.hpp>
#include <assimp/ParsingUtils.h>
#include "ParsingUtils.h"
#include <vector>
@ -129,7 +124,7 @@ private:
};
template<class T>
AI_FORCE_INLINE
inline
IOStreamBuffer<T>::IOStreamBuffer( size_t cache )
: m_stream( nullptr )
, m_filesize( 0 )
@ -143,13 +138,13 @@ IOStreamBuffer<T>::IOStreamBuffer( size_t cache )
}
template<class T>
AI_FORCE_INLINE
inline
IOStreamBuffer<T>::~IOStreamBuffer() {
// empty
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::open( IOStream *stream ) {
// file still opened!
if ( nullptr != m_stream ) {
@ -179,7 +174,7 @@ bool IOStreamBuffer<T>::open( IOStream *stream ) {
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::close() {
if ( nullptr == m_stream ) {
return false;
@ -197,19 +192,19 @@ bool IOStreamBuffer<T>::close() {
}
template<class T>
AI_FORCE_INLINE
inline
size_t IOStreamBuffer<T>::size() const {
return m_filesize;
}
template<class T>
AI_FORCE_INLINE
inline
size_t IOStreamBuffer<T>::cacheSize() const {
return m_cacheSize;
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::readNextBlock() {
m_stream->Seek( m_filePos, aiOrigin_SET );
size_t readLen = m_stream->Read( &m_cache[ 0 ], sizeof( T ), m_cacheSize );
@ -227,25 +222,25 @@ bool IOStreamBuffer<T>::readNextBlock() {
}
template<class T>
AI_FORCE_INLINE
inline
size_t IOStreamBuffer<T>::getNumBlocks() const {
return m_numBlocks;
}
template<class T>
AI_FORCE_INLINE
inline
size_t IOStreamBuffer<T>::getCurrentBlockIndex() const {
return m_blockIdx;
}
template<class T>
AI_FORCE_INLINE
inline
size_t IOStreamBuffer<T>::getFilePos() const {
return m_filePos;
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationToken ) {
buffer.resize( m_cacheSize );
if ( m_cachePos >= m_cacheSize || 0 == m_filePos ) {
@ -294,13 +289,13 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
return true;
}
static AI_FORCE_INLINE
static inline
bool isEndOfCache( size_t pos, size_t cacheSize ) {
return ( pos == cacheSize );
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
buffer.resize(m_cacheSize);
if ( isEndOfCache( m_cachePos, m_cacheSize ) || 0 == m_filePos) {
@ -340,7 +335,7 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
}
template<class T>
AI_FORCE_INLINE
inline
bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) {
// Return the last block-value if getNextLine was used before
if ( 0 != m_cachePos ) {
@ -358,5 +353,3 @@ bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) {
}
} // !ns Assimp
#endif // AI_IOSTREAMBUFFER_H_INC

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -50,10 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_IOSYSTEM_H_INC
#define AI_IOSYSTEM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef __cplusplus
# error This header requires C++ to be used. aiFileIO.h is the \
corresponding C interface.

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,10 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_ASSIMP_HPP_INC
#define AI_ASSIMP_HPP_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef __cplusplus
# error This header requires C++ to be used. Use assimp.h for plain C.
#endif // __cplusplus
@ -285,7 +281,7 @@ public:
* The return value remains valid until the property is modified.
* @see GetPropertyInteger()
*/
std::string GetPropertyString(const char* szName,
const std::string GetPropertyString(const char* szName,
const std::string& sErrorReturn = "") const;
// -------------------------------------------------------------------
@ -294,7 +290,7 @@ public:
* The return value remains valid until the property is modified.
* @see GetPropertyInteger()
*/
aiMatrix4x4 GetPropertyMatrix(const char* szName,
const aiMatrix4x4 GetPropertyMatrix(const char* szName,
const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
// -------------------------------------------------------------------

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -48,13 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_LINE_SPLITTER_H
#define INCLUDED_LINE_SPLITTER_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <stdexcept>
#include <assimp/StreamReader.h>
#include <assimp/ParsingUtils.h>
#include "StreamReader.h"
#include "ParsingUtils.h"
namespace Assimp {
@ -72,7 +68,7 @@ for(LineSplitter splitter(stream);splitter;++splitter) {
if (strtol(splitter[2]) > 5) { .. }
}
ASSIMP_LOG_DEBUG_F("Current line is: ", splitter.get_index());
std::cout << "Current line is: " << splitter.get_index() << std::endl;
}
@endcode
*/
@ -144,7 +140,7 @@ private:
bool mSwallow, mSkip_empty_lines, mTrim;
};
AI_FORCE_INLINE
inline
LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_empty_lines, bool trim )
: mIdx(0)
, mCur()
@ -157,12 +153,12 @@ LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_empty_lines, bool t
mIdx = 0;
}
AI_FORCE_INLINE
inline
LineSplitter::~LineSplitter() {
// empty
}
AI_FORCE_INLINE
inline
LineSplitter& LineSplitter::operator++() {
if (mSwallow) {
mSwallow = false;
@ -203,12 +199,12 @@ LineSplitter& LineSplitter::operator++() {
return *this;
}
AI_FORCE_INLINE
inline
LineSplitter &LineSplitter::operator++(int) {
return ++(*this);
}
AI_FORCE_INLINE
inline
const char *LineSplitter::operator[] (size_t idx) const {
const char* s = operator->()->c_str();
@ -226,7 +222,7 @@ const char *LineSplitter::operator[] (size_t idx) const {
}
template <size_t N>
AI_FORCE_INLINE
inline
void LineSplitter::get_tokens(const char* (&tokens)[N]) const {
const char* s = operator->()->c_str();
@ -242,44 +238,44 @@ void LineSplitter::get_tokens(const char* (&tokens)[N]) const {
}
}
AI_FORCE_INLINE
inline
const std::string* LineSplitter::operator -> () const {
return &mCur;
}
AI_FORCE_INLINE
inline
std::string LineSplitter::operator* () const {
return mCur;
}
AI_FORCE_INLINE
inline
LineSplitter::operator bool() const {
return mStream.GetRemainingSize() > 0;
}
AI_FORCE_INLINE
inline
LineSplitter::operator line_idx() const {
return mIdx;
}
AI_FORCE_INLINE
inline
LineSplitter::line_idx LineSplitter::get_index() const {
return mIdx;
}
AI_FORCE_INLINE
inline
StreamReaderLE &LineSplitter::get_stream() {
return mStream;
}
AI_FORCE_INLINE
inline
bool LineSplitter::match_start(const char* check) {
const size_t len = ::strlen(check);
return len <= mCur.length() && std::equal(check, check + len, mCur.begin());
}
AI_FORCE_INLINE
inline
void LineSplitter::swallow_next_increment() {
mSwallow = true;
}

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,14 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file LogAux.h
* @brief Common logging usage patterns for importer implementations
*/
#pragma once
#ifndef INCLUDED_AI_LOGAUX_H
#define INCLUDED_AI_LOGAUX_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/TinyFormatter.h>
#include <assimp/Exceptional.h>
#include <assimp/DefaultLogger.hpp>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.

View file

@ -3,9 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,27 +39,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file commonMetaData.h
* @brief Defines a set of common scene metadata keys.
/* Helper macro to set a pointer to NULL in debug builds
*/
#pragma once
#ifndef AI_COMMONMETADATA_H_INC
#define AI_COMMONMETADATA_H_INC
/// Scene metadata holding the name of the importer which loaded the source asset.
/// This is always present if the scene was created from an imported asset.
#define AI_METADATA_SOURCE_FORMAT "SourceAsset_Format"
/// Scene metadata holding the version of the source asset as a string, if available.
/// Not all formats add this metadata.
#define AI_METADATA_SOURCE_FORMAT_VERSION "SourceAsset_FormatVersion"
/// Scene metadata holding the name of the software which generated the source asset, if available.
/// Not all formats add this metadata.
#define AI_METADATA_SOURCE_GENERATOR "SourceAsset_Generator"
/// Scene metadata holding the source asset copyright statement, if available.
/// Not all formats add this metadata.
#define AI_METADATA_SOURCE_COPYRIGHT "SourceAsset_Copyright"
#if (defined ASSIMP_BUILD_DEBUG)
# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
#else
# define AI_DEBUG_INVALIDATE_PTR(x)
#endif

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2016, assimp team
All rights reserved.
@ -41,10 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#ifdef __GNUC__
# pragma GCC system_header
#endif
/** @file MathFunctions.h
* @brief Implementation of math utility functions.
*

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -42,18 +42,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file MemoryIOWrapper.h
* Handy IOStream/IOSystem implemetation to read directly from a memory buffer */
#pragma once
#ifndef AI_MEMORYIOSTREAM_H_INC
#define AI_MEMORYIOSTREAM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp>
#include <assimp/ai_assert.h>
#include <stdint.h>
namespace Assimp {

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -44,16 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file ParsingUtils.h
* @brief Defines helper functions for text parsing
*/
#pragma once
#ifndef AI_PARSING_UTILS_H_INC
#define AI_PARSING_UTILS_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/StringComparison.h>
#include <assimp/StringUtils.h>
#include "StringComparison.h"
#include "StringUtils.h"
#include <assimp/defs.h>
namespace Assimp {

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,17 +43,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Profiler.h
* @brief Utility to measure the respective runtime of each import step
*/
#pragma once
#ifndef AI_INCLUDED_PROFILER_H
#define AI_INCLUDED_PROFILER_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef INCLUDED_PROFILER_H
#define INCLUDED_PROFILER_H
#include <chrono>
#include <assimp/DefaultLogger.hpp>
#include <assimp/TinyFormatter.h>
#include "TinyFormatter.h"
#include <map>
@ -72,6 +67,7 @@ public:
// empty
}
public:
/** Start a named timer */
void BeginRegion(const std::string& region) {
@ -99,5 +95,5 @@ private:
}
}
#endif // AI_INCLUDED_PROFILER_H
#endif

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -47,13 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_PROGRESSHANDLER_H_INC
#define AI_PROGRESSHANDLER_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include "types.h"
#include <assimp/types.h>
namespace Assimp {
namespace Assimp {
// ------------------------------------------------------------------------------------
/** @brief CPP-API: Abstract interface for custom progress report receivers.

View file

@ -2,7 +2,8 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -42,13 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Declares a helper class, "CommentRemover", which can be
* used to remove comments (single and multi line) from a text file.
*/
#pragma once
#ifndef AI_REMOVE_COMMENTS_H_INC
#define AI_REMOVE_COMMENTS_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
@ -61,7 +58,8 @@ namespace Assimp {
* to those in C or C++ so this code has been moved to a separate
* module.
*/
class ASSIMP_API CommentRemover {
class ASSIMP_API CommentRemover
{
// class cannot be instanced
CommentRemover() {}

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -42,14 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** Small helper classes to optimize finding vertices close to a given location
*/
#pragma once
#ifndef AI_D3DSSPATIALSORT_H_INC
#define AI_D3DSSPATIALSORT_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <vector>
#include <stdint.h>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,22 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Declares a helper class, "SceneCombiner" providing various
* utilities to merge scenes.
*/
#pragma once
#ifndef AI_SCENE_COMBINER_H_INC
#define AI_SCENE_COMBINER_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/ai_assert.h>
#include <assimp/types.h>
#include <assimp/Defines.h>
#include <stddef.h>
#include <set>
#include <list>
#include <stdint.h>
#include <vector>
struct aiScene;
@ -73,7 +68,6 @@ struct aiMesh;
struct aiAnimMesh;
struct aiAnimation;
struct aiNodeAnim;
struct aiMeshMorphAnim;
namespace Assimp {
@ -378,7 +372,6 @@ public:
static void Copy (aiBone** dest, const aiBone* src);
static void Copy (aiLight** dest, const aiLight* src);
static void Copy (aiNodeAnim** dest, const aiNodeAnim* src);
static void Copy (aiMeshMorphAnim** dest, const aiMeshMorphAnim* src);
static void Copy (aiMetadata** dest, const aiMetadata* src);
// recursive, of course

View file

@ -4,7 +4,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -47,14 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* for animation skeletons.
*/
#pragma once
#ifndef AI_SKELETONMESHBUILDER_H_INC
#define AI_SKELETONMESHBUILDER_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <vector>
#include <assimp/mesh.h>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,16 +43,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Defines the helper data structures for importing 3DS files.
http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */
#pragma once
#ifndef AI_SMOOTHINGGROUPS_H_INC
#define AI_SMOOTHINGGROUPS_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/vector3.h>
#include <stdint.h>
#include <vector>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2012, assimp team
All rights reserved.
@ -41,16 +41,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Generation of normal vectors basing on smoothing groups */
#pragma once
#ifndef AI_SMOOTHINGGROUPS_INL_INCLUDED
#define AI_SMOOTHINGGROUPS_INL_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
// internal headers
#include <assimp/SGSpatialSort.h>
// CRT header
#include <algorithm>
using namespace Assimp;

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,14 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** Small helper classes to optimise finding vertizes close to a given location */
#pragma once
#ifndef AI_SPATIALSORT_H_INC
#define AI_SPATIALSORT_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <vector>
#include <assimp/types.h>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -41,16 +41,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @file Declares a helper class, "StandardShapes" which generates
* vertices for standard shapes, such as cylinders, cones, spheres ..
* vertices for standard shapes, such as cylnders, cones, spheres ..
*/
#pragma once
#ifndef AI_STANDARD_SHAPES_H_INC
#define AI_STANDARD_SHAPES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/vector3.h>
#include <vector>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -44,19 +44,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Defines the StreamReader class which reads data from
* a binary stream with a well-defined endianness.
*/
#pragma once
#ifndef AI_STREAMREADER_H_INCLUDED
#define AI_STREAMREADER_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/IOStream.hpp>
#include <assimp/Defines.h>
#include <assimp/ByteSwapper.h>
#include <assimp/Exceptional.h>
#include "ByteSwapper.h"
#include "Exceptional.h"
#include <memory>
namespace Assimp {

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -43,15 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file Defines the StreamWriter class which writes data to
* a binary stream with a well-defined endianness. */
#pragma once
#ifndef AI_STREAMWRITER_H_INCLUDED
#define AI_STREAMWRITER_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/ByteSwapper.h>
#include "ByteSwapper.h"
#include <assimp/IOStream.hpp>
#include <memory>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -49,17 +49,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
These functions are not consistently available on all platforms,
or the provided implementations behave too differently.
*/
#pragma once
#ifndef INCLUDED_AI_STRING_WORKERS_H
#define INCLUDED_AI_STRING_WORKERS_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/ai_assert.h>
#include <assimp/defs.h>
#include <assimp/StringComparison.h>
#include "StringComparison.h"
#include <string.h>
#include <stdint.h>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -39,14 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef INCLUDED_AI_STRINGUTILS_H
#define INCLUDED_AI_STRINGUTILS_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
#include <sstream>

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -45,10 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_SUBDISIVION_H_INC
#define AI_SUBDISIVION_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <cstddef>
#include <assimp/types.h>
struct aiMesh;

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -45,14 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* to get rid of the boost::format dependency. Much slinker,
* basically just extends stringstream.
*/
#pragma once
#ifndef INCLUDED_TINY_FORMATTER_H
#define INCLUDED_TINY_FORMATTER_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <sstream>
namespace Assimp {
@ -70,15 +65,24 @@ namespace Formatter {
* @endcode */
template < typename T,
typename CharTraits = std::char_traits<T>,
typename Allocator = std::allocator<T> >
class basic_formatter {
public:
typedef class std::basic_string<T,CharTraits,Allocator> string;
typedef class std::basic_ostringstream<T,CharTraits,Allocator> stringstream;
typename Allocator = std::allocator<T>
>
class basic_formatter
{
basic_formatter() {
// empty
}
public:
typedef class std::basic_string<
T,CharTraits,Allocator
> string;
typedef class std::basic_ostringstream<
T,CharTraits,Allocator
> stringstream;
public:
basic_formatter() {}
/* Allow basic_formatter<T>'s to be used almost interchangeably
* with std::(w)string or const (w)char* arguments because the
@ -100,10 +104,14 @@ public:
}
#endif
public:
operator string () const {
return underlying.str();
}
/* note - this is declared const because binding temporaries does only
* work for const references, so many function prototypes will
* include const basic_formatter<T>& s but might still want to

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -47,18 +47,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
that are not currently well-defined (and would cause compile errors
due to missing operators in the math library), are commented.
*/
#pragma once
#ifndef AI_VERTEX_H_INC
#define AI_VERTEX_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/vector3.h>
#include <assimp/mesh.h>
#include <assimp/ai_assert.h>
#include <functional>
namespace Assimp {
@ -97,14 +91,23 @@ namespace Assimp {
* to *all* vertex components equally. This is useful for stuff like interpolation
* or subdivision, but won't work if special handling is required for some vertex components. */
// ------------------------------------------------------------------------------------------------
class Vertex {
class Vertex
{
friend Vertex operator + (const Vertex&,const Vertex&);
friend Vertex operator - (const Vertex&,const Vertex&);
// friend Vertex operator + (const Vertex&,ai_real);
// friend Vertex operator - (const Vertex&,ai_real);
friend Vertex operator * (const Vertex&,ai_real);
friend Vertex operator / (const Vertex&,ai_real);
// friend Vertex operator + (ai_real, const Vertex&);
// friend Vertex operator - (ai_real, const Vertex&);
friend Vertex operator * (ai_real, const Vertex&);
// friend Vertex operator / (ai_real, const Vertex&);
public:
Vertex() {}
// ----------------------------------------------------------------------------
@ -155,6 +158,8 @@ public:
}
}
public:
Vertex& operator += (const Vertex& v) {
*this = *this+v;
return *this;
@ -165,6 +170,18 @@ public:
return *this;
}
/*
Vertex& operator += (ai_real v) {
*this = *this+v;
return *this;
}
Vertex& operator -= (ai_real v) {
*this = *this-v;
return *this;
}
*/
Vertex& operator *= (ai_real v) {
*this = *this*v;
return *this;
@ -175,9 +192,12 @@ public:
return *this;
}
public:
// ----------------------------------------------------------------------------
/** Convert back to non-interleaved storage */
void SortBack(aiMesh* out, unsigned int idx) const {
ai_assert(idx<out->mNumVertices);
out->mVertices[idx] = position;
@ -271,6 +291,8 @@ public:
aiColor4D colors[AI_MAX_NUMBER_OF_COLOR_SETS];
};
// ------------------------------------------------------------------------------------------------
AI_FORCE_INLINE Vertex operator + (const Vertex& v0,const Vertex& v1) {
return Vertex::BinaryOp<std::plus>(v0,v1);
@ -280,6 +302,19 @@ AI_FORCE_INLINE Vertex operator - (const Vertex& v0,const Vertex& v1) {
return Vertex::BinaryOp<std::minus>(v0,v1);
}
// ------------------------------------------------------------------------------------------------
/*
AI_FORCE_INLINE Vertex operator + (const Vertex& v0,ai_real f) {
return Vertex::BinaryOp<Intern::plus>(v0,f);
}
AI_FORCE_INLINE Vertex operator - (const Vertex& v0,ai_real f) {
return Vertex::BinaryOp<Intern::minus>(v0,f);
}
*/
AI_FORCE_INLINE Vertex operator * (const Vertex& v0,ai_real f) {
return Vertex::BinaryOp<Intern::multiplies>(v0,f);
}
@ -288,10 +323,26 @@ AI_FORCE_INLINE Vertex operator / (const Vertex& v0,ai_real f) {
return Vertex::BinaryOp<Intern::multiplies>(v0,1.f/f);
}
// ------------------------------------------------------------------------------------------------
/*
AI_FORCE_INLINE Vertex operator + (ai_real f,const Vertex& v0) {
return Vertex::BinaryOp<Intern::plus>(f,v0);
}
AI_FORCE_INLINE Vertex operator - (ai_real f,const Vertex& v0) {
return Vertex::BinaryOp<Intern::minus>(f,v0);
}
*/
AI_FORCE_INLINE Vertex operator * (ai_real f,const Vertex& v0) {
return Vertex::BinaryOp<Intern::multiplies>(f,v0);
}
/*
AI_FORCE_INLINE Vertex operator / (ai_real f,const Vertex& v0) {
return Vertex::BinaryOp<Intern::divides>(f,v0);
}
*/
#endif // AI_VERTEX_H_INC
}
#endif

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -40,14 +40,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#pragma once
#ifndef INCLUDED_ASSIMP_XML_TOOLS_H
#define INCLUDED_ASSIMP_XML_TOOLS_H
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <string>
namespace Assimp {

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -45,50 +45,43 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @brief Implementation of IOSystem to read a ZIP file from another IOSystem
*/
#pragma once
#ifndef AI_ZIPARCHIVEIOSYSTEM_H_INC
#define AI_ZIPARCHIVEIOSYSTEM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp>
namespace Assimp {
class ZipArchiveIOSystem : public IOSystem {
public:
//! Open a Zip using the proffered IOSystem
ZipArchiveIOSystem(IOSystem* pIOHandler, const char *pFilename, const char* pMode = "r");
ZipArchiveIOSystem(IOSystem* pIOHandler, const std::string& rFilename, const char* pMode = "r");
virtual ~ZipArchiveIOSystem();
bool Exists(const char* pFilename) const override;
char getOsSeparator() const override;
IOStream* Open(const char* pFilename, const char* pMode = "rb") override;
void Close(IOStream* pFile) override;
class ZipArchiveIOSystem : public IOSystem {
public:
//! Open a Zip using the proffered IOSystem
ZipArchiveIOSystem(IOSystem* pIOHandler, const char *pFilename, const char* pMode = "r");
ZipArchiveIOSystem(IOSystem* pIOHandler, const std::string& rFilename, const char* pMode = "r");
virtual ~ZipArchiveIOSystem();
bool Exists(const char* pFilename) const override;
char getOsSeparator() const override;
IOStream* Open(const char* pFilename, const char* pMode = "rb") override;
void Close(IOStream* pFile) override;
// Specific to ZIP
//! The file was opened and is a ZIP
bool isOpen() const;
// Specific to ZIP
//! The file was opened and is a ZIP
bool isOpen() const;
//! Get the list of all files with their simplified paths
//! Intended for use within Assimp library boundaries
void getFileList(std::vector<std::string>& rFileList) const;
//! Get the list of all files with their simplified paths
//! Intended for use within Assimp library boundaries
void getFileList(std::vector<std::string>& rFileList) const;
//! Get the list of all files with extension (must be lowercase)
//! Intended for use within Assimp library boundaries
void getFileListExtension(std::vector<std::string>& rFileList, const std::string& extension) const;
//! Get the list of all files with extension (must be lowercase)
//! Intended for use within Assimp library boundaries
void getFileListExtension(std::vector<std::string>& rFileList, const std::string& extension) const;
static bool isZipArchive(IOSystem* pIOHandler, const char *pFilename);
static bool isZipArchive(IOSystem* pIOHandler, const std::string& rFilename);
private:
class Implement;
Implement *pImpl = nullptr;
};
static bool isZipArchive(IOSystem* pIOHandler, const char *pFilename);
static bool isZipArchive(IOSystem* pIOHandler, const std::string& rFilename);
private:
class Implement;
Implement *pImpl = nullptr;
};
} // Namespace Assimp
#endif // AI_ZIPARCHIVEIOSYSTEM_H_INC

View file

@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -43,10 +45,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_AABB_H_INC
#define AI_AABB_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/vector3.h>
struct aiAABB {
@ -71,9 +69,8 @@ struct aiAABB {
// empty
}
#endif // __cplusplus
#endif
};
#endif // AI_AABB_H_INC
#endif

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -44,10 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_ASSERT_H_INC
#define AI_ASSERT_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef ASSIMP_BUILD_DEBUG
# include <assert.h>
# define ai_assert(expression) assert( expression )

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -50,10 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_ANIM_H_INC
#define AI_ANIM_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/quaternion.h>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -47,10 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_CAMERA_H_INC
#define AI_CAMERA_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include "types.h"
#ifdef __cplusplus

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2011, assimp team
All rights reserved.
@ -46,10 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_EXPORT_H_INC
#define AI_EXPORT_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifndef ASSIMP_BUILD_NO_EXPORT
// Public ASSIMP data structures

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,16 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_FILEIO_H_INC
#define AI_FILEIO_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct aiFileIO;
struct aiFile;

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,12 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_ASSIMP_H_INC
#define AI_ASSIMP_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/importerdesc.h>
#include "importerdesc.h"
#ifdef __cplusplus
extern "C" {

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -47,11 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_COLOR4D_H_INC
#define AI_COLOR4D_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
#include "defs.h"
#ifdef __cplusplus
@ -60,7 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* alpha component. Color values range from 0 to 1. */
// ----------------------------------------------------------------------------------
template <typename TReal>
class aiColor4t {
class aiColor4t
{
public:
aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {}
aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a)
@ -68,12 +65,14 @@ public:
explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
aiColor4t (const aiColor4t& o) = default;
public:
// combined operators
const aiColor4t& operator += (const aiColor4t& o);
const aiColor4t& operator -= (const aiColor4t& o);
const aiColor4t& operator *= (TReal f);
const aiColor4t& operator /= (TReal f);
public:
// comparison
bool operator == (const aiColor4t& other) const;
bool operator != (const aiColor4t& other) const;
@ -86,6 +85,8 @@ public:
/** check whether a color is (close to) black */
inline bool IsBlack() const;
public:
// Red, green, blue and alpha color values
TReal r, g, b, a;
}; // !struct aiColor4D

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,61 +48,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_COLOR4D_INL_INC
#define AI_COLOR4D_INL_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
#include <assimp/color4.h>
#include "color4.h"
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const aiColor4t<TReal>& aiColor4t<TReal>::operator += (const aiColor4t<TReal>& o) {
r += o.r;
g += o.g;
b += o.b;
a += o.a;
AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator += (const aiColor4t<TReal>& o) {
r += o.r; g += o.g; b += o.b; a += o.a;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const aiColor4t<TReal>& aiColor4t<TReal>::operator -= (const aiColor4t<TReal>& o) {
r -= o.r;
g -= o.g;
b -= o.b;
a -= o.a;
AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator -= (const aiColor4t<TReal>& o) {
r -= o.r; g -= o.g; b -= o.b; a -= o.a;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const aiColor4t<TReal>& aiColor4t<TReal>::operator *= (TReal f) {
r *= f;
g *= f;
b *= f;
a *= f;
AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator *= (TReal f) {
r *= f; g *= f; b *= f; a *= f;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const aiColor4t<TReal>& aiColor4t<TReal>::operator /= (TReal f) {
r /= f;
g /= f;
b /= f;
a /= f;
AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator /= (TReal f) {
r /= f; g /= f; b /= f; a /= f;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal aiColor4t<TReal>::operator[](unsigned int i) const {
AI_FORCE_INLINE TReal aiColor4t<TReal>::operator[](unsigned int i) const {
switch ( i ) {
case 0:
return r;
@ -119,8 +94,7 @@ TReal aiColor4t<TReal>::operator[](unsigned int i) const {
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal& aiColor4t<TReal>::operator[](unsigned int i) {
AI_FORCE_INLINE TReal& aiColor4t<TReal>::operator[](unsigned int i) {
switch ( i ) {
case 0:
return r;
@ -137,20 +111,17 @@ TReal& aiColor4t<TReal>::operator[](unsigned int i) {
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiColor4t<TReal>::operator== (const aiColor4t<TReal>& other) const {
AI_FORCE_INLINE bool aiColor4t<TReal>::operator== (const aiColor4t<TReal>& other) const {
return r == other.r && g == other.g && b == other.b && a == other.a;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiColor4t<TReal>::operator!= (const aiColor4t<TReal>& other) const {
AI_FORCE_INLINE bool aiColor4t<TReal>::operator!= (const aiColor4t<TReal>& other) const {
return r != other.r || g != other.g || b != other.b || a != other.a;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const {
AI_FORCE_INLINE bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const {
return r < other.r || (
r == other.r && (
g < other.g || (
@ -165,17 +136,14 @@ bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const {
)
);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator + (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
AI_FORCE_INLINE aiColor4t<TReal> operator + (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
return aiColor4t<TReal>( v1.r + v2.r, v1.g + v2.g, v1.b + v2.b, v1.a + v2.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator - (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
AI_FORCE_INLINE aiColor4t<TReal> operator - (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
return aiColor4t<TReal>( v1.r - v2.r, v1.g - v2.g, v1.b - v2.b, v1.a - v2.a);
}
// ------------------------------------------------------------------------------------------------
@ -185,63 +153,53 @@ AI_FORCE_INLINE aiColor4t<TReal> operator * (const aiColor4t<TReal>& v1, const a
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator / (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
AI_FORCE_INLINE aiColor4t<TReal> operator / (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) {
return aiColor4t<TReal>( v1.r / v2.r, v1.g / v2.g, v1.b / v2.b, v1.a / v2.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator * ( TReal f, const aiColor4t<TReal>& v) {
AI_FORCE_INLINE aiColor4t<TReal> operator * ( TReal f, const aiColor4t<TReal>& v) {
return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator * ( const aiColor4t<TReal>& v, TReal f) {
AI_FORCE_INLINE aiColor4t<TReal> operator * ( const aiColor4t<TReal>& v, TReal f) {
return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator / ( const aiColor4t<TReal>& v, TReal f) {
AI_FORCE_INLINE aiColor4t<TReal> operator / ( const aiColor4t<TReal>& v, TReal f) {
return v * (1/f);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator / ( TReal f,const aiColor4t<TReal>& v) {
AI_FORCE_INLINE aiColor4t<TReal> operator / ( TReal f,const aiColor4t<TReal>& v) {
return aiColor4t<TReal>(f,f,f,f)/v;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator + ( const aiColor4t<TReal>& v, TReal f) {
AI_FORCE_INLINE aiColor4t<TReal> operator + ( const aiColor4t<TReal>& v, TReal f) {
return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator - ( const aiColor4t<TReal>& v, TReal f) {
AI_FORCE_INLINE aiColor4t<TReal> operator - ( const aiColor4t<TReal>& v, TReal f) {
return aiColor4t<TReal>( v.r-f, v.g-f, v.b-f, v.a-f);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator + ( TReal f, const aiColor4t<TReal>& v) {
AI_FORCE_INLINE aiColor4t<TReal> operator + ( TReal f, const aiColor4t<TReal>& v) {
return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiColor4t<TReal> operator - ( TReal f, const aiColor4t<TReal>& v) {
AI_FORCE_INLINE aiColor4t<TReal> operator - ( TReal f, const aiColor4t<TReal>& v) {
return aiColor4t<TReal>( f-v.r, f-v.g, f-v.b, f-v.a);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiColor4t<TReal>::IsBlack() const {
inline bool aiColor4t<TReal> :: IsBlack() const {
// The alpha component doesn't care here. black is black.
static const TReal epsilon = 10e-3f;
return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;

View file

@ -1013,4 +1013,6 @@ enum aiComponent
* Property type: Bool. Default value: undefined.
*/
/* #undef ASSIMP_DOUBLE_PRECISION */
#endif // !! AI_CONFIG_H_INC

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2018, assimp team
All rights reserved.
@ -695,73 +695,6 @@ enum aiComponent
#define AI_CONFIG_IMPORT_SMD_KEYFRAME "IMPORT_SMD_KEYFRAME"
#define AI_CONFIG_IMPORT_UNREAL_KEYFRAME "IMPORT_UNREAL_KEYFRAME"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read animations.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS "IMPORT_MDL_HL1_READ_ANIMATIONS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read animation events.
* \note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATION_EVENTS "IMPORT_MDL_HL1_READ_ANIMATION_EVENTS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read blend controllers.
* \note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS "IMPORT_MDL_HL1_READ_BLEND_CONTROLLERS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read sequence transition graph.
* \note This property requires AI_CONFIG_IMPORT_MDL_HL1_READ_ANIMATIONS to be set to true.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS "IMPORT_MDL_HL1_READ_SEQUENCE_TRANSITIONS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read attachments info.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_ATTACHMENTS "IMPORT_MDL_HL1_READ_ATTACHMENTS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read bone controllers info.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_BONE_CONTROLLERS "IMPORT_MDL_HL1_READ_BONE_CONTROLLERS"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read hitboxes info.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_HITBOXES "IMPORT_MDL_HL1_READ_HITBOXES"
// ---------------------------------------------------------------------------
/** @brief Set whether the MDL (HL1) importer will read miscellaneous global model info.
*
* The default value is true (1)
* Property type: bool
*/
#define AI_CONFIG_IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO "IMPORT_MDL_HL1_READ_MISC_GLOBAL_INFO"
// ---------------------------------------------------------------------------
/** Smd load multiple animations
*

View file

@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -48,10 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_DEFINES_H_INC
#define AI_DEFINES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/config.h>
//////////////////////////////////////////////////////////////////////////
@ -128,14 +126,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* GENBOUNDINGBOXES */
//////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
#ifdef _MSC_VER
# undef ASSIMP_API
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
//////////////////////////////////////////////////////////////////////////
# ifdef ASSIMP_BUILD_DLL_EXPORT
# define ASSIMP_API __declspec(dllexport)
# define ASSIMP_API_WINONLY __declspec(dllexport)
# pragma warning (disable : 4251)
//////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
@ -148,19 +148,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define ASSIMP_API
# define ASSIMP_API_WINONLY
# endif
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else
# define ASSIMP_API __attribute__ ((visibility("default")))
# define ASSIMP_API_WINONLY
#endif
#ifdef _MSC_VER
# ifdef ASSIMP_BUILD_DLL_EXPORT
# pragma warning (disable : 4251)
# endif
/* Force the compiler to inline a function, if possible
*/
# define AI_FORCE_INLINE __forceinline
@ -168,12 +156,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Tells the compiler that a function never returns. Used in code analysis
* to skip dead paths (e.g. after an assertion evaluated to false). */
# define AI_WONT_RETURN __declspec(noreturn)
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else
# define AI_WONT_RETURN
# define ASSIMP_API __attribute__ ((visibility("default")))
# define ASSIMP_API_WINONLY
# define AI_FORCE_INLINE inline
#endif // (defined _MSC_VER)
@ -298,19 +291,14 @@ static const ai_real ai_epsilon = (ai_real) 0.00001;
#endif
/**
* To avoid running out of memory
* This can be adjusted for specific use cases
* It's NOT a total limit, just a limit for individual allocations
/* To avoid running out of memory
* This can be adjusted for specific use cases
* It's NOT a total limit, just a limit for individual allocations
*/
#define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type))
#ifndef _MSC_VER
# if __cplusplus >= 201103L // C++11
# define AI_NO_EXCEPT noexcept
# else
# define AI_NO_EXCEPT
# endif
# define AI_NO_EXCEPT noexcept
#else
# if (_MSC_VER >= 1915 )
# define AI_NO_EXCEPT noexcept
@ -319,13 +307,4 @@ static const ai_real ai_epsilon = (ai_real) 0.00001;
# endif
#endif // _MSC_VER
/**
* Helper macro to set a pointer to NULL in debug builds
*/
#if (defined ASSIMP_BUILD_DEBUG)
# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
#else
# define AI_DEBUG_INVALIDATE_PTR(x)
#endif
#endif // !! AI_DEFINES_H_INC

View file

@ -13,14 +13,10 @@
// to ensure long numbers are handled correctly
// ------------------------------------------------------------------------------------
#pragma once
#ifndef FAST_A_TO_F_H_INCLUDED
#define FAST_A_TO_F_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <cmath>
#include <limits>
#include <stdint.h>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,14 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_IMPORTER_DESC_H_INC
#define AI_IMPORTER_DESC_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
/** Mixed set of flags for #aiImporterDesc, indicating some features
* common to many importers*/
enum aiImporterFlags {
enum aiImporterFlags
{
/** Indicates that there is a textual encoding of the
* file format; and that it is supported.*/
aiImporterFlags_SupportTextFlavour = 0x1,
@ -90,7 +87,8 @@ enum aiImporterFlags {
* as importers/exporters are added to Assimp, so it might be useful
* to have a common mechanism to query some rough importer
* characteristics. */
struct aiImporterDesc {
struct aiImporterDesc
{
/** Full name of the importer (i.e. Blender3D importer)*/
const char* mName;

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -49,11 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_LIGHT_H_INC
#define AI_LIGHT_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include "types.h"
#ifdef __cplusplus
extern "C" {

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,11 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MATERIAL_H_INC
#define AI_MATERIAL_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include "types.h"
#ifdef __cplusplus
extern "C" {
@ -312,10 +308,6 @@ enum aiTextureType
#define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
// -------------------------------------------------------------------------------
// Get a string for a given aiTextureType
ASSIMP_API const char* TextureTypeToString(enum aiTextureType in);
// ---------------------------------------------------------------------------
/** @brief Defines all shading models supported by the library
*

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -49,18 +49,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MATERIAL_INL_INC
#define AI_MATERIAL_INL_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiPropertyTypeInfo ai_real_to_property_type_info(float) {
inline aiPropertyTypeInfo ai_real_to_property_type_info(float)
{
return aiPTI_Float;
}
AI_FORCE_INLINE
aiPropertyTypeInfo ai_real_to_property_type_info(double) {
inline aiPropertyTypeInfo ai_real_to_property_type_info(double)
{
return aiPTI_Double;
}
// ---------------------------------------------------------------------------
@ -68,30 +64,30 @@ aiPropertyTypeInfo ai_real_to_property_type_info(double) {
//! @cond never
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::GetTexture( aiTextureType type,
unsigned int index,
C_STRUCT aiString* path,
aiTextureMapping* mapping /*= NULL*/,
unsigned int* uvindex /*= NULL*/,
ai_real* blend /*= NULL*/,
aiTextureOp* op /*= NULL*/,
aiTextureMapMode* mapmode /*= NULL*/) const {
inline aiReturn aiMaterial::GetTexture( aiTextureType type,
unsigned int index,
C_STRUCT aiString* path,
aiTextureMapping* mapping /*= NULL*/,
unsigned int* uvindex /*= NULL*/,
ai_real* blend /*= NULL*/,
aiTextureOp* op /*= NULL*/,
aiTextureMapMode* mapmode /*= NULL*/) const
{
return ::aiGetMaterialTexture(this,type,index,path,mapping,uvindex,blend,op,mapmode);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
unsigned int aiMaterial::GetTextureCount(aiTextureType type) const {
inline unsigned int aiMaterial::GetTextureCount(aiTextureType type) const
{
return ::aiGetMaterialTextureCount(this,type);
}
// ---------------------------------------------------------------------------
template <typename Type>
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx, Type* pOut,
unsigned int* pMax) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx, Type* pOut,
unsigned int* pMax) const
{
unsigned int iNum = pMax ? *pMax : 1;
const aiMaterialProperty* prop;
@ -118,9 +114,9 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
// ---------------------------------------------------------------------------
template <typename Type>
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,Type& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,Type& pOut) const
{
const aiMaterialProperty* prop;
const aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,
(const aiMaterialProperty**)&prop);
@ -140,56 +136,60 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,ai_real* pOut,
unsigned int* pMax) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,ai_real* pOut,
unsigned int* pMax) const
{
return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,int* pOut,
unsigned int* pMax) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,int* pOut,
unsigned int* pMax) const
{
return ::aiGetMaterialIntegerArray(this,pKey,type,idx,pOut,pMax);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,ai_real& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,ai_real& pOut) const
{
return aiGetMaterialFloat(this,pKey,type,idx,&pOut);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,int& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,int& pOut) const
{
return aiGetMaterialInteger(this,pKey,type,idx,&pOut);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiColor4D& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiColor4D& pOut) const
{
return aiGetMaterialColor(this,pKey,type,idx,&pOut);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiColor3D& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiColor3D& pOut) const
{
aiColor4D c;
const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c);
pOut = aiColor3D(c.r,c.g,c.b);
return ret;
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiString& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiString& pOut) const
{
return aiGetMaterialString(this,pKey,type,idx,&pOut);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiUVTransform& pOut) const {
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,aiUVTransform& pOut) const
{
return aiGetMaterialUVTransform(this,pKey,type,idx,&pOut);
}
// ---------------------------------------------------------------------------
template<class TYPE>
aiReturn aiMaterial::AddProperty (const TYPE* pInput,
@ -204,83 +204,84 @@ aiReturn aiMaterial::AddProperty (const TYPE* pInput,
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const float* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const float* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(float),
pKey,type,index,aiPTI_Float);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const double* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const double* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(double),
pKey,type,index,aiPTI_Double);
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiUVTransform),
pKey,type,index,ai_real_to_property_type_info(pInput->mRotation));
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const aiColor4D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const aiColor4D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor4D),
pKey,type,index,ai_real_to_property_type_info(pInput->a));
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const aiColor3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const aiColor3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor3D),
pKey,type,index,ai_real_to_property_type_info(pInput->b));
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const aiVector3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const aiVector3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiVector3D),
pKey,type,index,ai_real_to_property_type_info(pInput->x));
}
// ---------------------------------------------------------------------------
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty(const int* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty(const int* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(int),
pKey,type,index,aiPTI_Integer);
@ -295,12 +296,12 @@ aiReturn aiMaterial::AddProperty(const int* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<float>(const float* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<float>(const float* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(float),
pKey,type,index,aiPTI_Float);
@ -308,12 +309,12 @@ aiReturn aiMaterial::AddProperty<float>(const float* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<double>(const double* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<double>(const double* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(double),
pKey,type,index,aiPTI_Double);
@ -321,12 +322,12 @@ aiReturn aiMaterial::AddProperty<double>(const double* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiUVTransform),
pKey,type,index,aiPTI_Float);
@ -334,12 +335,12 @@ aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor4D),
pKey,type,index,aiPTI_Float);
@ -347,12 +348,12 @@ aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor3D),
pKey,type,index,aiPTI_Float);
@ -360,12 +361,12 @@ aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiVector3D),
pKey,type,index,aiPTI_Float);
@ -373,12 +374,12 @@ aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput,
// ---------------------------------------------------------------------------
template<>
AI_FORCE_INLINE
aiReturn aiMaterial::AddProperty<int>(const int* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index) {
inline aiReturn aiMaterial::AddProperty<int>(const int* pInput,
const unsigned int pNumValues,
const char* pKey,
unsigned int type,
unsigned int index)
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(int),
pKey,type,index,aiPTI_Integer);

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,11 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MATRIX3X3_H_INC
#define AI_MATRIX3X3_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
#include "defs.h"
#ifdef __cplusplus
@ -69,8 +65,10 @@ template <typename T> class aiVector2t;
* defined thereby.
*/
template <typename TReal>
class aiMatrix3x3t {
class aiMatrix3x3t
{
public:
aiMatrix3x3t() AI_NO_EXCEPT :
a1(static_cast<TReal>(1.0f)), a2(), a3(),
b1(), b2(static_cast<TReal>(1.0f)), b3(),
@ -84,6 +82,8 @@ public:
c1(_c1), c2(_c2), c3(_c3)
{}
public:
// matrix multiplication.
aiMatrix3x3t& operator *= (const aiMatrix3x3t& m);
aiMatrix3x3t operator * (const aiMatrix3x3t& m) const;
@ -93,14 +93,16 @@ public:
const TReal* operator[] (unsigned int p_iIndex) const;
// comparison operators
bool operator== (const aiMatrix3x3t<TReal>& m) const;
bool operator!= (const aiMatrix3x3t<TReal>& m) const;
bool operator== (const aiMatrix4x4t<TReal>& m) const;
bool operator!= (const aiMatrix4x4t<TReal>& m) const;
bool Equal(const aiMatrix3x3t<TReal>& m, TReal epsilon = 1e-6) const;
bool Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon = 1e-6) const;
template <typename TOther>
operator aiMatrix3x3t<TOther> () const;
public:
// -------------------------------------------------------------------
/** @brief Construction from a 4x4 matrix. The remaining parts
* of the matrix are ignored.
@ -120,6 +122,7 @@ public:
aiMatrix3x3t& Inverse();
TReal Determinant() const;
public:
// -------------------------------------------------------------------
/** @brief Returns a rotation matrix for a rotation around z
* @param a Rotation angle, in radians

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,14 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MATRIX3X3_INL_INC
#define AI_MATRIX3X3_INL_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
#include <assimp/matrix3x3.h>
#include <assimp/matrix4x4.h>
#include "matrix3x3.h"
#include "matrix4x4.h"
#include <algorithm>
#include <cmath>
#include <limits>
@ -63,8 +59,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ------------------------------------------------------------------------------------------------
// Construction from a 4x4 matrix. The remaining parts of the matrix are ignored.
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix) {
inline aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix)
{
a1 = pMatrix.a1; a2 = pMatrix.a2; a3 = pMatrix.a3;
b1 = pMatrix.b1; b2 = pMatrix.b2; b3 = pMatrix.b3;
c1 = pMatrix.c1; c2 = pMatrix.c2; c3 = pMatrix.c3;
@ -72,8 +68,8 @@ aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix) {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& m) {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& m)
{
*this = aiMatrix3x3t<TReal>(m.a1 * a1 + m.b1 * a2 + m.c1 * a3,
m.a2 * a1 + m.b2 * a2 + m.c2 * a3,
m.a3 * a1 + m.b3 * a2 + m.c3 * a3,
@ -89,7 +85,8 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>
// ------------------------------------------------------------------------------------------------
template <typename TReal>
template <typename TOther>
aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const {
aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const
{
return aiMatrix3x3t<TOther>(static_cast<TOther>(a1),static_cast<TOther>(a2),static_cast<TOther>(a3),
static_cast<TOther>(b1),static_cast<TOther>(b2),static_cast<TOther>(b3),
static_cast<TOther>(c1),static_cast<TOther>(c2),static_cast<TOther>(c3));
@ -97,8 +94,8 @@ aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m) const {
inline aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m) const
{
aiMatrix3x3t<TReal> temp( *this);
temp *= m;
return temp;
@ -106,8 +103,7 @@ aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) {
inline TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) {
switch ( p_iIndex ) {
case 0:
return &a1;
@ -123,8 +119,7 @@ TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const {
inline const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const {
switch ( p_iIndex ) {
case 0:
return &a1;
@ -140,8 +135,8 @@ const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiMatrix3x3t<TReal>::operator== (const aiMatrix3x3t<TReal>& m) const {
inline bool aiMatrix3x3t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const
{
return a1 == m.a1 && a2 == m.a2 && a3 == m.a3 &&
b1 == m.b1 && b2 == m.b2 && b3 == m.b3 &&
c1 == m.c1 && c2 == m.c2 && c3 == m.c3;
@ -149,15 +144,14 @@ bool aiMatrix3x3t<TReal>::operator== (const aiMatrix3x3t<TReal>& m) const {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiMatrix3x3t<TReal>::operator!= (const aiMatrix3x3t<TReal>& m) const {
inline bool aiMatrix3x3t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const
{
return !(*this == m);
}
// ---------------------------------------------------------------------------
template<typename TReal>
AI_FORCE_INLINE
bool aiMatrix3x3t<TReal>::Equal(const aiMatrix3x3t<TReal>& m, TReal epsilon) const {
inline bool aiMatrix3x3t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const {
return
std::abs(a1 - m.a1) <= epsilon &&
std::abs(a2 - m.a2) <= epsilon &&
@ -172,8 +166,8 @@ bool aiMatrix3x3t<TReal>::Equal(const aiMatrix3x3t<TReal>& m, TReal epsilon) con
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose() {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose()
{
// (TReal&) don't remove, GCC complains cause of packed fields
std::swap( (TReal&)a2, (TReal&)b1);
std::swap( (TReal&)a3, (TReal&)c1);
@ -183,15 +177,15 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose() {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal aiMatrix3x3t<TReal>::Determinant() const {
inline TReal aiMatrix3x3t<TReal>::Determinant() const
{
return a1*b2*c3 - a1*b3*c2 + a2*b3*c1 - a2*b1*c3 + a3*b1*c2 - a3*b2*c1;
}
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse() {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse()
{
// Compute the reciprocal determinant
TReal det = Determinant();
if(det == static_cast<TReal>(0.0))
@ -225,8 +219,8 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse() {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out) {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out)
{
out.a1 = out.b2 = std::cos(a);
out.b1 = std::sin(a);
out.a2 = - out.b1;
@ -240,8 +234,8 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>
// ------------------------------------------------------------------------------------------------
// Returns a rotation matrix for a rotation around an arbitrary axis.
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out) {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out)
{
TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
TReal x = axis.x, y = axis.y, z = axis.z;
@ -255,8 +249,8 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TR
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>& v, aiMatrix3x3t<TReal>& out) {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>& v, aiMatrix3x3t<TReal>& out)
{
out = aiMatrix3x3t<TReal>();
out.a3 = v.x;
out.b3 = v.y;
@ -274,8 +268,9 @@ aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>&
*/
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<TReal>& from,
const aiVector3t<TReal>& to, aiMatrix3x3t<TReal>& mtx) {
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<TReal>& from,
const aiVector3t<TReal>& to, aiMatrix3x3t<TReal>& mtx)
{
const TReal e = from * to;
const TReal f = (e < 0)? -e:e;
@ -357,5 +352,6 @@ AI_FORCE_INLINE aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiV
return mtx;
}
#endif // __cplusplus
#endif // AI_MATRIX3X3_INL_INC

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -47,12 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MATRIX4X4_H_INC
#define AI_MATRIX4X4_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/vector3.h>
#include <assimp/defs.h>
#include "vector3.h"
#include "defs.h"
#ifdef __cplusplus
@ -70,7 +66,8 @@ template<typename TReal> class aiQuaterniont;
* defined thereby.
*/
template<typename TReal>
class aiMatrix4x4t {
class aiMatrix4x4t
{
public:
/** set to identity */
@ -94,6 +91,8 @@ public:
aiMatrix4x4t(const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation,
const aiVector3t<TReal>& position);
public:
// array access operators
/** @fn TReal* operator[] (unsigned int p_iIndex)
* @param [in] p_iIndex - index of the row.
@ -121,6 +120,8 @@ public:
template <typename TOther>
operator aiMatrix4x4t<TOther> () const;
public:
// -------------------------------------------------------------------
/** @brief Transpose the matrix */
aiMatrix4x4t& Transpose();
@ -181,6 +182,7 @@ public:
void DecomposeNoScaling (aiQuaterniont<TReal>& rotation,
aiVector3t<TReal>& position) const;
// -------------------------------------------------------------------
/** @brief Creates a trafo matrix from a set of euler angles
* @param x Rotation angle for the x-axis, in radians
@ -190,6 +192,7 @@ public:
aiMatrix4x4t& FromEulerAnglesXYZ(TReal x, TReal y, TReal z);
aiMatrix4x4t& FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb);
public:
// -------------------------------------------------------------------
/** @brief Returns a rotation matrix for a rotation around the x axis
* @param a Rotation angle, in radians
@ -253,6 +256,7 @@ public:
static aiMatrix4x4t& FromToMatrix(const aiVector3t<TReal>& from,
const aiVector3t<TReal>& to, aiMatrix4x4t& out);
public:
TReal a1, a2, a3, a4;
TReal b1, b2, b3, b4;
TReal c1, c2, c3, c4;

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -60,11 +60,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ----------------------------------------------------------------------------------------
template <typename TReal>
aiMatrix4x4t<TReal>::aiMatrix4x4t() AI_NO_EXCEPT :
a1(1.0f), a2(), a3(), a4(),
b1(), b2(1.0f), b3(), b4(),
c1(), c2(), c3(1.0f), c4(),
d1(), d2(), d3(), d4(1.0f) {
// empty
a1(1.0f), a2(), a3(), a4(),
b1(), b2(1.0f), b3(), b4(),
c1(), c2(), c3(1.0f), c4(),
d1(), d2(), d3(), d4(1.0f)
{
}
// ----------------------------------------------------------------------------------------
@ -73,17 +74,19 @@ aiMatrix4x4t<TReal>::aiMatrix4x4t (TReal _a1, TReal _a2, TReal _a3, TReal _a4,
TReal _b1, TReal _b2, TReal _b3, TReal _b4,
TReal _c1, TReal _c2, TReal _c3, TReal _c4,
TReal _d1, TReal _d2, TReal _d3, TReal _d4) :
a1(_a1), a2(_a2), a3(_a3), a4(_a4),
b1(_b1), b2(_b2), b3(_b3), b4(_b4),
c1(_c1), c2(_c2), c3(_c3), c4(_c4),
d1(_d1), d2(_d2), d3(_d3), d4(_d4) {
// empty
a1(_a1), a2(_a2), a3(_a3), a4(_a4),
b1(_b1), b2(_b2), b3(_b3), b4(_b4),
c1(_c1), c2(_c2), c3(_c3), c4(_c4),
d1(_d1), d2(_d2), d3(_d3), d4(_d4)
{
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
template <typename TOther>
aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const {
aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const
{
return aiMatrix4x4t<TOther>(static_cast<TOther>(a1),static_cast<TOther>(a2),static_cast<TOther>(a3),static_cast<TOther>(a4),
static_cast<TOther>(b1),static_cast<TOther>(b2),static_cast<TOther>(b3),static_cast<TOther>(b4),
static_cast<TOther>(c1),static_cast<TOther>(c2),static_cast<TOther>(c3),static_cast<TOther>(c4),
@ -93,8 +96,8 @@ aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m) {
inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m)
{
a1 = m.a1; a2 = m.a2; a3 = m.a3; a4 = static_cast<TReal>(0.0);
b1 = m.b1; b2 = m.b2; b3 = m.b3; b4 = static_cast<TReal>(0.0);
c1 = m.c1; c2 = m.c2; c3 = m.c3; c4 = static_cast<TReal>(0.0);
@ -103,8 +106,8 @@ aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m) {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation, const aiVector3t<TReal>& position) {
inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation, const aiVector3t<TReal>& position)
{
// build a 3x3 rotation matrix
aiMatrix3x3t<TReal> m = rotation.GetMatrix();
@ -131,8 +134,8 @@ aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, const aiQua
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t<TReal>& m) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t<TReal>& m)
{
*this = aiMatrix4x4t<TReal>(
m.a1 * a1 + m.b1 * a2 + m.c1 * a3 + m.d1 * a4,
m.a2 * a1 + m.b2 * a2 + m.c2 * a3 + m.d2 * a4,
@ -155,7 +158,8 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t<TReal>
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal& aFloat) const {
inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal& aFloat) const
{
aiMatrix4x4t<TReal> temp(
a1 * aFloat,
a2 * aFloat,
@ -178,8 +182,8 @@ AI_FORCE_INLINE aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal&
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TReal>& m) const {
inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TReal>& m) const
{
aiMatrix4x4t<TReal> temp(
m.a1 + a1,
m.a2 + a2,
@ -202,16 +206,18 @@ aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TReal>& m
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const aiMatrix4x4t<TReal>& m) const {
inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const aiMatrix4x4t<TReal>& m) const
{
aiMatrix4x4t<TReal> temp( *this);
temp *= m;
return temp;
}
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose() {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose()
{
// (TReal&) don't remove, GCC complains cause of packed fields
std::swap( (TReal&)b1, (TReal&)a2);
std::swap( (TReal&)c1, (TReal&)a3);
@ -222,10 +228,11 @@ AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose() {
return *this;
}
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal aiMatrix4x4t<TReal>::Determinant() const {
inline TReal aiMatrix4x4t<TReal>::Determinant() const
{
return a1*b2*c3*d4 - a1*b2*c4*d3 + a1*b3*c4*d2 - a1*b3*c2*d4
+ a1*b4*c2*d3 - a1*b4*c3*d2 - a2*b3*c4*d1 + a2*b3*c1*d4
- a2*b4*c1*d3 + a2*b4*c3*d1 - a2*b1*c3*d4 + a2*b1*c4*d3
@ -236,8 +243,8 @@ TReal aiMatrix4x4t<TReal>::Determinant() const {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse() {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse()
{
// Compute the reciprocal determinant
const TReal det = Determinant();
if(det == static_cast<TReal>(0.0))
@ -281,10 +288,9 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse() {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) {
inline TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) {
if (p_iIndex > 3) {
return nullptr;
return NULL;
}
switch ( p_iIndex ) {
case 0:
@ -303,10 +309,9 @@ TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const {
inline const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const {
if (p_iIndex > 3) {
return nullptr;
return NULL;
}
switch ( p_iIndex ) {
@ -326,8 +331,8 @@ const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const {
inline bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const
{
return (a1 == m.a1 && a2 == m.a2 && a3 == m.a3 && a4 == m.a4 &&
b1 == m.b1 && b2 == m.b2 && b3 == m.b3 && b4 == m.b4 &&
c1 == m.c1 && c2 == m.c2 && c3 == m.c3 && c4 == m.c4 &&
@ -336,15 +341,14 @@ bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiMatrix4x4t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const {
inline bool aiMatrix4x4t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const
{
return !(*this == m);
}
// ---------------------------------------------------------------------------
template<typename TReal>
AI_FORCE_INLINE
bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const {
inline bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const {
return
std::abs(a1 - m.a1) <= epsilon &&
std::abs(a2 - m.a2) <= epsilon &&
@ -396,10 +400,13 @@ bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) con
\
do {} while(false)
template <typename TReal>
AI_FORCE_INLINE
void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuaterniont<TReal>& pRotation,
aiVector3t<TReal>& pPosition) const {
inline void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuaterniont<TReal>& pRotation,
aiVector3t<TReal>& pPosition) const
{
ASSIMP_MATRIX4_4_DECOMPOSE_PART;
// build a 3x3 rotation matrix
@ -412,7 +419,7 @@ void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuaterniont<
}
template <typename TReal>
AI_FORCE_INLINE
inline
void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotation, aiVector3t<TReal>& pPosition) const {
ASSIMP_MATRIX4_4_DECOMPOSE_PART;
@ -467,10 +474,10 @@ void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TRea
#undef ASSIMP_MATRIX4_4_DECOMPOSE_PART
template <typename TReal>
AI_FORCE_INLINE
void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotationAxis, TReal& pRotationAngle,
aiVector3t<TReal>& pPosition) const {
aiQuaterniont<TReal> pRotation;
inline void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotationAxis, TReal& pRotationAngle,
aiVector3t<TReal>& pPosition) const
{
aiQuaterniont<TReal> pRotation;
Decompose(pScaling, pRotation, pPosition);
pRotation.Normalize();
@ -492,9 +499,9 @@ void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TRea
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotation,
aiVector3t<TReal>& position) const {
inline void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotation,
aiVector3t<TReal>& position) const
{
const aiMatrix4x4t<TReal>& _this = *this;
// extract translation
@ -508,15 +515,15 @@ void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotation,
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb)
{
return FromEulerAnglesXYZ(blubb.x,blubb.y,blubb.z);
}
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TReal y, TReal z) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TReal y, TReal z)
{
aiMatrix4x4t<TReal>& _this = *this;
TReal cx = std::cos(x);
@ -544,8 +551,8 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TReal y, T
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
bool aiMatrix4x4t<TReal>::IsIdentity() const {
inline bool aiMatrix4x4t<TReal>::IsIdentity() const
{
// Use a small epsilon to solve floating-point inaccuracies
const static TReal epsilon = 10e-3f;
@ -569,8 +576,8 @@ bool aiMatrix4x4t<TReal>::IsIdentity() const {
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t<TReal>& out) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t<TReal>& out)
{
/*
| 1 0 0 0 |
M = | 0 cos(A) -sin(A) 0 |
@ -584,8 +591,8 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t<TReal>
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t<TReal>& out) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t<TReal>& out)
{
/*
| cos(A) 0 sin(A) 0 |
M = | 0 1 0 0 |
@ -600,8 +607,8 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t<TReal>
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t<TReal>& out) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t<TReal>& out)
{
/*
| cos(A) -sin(A) 0 0 |
M = | sin(A) cos(A) 0 0 |
@ -616,25 +623,26 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t<TReal>
// ----------------------------------------------------------------------------------------
// Returns a rotation matrix for a rotation around an arbitrary axis.
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix4x4t<TReal>& out) {
TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
TReal x = axis.x, y = axis.y, z = axis.z;
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix4x4t<TReal>& out)
{
TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
TReal x = axis.x, y = axis.y, z = axis.z;
// Many thanks to MathWorld and Wikipedia
out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y;
out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x;
out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c;
out.a4 = out.b4 = out.c4 = static_cast<TReal>(0.0);
out.d1 = out.d2 = out.d3 = static_cast<TReal>(0.0);
out.d4 = static_cast<TReal>(1.0);
// Many thanks to MathWorld and Wikipedia
out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y;
out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x;
out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c;
out.a4 = out.b4 = out.c4 = static_cast<TReal>(0.0);
out.d1 = out.d2 = out.d3 = static_cast<TReal>(0.0);
out.d4 = static_cast<TReal>(1.0);
return out;
return out;
}
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out)
{
out = aiMatrix4x4t<TReal>();
out.a4 = v.x;
out.b4 = v.y;
@ -644,8 +652,8 @@ AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiV
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out)
{
out = aiMatrix4x4t<TReal>();
out.a1 = v.x;
out.b2 = v.y;
@ -664,9 +672,9 @@ aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal>& v, a
*/
// ----------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE
aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromToMatrix(const aiVector3t<TReal>& from,
const aiVector3t<TReal>& to, aiMatrix4x4t<TReal>& mtx) {
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromToMatrix(const aiVector3t<TReal>& from,
const aiVector3t<TReal>& to, aiMatrix4x4t<TReal>& mtx)
{
aiMatrix3x3t<TReal> m3;
aiMatrix3x3t<TReal>::FromToMatrix(from,to,m3);
mtx = aiMatrix4x4t<TReal>(m3);

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -48,10 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_MESH_H_INC
#define AI_MESH_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/aabb.h>
@ -252,9 +248,6 @@ struct aiVertexWeight {
};
// Forward declare aiNode (pointer use only)
struct aiNode;
// ---------------------------------------------------------------------------
/** @brief A single bone of a mesh.
*
@ -271,16 +264,6 @@ struct aiBone {
//! The maximum value for this member is #AI_MAX_BONE_WEIGHTS.
unsigned int mNumWeights;
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
// The bone armature node - used for skeleton conversion
// you must enable aiProcess_PopulateArmatureData to populate this
C_STRUCT aiNode* mArmature;
// The bone node in the scene - used for skeleton conversion
// you must enable aiProcess_PopulateArmatureData to populate this
C_STRUCT aiNode* mNode;
#endif
//! The influence weights of this bone, by vertex index.
C_STRUCT aiVertexWeight* mWeights;
@ -435,11 +418,11 @@ struct aiAnimMesh
/**Anim Mesh name */
C_STRUCT aiString mName;
/** Replacement for aiMesh::mVertices. If this array is non-nullptr,
/** Replacement for aiMesh::mVertices. If this array is non-NULL,
* it *must* contain mNumVertices entries. The corresponding
* array in the host mesh must be non-nullptr as well - animation
* array in the host mesh must be non-NULL as well - animation
* meshes may neither add or nor remove vertex components (if
* a replacement array is nullptr and the corresponding source
* a replacement array is NULL and the corresponding source
* array is not, the source data is taken instead)*/
C_STRUCT aiVector3D* mVertices;
@ -613,7 +596,7 @@ struct aiMesh
C_STRUCT aiVector3D* mVertices;
/** Vertex normals.
* The array contains normalized vectors, nullptr if not present.
* The array contains normalized vectors, NULL if not present.
* The array is mNumVertices in size. Normals are undefined for
* point and line primitives. A mesh consisting of points and
* lines only may not have normal vectors. Meshes with mixed
@ -636,7 +619,7 @@ struct aiMesh
/** Vertex tangents.
* The tangent of a vertex points in the direction of the positive
* X texture axis. The array contains normalized vectors, nullptr if
* X texture axis. The array contains normalized vectors, NULL if
* not present. The array is mNumVertices in size. A mesh consisting
* of points and lines only may not have normal vectors. Meshes with
* mixed primitive types (i.e. lines and triangles) may have
@ -650,7 +633,7 @@ struct aiMesh
/** Vertex bitangents.
* The bitangent of a vertex points in the direction of the positive
* Y texture axis. The array contains normalized vectors, nullptr if not
* Y texture axis. The array contains normalized vectors, NULL if not
* present. The array is mNumVertices in size.
* @note If the mesh contains tangents, it automatically also contains
* bitangents.
@ -659,14 +642,14 @@ struct aiMesh
/** Vertex color sets.
* A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex
* colors per vertex. nullptr if not present. Each array is
* colors per vertex. NULL if not present. Each array is
* mNumVertices in size if present.
*/
C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
/** Vertex texture coords, also known as UV channels.
* A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per
* vertex. nullptr if not present. The array is mNumVertices in size.
* vertex. NULL if not present. The array is mNumVertices in size.
*/
C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
@ -688,7 +671,7 @@ struct aiMesh
C_STRUCT aiFace* mFaces;
/** The number of bones this mesh contains.
* Can be 0, in which case the mBones array is nullptr.
* Can be 0, in which case the mBones array is NULL.
*/
unsigned int mNumBones;
@ -786,10 +769,7 @@ struct aiMesh
// DO NOT REMOVE THIS ADDITIONAL CHECK
if (mNumBones && mBones) {
for( unsigned int a = 0; a < mNumBones; a++) {
if(mBones[a])
{
delete mBones[a];
}
delete mBones[a];
}
delete [] mBones;
}

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,10 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_METADATA_H_INC
#define AI_METADATA_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#if defined(_MSC_VER) && (_MSC_VER <= 1500)
# include "Compiler/pstdint.h"
#else
@ -286,8 +282,8 @@ struct aiMetadata {
new_values[i] = mValues[i];
}
delete[] mKeys;
delete[] mValues;
delete mKeys;
delete mValues;
mKeys = new_keys;
mValues = new_values;
@ -377,23 +373,6 @@ struct aiMetadata {
return true;
}
/// Check whether there is a metadata entry for the given key.
/// \param [in] Key - the key value value to check for.
inline
bool HasKey(const char* key) {
if ( nullptr == key ) {
return false;
}
// Search for the given key
for (unsigned int i = 0; i < mNumProperties; ++i) {
if ( 0 == strncmp(mKeys[i].C_Str(), key, mKeys[i].length ) ) {
return true;
}
}
return false;
}
#endif // __cplusplus
};

View file

@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -42,14 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file pbrmaterial.h
* @brief Defines the material system of the library
*/
#pragma once
#ifndef AI_PBRMATERIAL_H_INC
#define AI_PBRMATERIAL_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR "$mat.gltf.pbrMetallicRoughness.baseColorFactor", 0, 0
#define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR "$mat.gltf.pbrMetallicRoughness.metallicFactor", 0, 0
#define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR "$mat.gltf.pbrMetallicRoughness.roughnessFactor", 0, 0

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2016, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -47,11 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_POSTPROCESS_H_INC
#define AI_POSTPROCESS_H_INC
#include <assimp/types.h>
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include "types.h"
#ifdef __cplusplus
extern "C" {
@ -320,19 +316,6 @@ enum aiPostProcessSteps
*/
aiProcess_FixInfacingNormals = 0x2000,
// -------------------------------------------------------------------------
/**
* This step generically populates aiBone->mArmature and aiBone->mNode generically
* The point of these is it saves you later having to calculate these elements
* This is useful when handling rest information or skin information
* If you have multiple armatures on your models we strongly recommend enabling this
* Instead of writing your own multi-root, multi-armature lookups we have done the
* hard work for you :)
*/
aiProcess_PopulateArmatureData = 0x4000,
// -------------------------------------------------------------------------
/** <hr>This step splits meshes with more than one primitive type in
* homogeneous sub-meshes.
@ -550,8 +533,6 @@ enum aiPostProcessSteps
*/
aiProcess_Debone = 0x4000000,
// -------------------------------------------------------------------------
/** <hr>This step will perform a global scale of the model.
*

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -50,23 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* but last time I checked compiler coverage was so bad that I decided
* to reinvent the wheel.
*/
#pragma once
#ifndef AI_QNAN_H_INCLUDED
#define AI_QNAN_H_INCLUDED
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
#include <limits>
#include <stdint.h>
// ---------------------------------------------------------------------------
/** Data structure to represent the bit pattern of a 32 Bit
* IEEE 754 floating-point number. */
union _IEEESingle {
union _IEEESingle
{
float Float;
struct
{
@ -79,7 +75,8 @@ union _IEEESingle {
// ---------------------------------------------------------------------------
/** Data structure to represent the bit pattern of a 64 Bit
* IEEE 754 floating-point number. */
union _IEEEDouble {
union _IEEEDouble
{
double Double;
struct
{
@ -92,7 +89,8 @@ union _IEEEDouble {
// ---------------------------------------------------------------------------
/** Check whether a given float is qNaN.
* @param in Input value */
AI_FORCE_INLINE bool is_qnan(float in) {
AI_FORCE_INLINE bool is_qnan(float in)
{
// the straightforward solution does not work:
// return (in != in);
// compiler generates code like this
@ -109,7 +107,8 @@ AI_FORCE_INLINE bool is_qnan(float in) {
// ---------------------------------------------------------------------------
/** Check whether a given double is qNaN.
* @param in Input value */
AI_FORCE_INLINE bool is_qnan(double in) {
AI_FORCE_INLINE bool is_qnan(double in)
{
// the straightforward solution does not work:
// return (in != in);
// compiler generates code like this
@ -128,7 +127,8 @@ AI_FORCE_INLINE bool is_qnan(double in) {
*
* Denorms return false, they're treated like normal values.
* @param in Input value */
AI_FORCE_INLINE bool is_special_float(float in) {
AI_FORCE_INLINE bool is_special_float(float in)
{
_IEEESingle temp;
memcpy(&temp, &in, sizeof(float));
return (temp.IEEE.Exp == (1u << 8)-1);
@ -139,7 +139,8 @@ AI_FORCE_INLINE bool is_special_float(float in) {
*
* Denorms return false, they're treated like normal values.
* @param in Input value */
AI_FORCE_INLINE bool is_special_float(double in) {
AI_FORCE_INLINE bool is_special_float(double in)
{
_IEEESingle temp;
memcpy(&temp, &in, sizeof(float));
return (temp.IEEE.Exp == (1u << 11)-1);
@ -149,13 +150,15 @@ AI_FORCE_INLINE bool is_special_float(double in) {
/** Check whether a float is NOT qNaN.
* @param in Input value */
template<class TReal>
AI_FORCE_INLINE bool is_not_qnan(TReal in) {
AI_FORCE_INLINE bool is_not_qnan(TReal in)
{
return !is_qnan(in);
}
// ---------------------------------------------------------------------------
/** @brief Get a fresh qnan. */
AI_FORCE_INLINE ai_real get_qnan() {
AI_FORCE_INLINE ai_real get_qnan()
{
return std::numeric_limits<ai_real>::quiet_NaN();
}

View file

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -49,11 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef __cplusplus
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/defs.h>
#include "defs.h"
template <typename TReal> class aiVector3t;
template <typename TReal> class aiMatrix3x3t;

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,12 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_QUATERNION_INL_INC
#define AI_QUATERNION_INL_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
#include <assimp/quaternion.h>
#include "quaternion.h"
#include <cmath>

View file

@ -1,8 +1,8 @@
#ifndef ASSIMP_REVISION_H_INC
#define ASSIMP_REVISION_H_INC
#define GitVersion 0xd5ac3330
#define GitBranch "master"
#define GitVersion 0x0
#define GitBranch ""
#define VER_MAJOR 5
#define VER_MINOR 0
@ -16,13 +16,13 @@
#if (GitVersion == 0)
#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD)
#else
#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) " (Commit d5ac3330)"
#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) " (Commit 0)"
#endif
#ifdef NDEBUG
#define VER_ORIGINAL_FILENAME_STR "assimp-vc142-mt.dll"
#define VER_ORIGINAL_FILENAME_STR "assimp.dll"
#else
#define VER_ORIGINAL_FILENAME_STR "assimp-vc142-mtd.dll"
#define VER_ORIGINAL_FILENAME_STR "assimp.dll"
#endif // NDEBUG
#endif // ASSIMP_REVISION_H_INC

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,18 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_SCENE_H_INC
#define AI_SCENE_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include <assimp/texture.h>
#include <assimp/mesh.h>
#include <assimp/light.h>
#include <assimp/camera.h>
#include <assimp/material.h>
#include <assimp/anim.h>
#include <assimp/metadata.h>
#include "types.h"
#include "texture.h"
#include "mesh.h"
#include "light.h"
#include "camera.h"
#include "material.h"
#include "anim.h"
#include "metadata.h"
#ifdef __cplusplus
# include <cstdlib>
@ -110,13 +106,13 @@ struct ASSIMP_API aiNode
/** The transformation relative to the node's parent. */
C_STRUCT aiMatrix4x4 mTransformation;
/** Parent node. nullptr if this node is the root node. */
/** Parent node. NULL if this node is the root node. */
C_STRUCT aiNode* mParent;
/** The number of child nodes of this node. */
unsigned int mNumChildren;
/** The child nodes of this node. nullptr if mNumChildren is 0. */
/** The child nodes of this node. NULL if mNumChildren is 0. */
C_STRUCT aiNode** mChildren;
/** The number of meshes of this node. */
@ -127,7 +123,7 @@ struct ASSIMP_API aiNode
*/
unsigned int* mMeshes;
/** Metadata associated with this node or nullptr if there is no metadata.
/** Metadata associated with this node or NULL if there is no metadata.
* Whether any metadata is generated depends on the source file format. See the
* @link importer_notes @endlink page for more information on every source file
* format. Importers that don't document any metadata don't write any.
@ -149,7 +145,7 @@ struct ASSIMP_API aiNode
* of the scene.
*
* @param name Name to search for
* @return nullptr or a valid Node if the search was successful.
* @return NULL or a valid Node if the search was successful.
*/
inline
const aiNode* FindNode(const aiString& name) const {
@ -344,7 +340,7 @@ struct aiScene
#ifdef __cplusplus
//! Default constructor - set everything to 0/nullptr
//! Default constructor - set everything to 0/NULL
ASSIMP_API aiScene();
//! Destructor
@ -353,33 +349,33 @@ struct aiScene
//! Check whether the scene contains meshes
//! Unless no special scene flags are set this will always be true.
inline bool HasMeshes() const {
return mMeshes != nullptr && mNumMeshes > 0;
return mMeshes != NULL && mNumMeshes > 0;
}
//! Check whether the scene contains materials
//! Unless no special scene flags are set this will always be true.
inline bool HasMaterials() const {
return mMaterials != nullptr && mNumMaterials > 0;
return mMaterials != NULL && mNumMaterials > 0;
}
//! Check whether the scene contains lights
inline bool HasLights() const {
return mLights != nullptr && mNumLights > 0;
return mLights != NULL && mNumLights > 0;
}
//! Check whether the scene contains textures
inline bool HasTextures() const {
return mTextures != nullptr && mNumTextures > 0;
return mTextures != NULL && mNumTextures > 0;
}
//! Check whether the scene contains cameras
inline bool HasCameras() const {
return mCameras != nullptr && mNumCameras > 0;
return mCameras != NULL && mNumCameras > 0;
}
//! Check whether the scene contains animations
inline bool HasAnimations() const {
return mAnimations != nullptr && mNumAnimations > 0;
return mAnimations != NULL && mNumAnimations > 0;
}
//! Returns a short filename from a full path

View file

@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
All rights reserved.
@ -51,16 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_TEXTURE_H_INC
#define AI_TEXTURE_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#include <assimp/types.h>
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
// --------------------------------------------------------------------------------
/** \def AI_EMBEDDED_TEXNAME_PREFIX
@ -80,6 +79,7 @@ extern "C" {
# define AI_MAKE_EMBEDDED_TEXNAME(_n_) AI_EMBEDDED_TEXNAME_PREFIX # _n_
#endif
#include "./Compiler/pushpack1.h"
// --------------------------------------------------------------------------------
@ -87,7 +87,8 @@ extern "C" {
*
* Used by aiTexture.
*/
struct aiTexel {
struct aiTexel
{
unsigned char b,g,r,a;
#ifdef __cplusplus
@ -207,7 +208,8 @@ struct aiTexture {
, mHeight(0)
, pcData(nullptr)
, mFilename() {
memset(achFormatHint, 0, sizeof(achFormatHint));
achFormatHint[0] = achFormatHint[1] = 0;
achFormatHint[2] = achFormatHint[3] = 0;
}
// Destruction

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,10 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_TYPES_H_INC
#define AI_TYPES_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
// Some runtime headers
#include <sys/types.h>
#include <stddef.h>
@ -60,15 +56,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
// Our compile configuration
#include <assimp/defs.h>
#include "defs.h"
// Some types moved to separate header due to size of operators
#include <assimp/vector3.h>
#include <assimp/vector2.h>
#include <assimp/color4.h>
#include <assimp/matrix3x3.h>
#include <assimp/matrix4x4.h>
#include <assimp/quaternion.h>
#include "vector3.h"
#include "vector2.h"
#include "color4.h"
#include "matrix3x3.h"
#include "matrix4x4.h"
#include "quaternion.h"
typedef int32_t ai_int32;
typedef uint32_t ai_uint32 ;
@ -78,8 +74,9 @@ typedef uint32_t ai_uint32 ;
#include <new> // for std::nothrow_t
#include <string> // for aiString::Set(const std::string&)
namespace Assimp {
//! @cond never
//! @cond never
namespace Intern {
// --------------------------------------------------------------------
/** @brief Internal helper class to utilize our internal new/delete

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -47,10 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VECTOR2D_H_INC
#define AI_VECTOR2D_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
# include <cmath>
#else

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -48,12 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VECTOR2D_INL_INC
#define AI_VECTOR2D_INL_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
#include <assimp/vector2.h>
#include "vector2.h"
#include <cmath>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -47,17 +47,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VECTOR3D_H_INC
#define AI_VECTOR3D_H_INC
#ifdef __GNUC__
# pragma GCC system_header
#endif
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
#include <assimp/defs.h>
#include "defs.h"
#ifdef __cplusplus
@ -67,13 +63,16 @@ template<typename TReal> class aiMatrix4x4t;
// ---------------------------------------------------------------------------
/** Represents a three-dimensional vector. */
template <typename TReal>
class aiVector3t {
class aiVector3t
{
public:
aiVector3t() AI_NO_EXCEPT : x(), y(), z() {}
aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {}
explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {}
aiVector3t( const aiVector3t& o ) = default;
public:
// combined operators
const aiVector3t& operator += (const aiVector3t& o);
const aiVector3t& operator -= (const aiVector3t& o);
@ -98,6 +97,7 @@ public:
template <typename TOther>
operator aiVector3t<TOther> () const;
public:
/** @brief Set the components of a vector
* @param pX X component
* @param pY Y component

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_VECTOR3D_INL_INC
#ifdef __cplusplus
#include <assimp/vector3.h>
#include "vector3.h"
#include <cmath>

View file

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2019, assimp team
@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VERSION_H_INC
#define AI_VERSION_H_INC
#include <assimp/defs.h>
#include "defs.h"
#ifdef __cplusplus
extern "C" {
@ -62,13 +62,6 @@ extern "C" {
*/
ASSIMP_API const char* aiGetLegalString (void);
// ---------------------------------------------------------------------------
/** @brief Returns the current patch version number of Assimp.
* @return Patch version of the Assimp runtime the application was
* linked/built against
*/
ASSIMP_API unsigned int aiGetVersionPatch(void);
// ---------------------------------------------------------------------------
/** @brief Returns the current minor version number of Assimp.
* @return Minor version of the Assimp runtime the application was