Forráskód Böngészése

Missing material functions for aiUVTransform added

Léo Terziman 11 éve
szülő
commit
7bc074857e
3 módosított fájl, 30 hozzáadás és 0 törlés
  1. 12 0
      code/MaterialSystem.cpp
  2. 12 0
      include/assimp/material.h
  3. 6 0
      include/assimp/material.inl

+ 12 - 0
code/MaterialSystem.cpp

@@ -247,6 +247,18 @@ aiReturn aiGetMaterialColor(const aiMaterial* pMat,
 	return eRet;
 }
 
+// ------------------------------------------------------------------------------------------------
+// Get a aiUVTransform (4 floats) from the material
+aiReturn aiGetMaterialUVTransform(const aiMaterial* pMat, 
+	const char* pKey,
+	unsigned int type,
+	unsigned int index,
+	aiUVTransform* pOut)
+{
+	unsigned int iMax = 4;
+	return  aiGetMaterialFloatArray(pMat,pKey,type,index,(float*)pOut,&iMax);
+}
+
 // ------------------------------------------------------------------------------------------------
 // Get a string from the material
 aiReturn aiGetMaterialString(const aiMaterial* pMat, 

+ 12 - 0
include/assimp/material.h

@@ -1473,6 +1473,18 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
 	 C_STRUCT aiColor4D* pOut);
 
 
+// ---------------------------------------------------------------------------
+/** @brief Retrieve a aiUVTransform value from the material property table
+*
+* See the sample for aiGetMaterialFloat for more information*/
+// ---------------------------------------------------------------------------
+ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial* pMat, 
+    const char* pKey,
+	 unsigned int type,
+    unsigned int index,
+	 C_STRUCT aiUVTransform* pOut);
+
+
 // ---------------------------------------------------------------------------
 /** @brief Retrieve a string from the material property table
 *

+ 6 - 0
include/assimp/material.inl

@@ -167,6 +167,12 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
 {
 	return aiGetMaterialString(this,pKey,type,idx,&pOut);
 }
+// ---------------------------------------------------------------------------
+inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
+	unsigned int idx,aiUVTransform& pOut) const
+{
+	return aiGetMaterialUVTransform(this,pKey,type,idx,&pOut);
+}
 
 
 // ---------------------------------------------------------------------------