Indroduce matgetreal

This commit is contained in:
Kim Kulling
2024-09-26 13:49:27 +02:00
parent 0a3b5dfc40
commit 469fdb1ab2
2 changed files with 17 additions and 1 deletions

View File

@@ -1625,6 +1625,18 @@ inline aiReturn aiGetMaterialDouble(const C_STRUCT aiMaterial *pMat,
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
* from a material

View File

@@ -189,7 +189,11 @@ AI_FORCE_INLINE
aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx, ai_real* pOut,
unsigned int* pMax) const {
#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,