Commit eb218095 authored by chili's avatar chili
Browse files

update assimp version

parent 1da10a89
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
...@@ -55,8 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -55,8 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
/** Transformation of a vector by a 3x3 matrix */ /** Transformation of a vector by a 3x3 matrix */
template <typename TReal> template <typename TReal>
inline aiVector3t<TReal> operator * (const aiMatrix3x3t<TReal>& pMatrix, const aiVector3t<TReal>& pVector) AI_FORCE_INLINE
{ aiVector3t<TReal> operator * (const aiMatrix3x3t<TReal>& pMatrix, const aiVector3t<TReal>& pVector) {
aiVector3t<TReal> res; aiVector3t<TReal> res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z; res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z; res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z;
...@@ -67,8 +68,8 @@ inline aiVector3t<TReal> operator * (const aiMatrix3x3t<TReal>& pMatrix, const a ...@@ -67,8 +68,8 @@ inline aiVector3t<TReal> operator * (const aiMatrix3x3t<TReal>& pMatrix, const a
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
/** Transformation of a vector by a 4x4 matrix */ /** Transformation of a vector by a 4x4 matrix */
template <typename TReal> template <typename TReal>
inline aiVector3t<TReal> operator * (const aiMatrix4x4t<TReal>& pMatrix, const aiVector3t<TReal>& pVector) AI_FORCE_INLINE
{ aiVector3t<TReal> operator * (const aiMatrix4x4t<TReal>& pMatrix, const aiVector3t<TReal>& pVector) {
aiVector3t<TReal> res; aiVector3t<TReal> res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z + pMatrix.a4; res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z + pMatrix.a4;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z + pMatrix.b4; res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z + pMatrix.b4;
...@@ -83,66 +84,99 @@ aiVector3t<TReal>::operator aiVector3t<TOther> () const { ...@@ -83,66 +84,99 @@ aiVector3t<TReal>::operator aiVector3t<TOther> () const {
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE void aiVector3t<TReal>::Set( TReal pX, TReal pY, TReal pZ) { AI_FORCE_INLINE
x = pX; y = pY; z = pZ; void aiVector3t<TReal>::Set( TReal pX, TReal pY, TReal pZ) {
x = pX;
y = pY;
z = pZ;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::SquareLength() const { AI_FORCE_INLINE
TReal aiVector3t<TReal>::SquareLength() const {
return x*x + y*y + z*z; return x*x + y*y + z*z;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::Length() const { AI_FORCE_INLINE
TReal aiVector3t<TReal>::Length() const {
return std::sqrt( SquareLength()); return std::sqrt( SquareLength());
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::Normalize() { AI_FORCE_INLINE
*this /= Length(); return *this; aiVector3t<TReal>& aiVector3t<TReal>::Normalize() {
*this /= Length();
return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::NormalizeSafe() { AI_FORCE_INLINE
aiVector3t<TReal>& aiVector3t<TReal>::NormalizeSafe() {
TReal len = Length(); TReal len = Length();
if (len > static_cast<TReal>(0)) if ( len > static_cast< TReal >( 0 ) ) {
*this /= len; *this /= len;
}
return *this; return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator += (const aiVector3t<TReal>& o) { AI_FORCE_INLINE
x += o.x; y += o.y; z += o.z; return *this; const aiVector3t<TReal>& aiVector3t<TReal>::operator += (const aiVector3t<TReal>& o) {
x += o.x;
y += o.y;
z += o.z;
return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator -= (const aiVector3t<TReal>& o) { AI_FORCE_INLINE
x -= o.x; y -= o.y; z -= o.z; return *this; const aiVector3t<TReal>& aiVector3t<TReal>::operator -= (const aiVector3t<TReal>& o) {
x -= o.x;
y -= o.y;
z -= o.z;
return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator *= (TReal f) { AI_FORCE_INLINE
x *= f; y *= f; z *= f; return *this; const aiVector3t<TReal>& aiVector3t<TReal>::operator *= (TReal f) {
x *= f;
y *= f;
z *= f;
return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) { AI_FORCE_INLINE
x /= f; y /= f; z /= f; return *this; const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) {
const TReal invF = (TReal) 1.0 / f;
x *= invF;
y *= invF;
z *= invF;
return *this;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& mat){ AI_FORCE_INLINE
return(*this = mat * (*this)); aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& mat){
return (*this = mat * (*this));
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix4x4t<TReal>& mat){ AI_FORCE_INLINE
return(*this = mat * (*this)); aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix4x4t<TReal>& mat){
return (*this = mat * (*this));
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::operator[](unsigned int i) const { AI_FORCE_INLINE
// return *(&x + i); TReal aiVector3t<TReal>::operator[](unsigned int i) const {
switch (i) { switch (i) {
case 0: case 0:
return x; return x;
...@@ -157,7 +191,8 @@ AI_FORCE_INLINE TReal aiVector3t<TReal>::operator[](unsigned int i) const { ...@@ -157,7 +191,8 @@ AI_FORCE_INLINE TReal aiVector3t<TReal>::operator[](unsigned int i) const {
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE TReal& aiVector3t<TReal>::operator[](unsigned int i) { AI_FORCE_INLINE
TReal& aiVector3t<TReal>::operator[](unsigned int i) {
// return *(&x + i); // return *(&x + i);
switch (i) { switch (i) {
case 0: case 0:
...@@ -173,17 +208,20 @@ AI_FORCE_INLINE TReal& aiVector3t<TReal>::operator[](unsigned int i) { ...@@ -173,17 +208,20 @@ AI_FORCE_INLINE TReal& aiVector3t<TReal>::operator[](unsigned int i) {
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator== (const aiVector3t<TReal>& other) const { AI_FORCE_INLINE
bool aiVector3t<TReal>::operator== (const aiVector3t<TReal>& other) const {
return x == other.x && y == other.y && z == other.z; return x == other.x && y == other.y && z == other.z;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator!= (const aiVector3t<TReal>& other) const { AI_FORCE_INLINE
bool aiVector3t<TReal>::operator!= (const aiVector3t<TReal>& other) const {
return x != other.x || y != other.y || z != other.z; return x != other.x || y != other.y || z != other.z;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
template<typename TReal> template<typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TReal epsilon) const { AI_FORCE_INLINE
bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TReal epsilon) const {
return return
std::abs(x - other.x) <= epsilon && std::abs(x - other.x) <= epsilon &&
std::abs(y - other.y) <= epsilon && std::abs(y - other.y) <= epsilon &&
...@@ -191,66 +229,77 @@ AI_FORCE_INLINE bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TR ...@@ -191,66 +229,77 @@ AI_FORCE_INLINE bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TR
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator < (const aiVector3t<TReal>& other) const { AI_FORCE_INLINE
bool aiVector3t<TReal>::operator < (const aiVector3t<TReal>& other) const {
return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z; return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal> aiVector3t<TReal>::SymMul(const aiVector3t<TReal>& o) { AI_FORCE_INLINE
const aiVector3t<TReal> aiVector3t<TReal>::SymMul(const aiVector3t<TReal>& o) {
return aiVector3t<TReal>(x*o.x,y*o.y,z*o.z); return aiVector3t<TReal>(x*o.x,y*o.y,z*o.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// symmetric addition // symmetric addition
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator + (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) { AI_FORCE_INLINE
aiVector3t<TReal> operator + (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); return aiVector3t<TReal>( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// symmetric subtraction // symmetric subtraction
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator - (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) { AI_FORCE_INLINE
aiVector3t<TReal> operator - (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); return aiVector3t<TReal>( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// scalar product // scalar product
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE TReal operator * (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) { AI_FORCE_INLINE
TReal operator * (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// scalar multiplication // scalar multiplication
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator * ( TReal f, const aiVector3t<TReal>& v) { AI_FORCE_INLINE
aiVector3t<TReal> operator * ( TReal f, const aiVector3t<TReal>& v) {
return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z); return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// and the other way around // and the other way around
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator * ( const aiVector3t<TReal>& v, TReal f) { AI_FORCE_INLINE
aiVector3t<TReal> operator * ( const aiVector3t<TReal>& v, TReal f) {
return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z); return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// scalar division // scalar division
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, TReal f) { AI_FORCE_INLINE
aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, TReal f) {
return v * (1/f); return v * (1/f);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// vector division // vector division
template <typename TReal> template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, const aiVector3t<TReal>& v2) { AI_FORCE_INLINE
aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>(v.x / v2.x,v.y / v2.y,v.z / v2.z); return aiVector3t<TReal>(v.x / v2.x,v.y / v2.y,v.z / v2.z);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// cross product // cross product
template <typename TReal> template<typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator ^ ( const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) { AI_FORCE_INLINE
aiVector3t<TReal> operator ^ ( const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x); return aiVector3t<TReal>( v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// vector negation // vector negation
template <typename TReal> template<typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator - ( const aiVector3t<TReal>& v) { AI_FORCE_INLINE
aiVector3t<TReal> operator - ( const aiVector3t<TReal>& v) {
return aiVector3t<TReal>( -v.x, -v.y, -v.z); return aiVector3t<TReal>( -v.x, -v.y, -v.z);
} }
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
...@@ -82,6 +83,12 @@ ASSIMP_API unsigned int aiGetVersionMajor (void); ...@@ -82,6 +83,12 @@ ASSIMP_API unsigned int aiGetVersionMajor (void);
*/ */
ASSIMP_API unsigned int aiGetVersionRevision (void); ASSIMP_API unsigned int aiGetVersionRevision (void);
// ---------------------------------------------------------------------------
/** @brief Returns the branchname of the Assimp runtime.
* @return The current branch name.
*/
ASSIMP_API const char *aiGetBranchName();
//! Assimp was compiled as a shared object (Windows: DLL) //! Assimp was compiled as a shared object (Windows: DLL)
#define ASSIMP_CFLAGS_SHARED 0x1 #define ASSIMP_CFLAGS_SHARED 0x1
//! Assimp was compiled against STLport //! Assimp was compiled against STLport
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment