2
0
Kim Kulling 11 сар өмнө
parent
commit
469fdb1ab2

+ 12 - 0
include/assimp/material.h

@@ -1625,6 +1625,18 @@ inline aiReturn aiGetMaterialDouble(const C_STRUCT aiMaterial *pMat,
     return aiGetMaterialDoubleArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
     return aiGetMaterialDoubleArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
 }
 }
 
 
+inline aiReturn aiGetMaterialReal(const C_STRUCT aiMaterial *pMat,
+        const char *pKey,
+        unsigned int type,
+        unsigned int index,
+        ai_real *pOut) {
+#ifndef ASSIMP_DOUBLE_PRECISION
+    return aiGetMaterialFloatArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
+#else
+    return aiGetMaterialDoubleArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
+#endif
+}
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 /** @brief Retrieve an array of integer values with a specific key
 /** @brief Retrieve an array of integer values with a specific key
  *  from a material
  *  from a material

+ 5 - 1
include/assimp/material.inl

@@ -189,7 +189,11 @@ AI_FORCE_INLINE
 aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
 aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
         unsigned int idx, ai_real* pOut,
         unsigned int idx, ai_real* pOut,
         unsigned int* pMax) const {
         unsigned int* pMax) const {
-    return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax);
+#ifndef ASSIMP_DOUBLE_PRECISION
+    return ::aiGetMaterialFloatArray(this, pKey, type, idx, pOut, pMax);
+#else
+    return ::aiGetMaterialDoubleArray(this, pKey, type, idx, pOut, pMax);
+#endif
 }
 }
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
 AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type,