summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/assimp/include/assimp/material.inl
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/assimp/include/assimp/material.inl')
-rw-r--r--src/3rdparty/assimp/include/assimp/material.inl55
1 files changed, 47 insertions, 8 deletions
diff --git a/src/3rdparty/assimp/include/assimp/material.inl b/src/3rdparty/assimp/include/assimp/material.inl
index 994e608b4..2c31fd571 100644
--- a/src/3rdparty/assimp/include/assimp/material.inl
+++ b/src/3rdparty/assimp/include/assimp/material.inl
@@ -3,7 +3,8 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2016, assimp team
+Copyright (c) 2006-2017, assimp team
+
All rights reserved.
@@ -43,9 +44,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @brief Defines the C++ getters for the material system
*/
+#pragma once
#ifndef AI_MATERIAL_INL_INC
#define AI_MATERIAL_INL_INC
+// ---------------------------------------------------------------------------
+inline aiPropertyTypeInfo ai_real_to_property_type_info(float)
+{
+ return aiPTI_Float;
+}
+
+inline aiPropertyTypeInfo ai_real_to_property_type_info(double)
+{
+ return aiPTI_Double;
+}
+// ---------------------------------------------------------------------------
+
//! @cond never
// ---------------------------------------------------------------------------
@@ -54,7 +68,7 @@ inline aiReturn aiMaterial::GetTexture( aiTextureType type,
C_STRUCT aiString* path,
aiTextureMapping* mapping /*= NULL*/,
unsigned int* uvindex /*= NULL*/,
- float* blend /*= NULL*/,
+ ai_real* blend /*= NULL*/,
aiTextureOp* op /*= NULL*/,
aiTextureMapMode* mapmode /*= NULL*/) const
{
@@ -122,7 +136,7 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
// ---------------------------------------------------------------------------
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
- unsigned int idx,float* pOut,
+ unsigned int idx,ai_real* pOut,
unsigned int* pMax) const
{
return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax);
@@ -136,7 +150,7 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
}
// ---------------------------------------------------------------------------
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
- unsigned int idx,float& pOut) const
+ unsigned int idx,ai_real& pOut) const
{
return aiGetMaterialFloat(this,pKey,type,idx,&pOut);
}
@@ -201,6 +215,18 @@ inline aiReturn aiMaterial::AddProperty(const float* pInput,
}
// ---------------------------------------------------------------------------
+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);
+}
+
+// ---------------------------------------------------------------------------
inline aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,
@@ -209,7 +235,7 @@ inline aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput,
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiUVTransform),
- pKey,type,index,aiPTI_Float);
+ pKey,type,index,ai_real_to_property_type_info(pInput->mRotation));
}
// ---------------------------------------------------------------------------
@@ -221,7 +247,7 @@ inline aiReturn aiMaterial::AddProperty(const aiColor4D* pInput,
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor4D),
- pKey,type,index,aiPTI_Float);
+ pKey,type,index,ai_real_to_property_type_info(pInput->a));
}
// ---------------------------------------------------------------------------
@@ -233,7 +259,7 @@ inline aiReturn aiMaterial::AddProperty(const aiColor3D* pInput,
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiColor3D),
- pKey,type,index,aiPTI_Float);
+ pKey,type,index,ai_real_to_property_type_info(pInput->b));
}
// ---------------------------------------------------------------------------
@@ -245,7 +271,7 @@ inline aiReturn aiMaterial::AddProperty(const aiVector3D* pInput,
{
return AddBinaryProperty((const void*)pInput,
pNumValues * sizeof(aiVector3D),
- pKey,type,index,aiPTI_Float);
+ pKey,type,index,ai_real_to_property_type_info(pInput->x));
}
// ---------------------------------------------------------------------------
@@ -282,6 +308,19 @@ inline aiReturn aiMaterial::AddProperty<float>(const float* pInput,
// ---------------------------------------------------------------------------
template<>
+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);
+}
+
+// ---------------------------------------------------------------------------
+template<>
inline aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput,
const unsigned int pNumValues,
const char* pKey,