diff options
Diffstat (limited to 'src/3rdparty/assimp/code/Vertex.h')
-rw-r--r-- | src/3rdparty/assimp/code/Vertex.h | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/src/3rdparty/assimp/code/Vertex.h b/src/3rdparty/assimp/code/Vertex.h index 5e2cf6986..1f1685ae9 100644 --- a/src/3rdparty/assimp/code/Vertex.h +++ b/src/3rdparty/assimp/code/Vertex.h @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -94,15 +95,15 @@ class Vertex friend Vertex operator + (const Vertex&,const Vertex&); friend Vertex operator - (const Vertex&,const Vertex&); -// friend Vertex operator + (const Vertex&,float); -// friend Vertex operator - (const Vertex&,float); - friend Vertex operator * (const Vertex&,float); - friend Vertex operator / (const Vertex&,float); +// 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 + (float, const Vertex&); -// friend Vertex operator - (float, const Vertex&); - friend Vertex operator * (float, const Vertex&); -// friend Vertex operator / (float, const Vertex&); +// 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: @@ -146,22 +147,22 @@ public: /* - Vertex& operator += (float v) { + Vertex& operator += (ai_real v) { *this = *this+v; return *this; } - Vertex& operator -= (float v) { + Vertex& operator -= (ai_real v) { *this = *this-v; return *this; } */ - Vertex& operator *= (float v) { + Vertex& operator *= (ai_real v) { *this = *this*v; return *this; } - Vertex& operator /= (float v) { + Vertex& operator /= (ai_real v) { *this = *this/v; return *this; } @@ -217,40 +218,40 @@ private: // ---------------------------------------------------------------------------- /** This time binary arithmetics of v0 with a floating-point number */ - template <template <typename, typename, typename> class op> static Vertex BinaryOp(const Vertex& v0, float f) { + template <template <typename, typename, typename> class op> static Vertex BinaryOp(const Vertex& v0, ai_real f) { // this is a heavy task for the compiler to optimize ... *pray* Vertex res; - res.position = op<aiVector3D,float,aiVector3D>()(v0.position,f); - res.normal = op<aiVector3D,float,aiVector3D>()(v0.normal,f); - res.tangent = op<aiVector3D,float,aiVector3D>()(v0.tangent,f); - res.bitangent = op<aiVector3D,float,aiVector3D>()(v0.bitangent,f); + res.position = op<aiVector3D,ai_real,aiVector3D>()(v0.position,f); + res.normal = op<aiVector3D,ai_real,aiVector3D>()(v0.normal,f); + res.tangent = op<aiVector3D,ai_real,aiVector3D>()(v0.tangent,f); + res.bitangent = op<aiVector3D,ai_real,aiVector3D>()(v0.bitangent,f); for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { - res.texcoords[i] = op<aiVector3D,float,aiVector3D>()(v0.texcoords[i],f); + res.texcoords[i] = op<aiVector3D,ai_real,aiVector3D>()(v0.texcoords[i],f); } for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) { - res.colors[i] = op<aiColor4D,float,aiColor4D>()(v0.colors[i],f); + res.colors[i] = op<aiColor4D,ai_real,aiColor4D>()(v0.colors[i],f); } return res; } // ---------------------------------------------------------------------------- /** This time binary arithmetics of v0 with a floating-point number */ - template <template <typename, typename, typename> class op> static Vertex BinaryOp(float f, const Vertex& v0) { + template <template <typename, typename, typename> class op> static Vertex BinaryOp(ai_real f, const Vertex& v0) { // this is a heavy task for the compiler to optimize ... *pray* Vertex res; - res.position = op<float,aiVector3D,aiVector3D>()(f,v0.position); - res.normal = op<float,aiVector3D,aiVector3D>()(f,v0.normal); - res.tangent = op<float,aiVector3D,aiVector3D>()(f,v0.tangent); - res.bitangent = op<float,aiVector3D,aiVector3D>()(f,v0.bitangent); + res.position = op<ai_real,aiVector3D,aiVector3D>()(f,v0.position); + res.normal = op<ai_real,aiVector3D,aiVector3D>()(f,v0.normal); + res.tangent = op<ai_real,aiVector3D,aiVector3D>()(f,v0.tangent); + res.bitangent = op<ai_real,aiVector3D,aiVector3D>()(f,v0.bitangent); for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { - res.texcoords[i] = op<float,aiVector3D,aiVector3D>()(f,v0.texcoords[i]); + res.texcoords[i] = op<ai_real,aiVector3D,aiVector3D>()(f,v0.texcoords[i]); } for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) { - res.colors[i] = op<float,aiColor4D,aiColor4D>()(f,v0.colors[i]); + res.colors[i] = op<ai_real,aiColor4D,aiColor4D>()(f,v0.colors[i]); } return res; } @@ -279,41 +280,41 @@ AI_FORCE_INLINE Vertex operator - (const Vertex& v0,const Vertex& v1) { // ------------------------------------------------------------------------------------------------ /* -AI_FORCE_INLINE Vertex operator + (const Vertex& v0,float f) { +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,float 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,float f) { +AI_FORCE_INLINE Vertex operator * (const Vertex& v0,ai_real f) { return Vertex::BinaryOp<Intern::multiplies>(v0,f); } -AI_FORCE_INLINE Vertex operator / (const Vertex& v0,float f) { +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 + (float f,const Vertex& v0) { +AI_FORCE_INLINE Vertex operator + (ai_real f,const Vertex& v0) { return Vertex::BinaryOp<Intern::plus>(f,v0); } -AI_FORCE_INLINE Vertex operator - (float f,const Vertex& v0) { +AI_FORCE_INLINE Vertex operator - (ai_real f,const Vertex& v0) { return Vertex::BinaryOp<Intern::minus>(f,v0); } */ -AI_FORCE_INLINE Vertex operator * (float f,const Vertex& v0) { +AI_FORCE_INLINE Vertex operator * (ai_real f,const Vertex& v0) { return Vertex::BinaryOp<Intern::multiplies>(f,v0); } /* -AI_FORCE_INLINE Vertex operator / (float f,const Vertex& v0) { +AI_FORCE_INLINE Vertex operator / (ai_real f,const Vertex& v0) { return Vertex::BinaryOp<Intern::divides>(f,v0); } */ |