From 65bc801734702a977e66d9f2d16ca723f955051f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 13 Dec 2021 18:48:58 +0100 Subject: [PATCH] Some fixes for possible divisions by zero --- include/assimp/SkeletonMeshBuilder.h | 3 +- include/assimp/color4.h | 2 - include/assimp/light.h | 1 - include/assimp/material.inl | 88 +++++++++----------------- include/assimp/texture.h | 19 +++--- include/assimp/vector2.h | 2 - include/assimp/vector3.inl | 92 ++++++++++------------------ 7 files changed, 70 insertions(+), 137 deletions(-) diff --git a/include/assimp/SkeletonMeshBuilder.h b/include/assimp/SkeletonMeshBuilder.h index 2479f4308..37d12f03d 100644 --- a/include/assimp/SkeletonMeshBuilder.h +++ b/include/assimp/SkeletonMeshBuilder.h @@ -6,7 +6,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2021, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -102,7 +101,7 @@ protected: /** Creates a dummy material and returns it. */ aiMaterial *CreateMaterial(); -protected: +private: /** space to assemble the mesh data: points */ std::vector mVertices; diff --git a/include/assimp/color4.h b/include/assimp/color4.h index fdd8f031e..573745ed6 100644 --- a/include/assimp/color4.h +++ b/include/assimp/color4.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2021, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/include/assimp/light.h b/include/assimp/light.h index f35f51e0a..46acad5fd 100644 --- a/include/assimp/light.h +++ b/include/assimp/light.h @@ -255,5 +255,4 @@ struct aiLight { } #endif - #endif // !! AI_LIGHT_H_INC diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 7f4b44575..7a3cce741 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -44,21 +44,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once -#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) { +AI_FORCE_INLINE aiPropertyTypeInfo ai_real_to_property_type_info(float) { return aiPTI_Float; } -AI_FORCE_INLINE -aiPropertyTypeInfo ai_real_to_property_type_info(double) { +AI_FORCE_INLINE aiPropertyTypeInfo ai_real_to_property_type_info(double) { return aiPTI_Double; } // --------------------------------------------------------------------------- @@ -66,8 +62,7 @@ aiPropertyTypeInfo ai_real_to_property_type_info(double) { //! @cond never // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::GetTexture( aiTextureType type, +AI_FORCE_INLINE aiReturn aiMaterial::GetTexture( aiTextureType type, unsigned int index, C_STRUCT aiString* path, aiTextureMapping* mapping /*= NULL*/, @@ -79,15 +74,13 @@ aiReturn aiMaterial::GetTexture( aiTextureType type, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -unsigned int aiMaterial::GetTextureCount(aiTextureType type) const { +AI_FORCE_INLINE unsigned int aiMaterial::GetTextureCount(aiTextureType type) const { return ::aiGetMaterialTextureCount(this,type); } // --------------------------------------------------------------------------- template -AI_FORCE_INLINE -aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +AI_FORCE_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; @@ -116,8 +109,7 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type, // --------------------------------------------------------------------------- template -AI_FORCE_INLINE -aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +AI_FORCE_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, @@ -138,34 +130,29 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -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 { return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax); } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +AI_FORCE_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, +AI_FORCE_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, +AI_FORCE_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, +AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiColor4D& pOut) const { return aiGetMaterialColor(this,pKey,type,idx,&pOut); } @@ -190,14 +177,10 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, // --------------------------------------------------------------------------- template -aiReturn aiMaterial::AddProperty (const TYPE* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ - return AddBinaryProperty((const void*)pInput, - pNumValues * sizeof(TYPE), +aiReturn aiMaterial::AddProperty (const TYPE* pInput, + const unsigned int pNumValues, const char* pKey, unsigned int type, + unsigned int index) { + return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(TYPE), pKey,type,index,aiPTI_Buffer); } @@ -213,8 +196,7 @@ AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const float* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const double* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const double* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -225,8 +207,7 @@ aiReturn aiMaterial::AddProperty(const double* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -237,8 +218,7 @@ aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -249,8 +229,7 @@ aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -261,8 +240,7 @@ aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -273,8 +251,7 @@ aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, } // --------------------------------------------------------------------------- -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const int* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const int* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -293,8 +270,7 @@ aiReturn aiMaterial::AddProperty(const int* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const float* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const float* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -306,8 +282,7 @@ aiReturn aiMaterial::AddProperty(const float* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const double* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const double* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -319,8 +294,7 @@ aiReturn aiMaterial::AddProperty(const double* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -332,8 +306,7 @@ aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -345,8 +318,7 @@ aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -358,8 +330,7 @@ aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -371,8 +342,7 @@ aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, // --------------------------------------------------------------------------- template<> -AI_FORCE_INLINE -aiReturn aiMaterial::AddProperty(const int* pInput, +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const int* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -383,5 +353,3 @@ aiReturn aiMaterial::AddProperty(const int* pInput, } //! @endcond - -#endif //! AI_MATERIAL_INL_INC diff --git a/include/assimp/texture.h b/include/assimp/texture.h index 7a9d38cc0..ec156114b 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -92,22 +92,19 @@ struct aiTexel { #ifdef __cplusplus //! Comparison operator - bool operator== (const aiTexel& other) const - { + bool operator== (const aiTexel& other) const { return b == other.b && r == other.r && g == other.g && a == other.a; } //! Inverse comparison operator - bool operator!= (const aiTexel& other) const - { + bool operator!= (const aiTexel& other) const { return b != other.b || r != other.r || g != other.g || a != other.a; } //! Conversion to a floating-point 4d color - operator aiColor4D() const - { + operator aiColor4D() const { return aiColor4D(r/255.f,g/255.f,b/255.f,a/255.f); } #endif // __cplusplus @@ -202,11 +199,11 @@ struct aiTexture { } // Construction - aiTexture() AI_NO_EXCEPT - : mWidth(0) - , mHeight(0) - , pcData(nullptr) - , mFilename() { + aiTexture() AI_NO_EXCEPT : + mWidth(0), + mHeight(0), + pcData(nullptr), + mFilename() { memset(achFormatHint, 0, sizeof(achFormatHint)); } diff --git a/include/assimp/vector2.h b/include/assimp/vector2.h index 34adf894b..586d63244 100644 --- a/include/assimp/vector2.h +++ b/include/assimp/vector2.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2021, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index 0076d2a85..80d2c55a1 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -54,8 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ------------------------------------------------------------------------------------------------ /** Transformation of a vector by a 3x3 matrix */ template -AI_FORCE_INLINE -aiVector3t operator * (const aiMatrix3x3t& pMatrix, const aiVector3t& pVector) { +AI_FORCE_INLINE aiVector3t operator * (const aiMatrix3x3t& pMatrix, const aiVector3t& pVector) { aiVector3t res; 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; @@ -66,8 +65,7 @@ aiVector3t operator * (const aiMatrix3x3t& pMatrix, const aiVector // ------------------------------------------------------------------------------------------------ /** Transformation of a vector by a 4x4 matrix */ template -AI_FORCE_INLINE -aiVector3t operator * (const aiMatrix4x4t& pMatrix, const aiVector3t& pVector) { +AI_FORCE_INLINE aiVector3t operator * (const aiMatrix4x4t& pMatrix, const aiVector3t& pVector) { aiVector3t res; 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; @@ -82,36 +80,35 @@ aiVector3t::operator aiVector3t () const { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -void aiVector3t::Set( TReal pX, TReal pY, TReal pZ) { +AI_FORCE_INLINE void aiVector3t::Set( TReal pX, TReal pY, TReal pZ) { x = pX; y = pY; z = pZ; } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -TReal aiVector3t::SquareLength() const { +AI_FORCE_INLINE TReal aiVector3t::SquareLength() const { return x*x + y*y + z*z; } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -TReal aiVector3t::Length() const { +AI_FORCE_INLINE TReal aiVector3t::Length() const { return std::sqrt( SquareLength()); } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -aiVector3t& aiVector3t::Normalize() { + aiVector3t& aiVector3t::Normalize() { + const TReal l = Length(); + if (l == 0) { + return *this; + } *this /= Length(); return *this; } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -aiVector3t& aiVector3t::NormalizeSafe() { +AI_FORCE_INLINE aiVector3t& aiVector3t::NormalizeSafe() { TReal len = Length(); if ( len > static_cast< TReal >( 0 ) ) { *this /= len; @@ -120,8 +117,7 @@ aiVector3t& aiVector3t::NormalizeSafe() { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -const aiVector3t& aiVector3t::operator += (const aiVector3t& o) { +AI_FORCE_INLINE const aiVector3t& aiVector3t::operator += (const aiVector3t& o) { x += o.x; y += o.y; z += o.z; @@ -130,8 +126,7 @@ const aiVector3t& aiVector3t::operator += (const aiVector3t } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -const aiVector3t& aiVector3t::operator -= (const aiVector3t& o) { +AI_FORCE_INLINE const aiVector3t& aiVector3t::operator -= (const aiVector3t& o) { x -= o.x; y -= o.y; z -= o.z; @@ -140,8 +135,7 @@ const aiVector3t& aiVector3t::operator -= (const aiVector3t } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -const aiVector3t& aiVector3t::operator *= (TReal f) { +AI_FORCE_INLINE const aiVector3t& aiVector3t::operator *= (TReal f) { x *= f; y *= f; z *= f; @@ -150,8 +144,7 @@ const aiVector3t& aiVector3t::operator *= (TReal f) { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -const aiVector3t& aiVector3t::operator /= (TReal f) { +AI_FORCE_INLINE const aiVector3t& aiVector3t::operator /= (TReal f) { if ( f == static_cast(0.0)) { return *this; } @@ -164,20 +157,17 @@ const aiVector3t& aiVector3t::operator /= (TReal f) { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -aiVector3t& aiVector3t::operator *= (const aiMatrix3x3t& mat){ +AI_FORCE_INLINE aiVector3t& aiVector3t::operator *= (const aiMatrix3x3t& mat){ return (*this = mat * (*this)); } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -aiVector3t& aiVector3t::operator *= (const aiMatrix4x4t& mat){ +AI_FORCE_INLINE aiVector3t& aiVector3t::operator *= (const aiMatrix4x4t& mat){ return (*this = mat * (*this)); } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -TReal aiVector3t::operator[](unsigned int i) const { +AI_FORCE_INLINE TReal aiVector3t::operator[](unsigned int i) const { switch (i) { case 0: return x; @@ -192,9 +182,7 @@ TReal aiVector3t::operator[](unsigned int i) const { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -TReal& aiVector3t::operator[](unsigned int i) { -// return *(&x + i); +AI_FORCE_INLINE TReal& aiVector3t::operator[](unsigned int i) { switch (i) { case 0: return x; @@ -209,20 +197,17 @@ TReal& aiVector3t::operator[](unsigned int i) { } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -bool aiVector3t::operator== (const aiVector3t& other) const { +AI_FORCE_INLINE bool aiVector3t::operator== (const aiVector3t& other) const { return x == other.x && y == other.y && z == other.z; } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -bool aiVector3t::operator!= (const aiVector3t& other) const { +AI_FORCE_INLINE bool aiVector3t::operator!= (const aiVector3t& other) const { return x != other.x || y != other.y || z != other.z; } // --------------------------------------------------------------------------- template -AI_FORCE_INLINE -bool aiVector3t::Equal(const aiVector3t& other, TReal epsilon) const { +AI_FORCE_INLINE bool aiVector3t::Equal(const aiVector3t& other, TReal epsilon) const { return std::abs(x - other.x) <= epsilon && std::abs(y - other.y) <= epsilon && @@ -230,77 +215,66 @@ bool aiVector3t::Equal(const aiVector3t& other, TReal epsilon) con } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -bool aiVector3t::operator < (const aiVector3t& other) const { +AI_FORCE_INLINE bool aiVector3t::operator < (const aiVector3t& other) const { return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z; } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE -const aiVector3t aiVector3t::SymMul(const aiVector3t& o) { +AI_FORCE_INLINE const aiVector3t aiVector3t::SymMul(const aiVector3t& o) { return aiVector3t(x*o.x,y*o.y,z*o.z); } // ------------------------------------------------------------------------------------------------ // symmetric addition template -AI_FORCE_INLINE -aiVector3t operator + (const aiVector3t& v1, const aiVector3t& v2) { +AI_FORCE_INLINE aiVector3t operator + (const aiVector3t& v1, const aiVector3t& v2) { return aiVector3t( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } // ------------------------------------------------------------------------------------------------ // symmetric subtraction template -AI_FORCE_INLINE -aiVector3t operator - (const aiVector3t& v1, const aiVector3t& v2) { +AI_FORCE_INLINE aiVector3t operator - (const aiVector3t& v1, const aiVector3t& v2) { return aiVector3t( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } // ------------------------------------------------------------------------------------------------ // scalar product template -AI_FORCE_INLINE -TReal operator * (const aiVector3t& v1, const aiVector3t& v2) { +AI_FORCE_INLINE TReal operator * (const aiVector3t& v1, const aiVector3t& v2) { return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; } // ------------------------------------------------------------------------------------------------ // scalar multiplication template -AI_FORCE_INLINE -aiVector3t operator * ( TReal f, const aiVector3t& v) { +AI_FORCE_INLINE aiVector3t operator * ( TReal f, const aiVector3t& v) { return aiVector3t( f*v.x, f*v.y, f*v.z); } // ------------------------------------------------------------------------------------------------ // and the other way around template -AI_FORCE_INLINE -aiVector3t operator * ( const aiVector3t& v, TReal f) { +AI_FORCE_INLINE aiVector3t operator * ( const aiVector3t& v, TReal f) { return aiVector3t( f*v.x, f*v.y, f*v.z); } // ------------------------------------------------------------------------------------------------ // scalar division template -AI_FORCE_INLINE -aiVector3t operator / ( const aiVector3t& v, TReal f) { +AI_FORCE_INLINE aiVector3t operator / ( const aiVector3t& v, TReal f) { return v * (1/f); } // ------------------------------------------------------------------------------------------------ // vector division template -AI_FORCE_INLINE -aiVector3t operator / ( const aiVector3t& v, const aiVector3t& v2) { +AI_FORCE_INLINE aiVector3t operator / ( const aiVector3t& v, const aiVector3t& v2) { return aiVector3t(v.x / v2.x,v.y / v2.y,v.z / v2.z); } // ------------------------------------------------------------------------------------------------ // cross product template -AI_FORCE_INLINE -aiVector3t operator ^ ( const aiVector3t& v1, const aiVector3t& v2) { +AI_FORCE_INLINE aiVector3t operator ^ ( const aiVector3t& v1, const aiVector3t& v2) { return aiVector3t( 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 template -AI_FORCE_INLINE -aiVector3t operator - ( const aiVector3t& v) { +AI_FORCE_INLINE aiVector3t operator - ( const aiVector3t& v) { return aiVector3t( -v.x, -v.y, -v.z); }