BRE12
material.h
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2012, assimp team
7 
8 All rights reserved.
9 
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the following
12 conditions are met:
13 
14 * Redistributions of source code must retain the above
15  copyright notice, this list of conditions and the
16  following disclaimer.
17 
18 * Redistributions in binary form must reproduce the above
19  copyright notice, this list of conditions and the
20  following disclaimer in the documentation and/or other
21  materials provided with the distribution.
22 
23 * Neither the name of the assimp team, nor the names of its
24  contributors may be used to endorse or promote products
25  derived from this software without specific prior
26  written permission of the assimp team.
27 
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ---------------------------------------------------------------------------
40 */
41 
46 #ifndef AI_MATERIAL_H_INC
47 #define AI_MATERIAL_H_INC
48 
49 #include "types.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 // Name for default materials (2nd is used if meshes have UV coords)
56 #define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial"
57 
58 // ---------------------------------------------------------------------------
78 {
81 
84 
87 
90 
93 
96 
97 
102 #ifndef SWIG
103  _aiTextureOp_Force32Bit = INT_MAX
104 #endif
105 };
107 
108 // ---------------------------------------------------------------------------
114 {
118 
123 
128 
133 
138 #ifndef SWIG
139  _aiTextureMapMode_Force32Bit = INT_MAX
140 #endif
141 };
143 
144 // ---------------------------------------------------------------------------
154 {
162 
165 
168 
171 
174 
177 
178 
183 #ifndef SWIG
184  _aiTextureMapping_Force32Bit = INT_MAX
185 #endif
186 };
188 
189 // ---------------------------------------------------------------------------
205 {
213 
214 
215 
220 
225 
230 
235 
242 
250 
259 
266 
273 
282 
289 
297 
298 
303 #ifndef SWIG
304  _aiTextureType_Force32Bit = INT_MAX
305 #endif
306 };
308 
309 #define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
310 
311 // ---------------------------------------------------------------------------
324 {
329 
333 
337 
341 
347 
354 
361 
367 
371 
375 
376 
381 #ifndef SWIG
382  _aiShadingMode_Force32Bit = INT_MAX
383 #endif
384 };
386 
387 
388 // ---------------------------------------------------------------------------
400 {
404 
415 
422 
427 #ifndef SWIG
428  _aiTextureFlags_Force32Bit = INT_MAX
429 #endif
430 };
432 
433 
434 // ---------------------------------------------------------------------------
451 {
459 
468 
469  // we don't need more for the moment, but we might need them
470  // in future versions ...
471 
476 #ifndef SWIG
477  _aiBlendMode_Force32Bit = INT_MAX
478 #endif
479 };
481 
482 
483 #include "./Compiler/pushpack1.h"
484 
485 // ---------------------------------------------------------------------------
496 {
502 
508 
515  float mRotation;
516 
517 
518 #ifdef __cplusplus
519  aiUVTransform()
520  : mScaling (1.f,1.f)
521  , mRotation (0.f)
522  {
523  // nothing to be done here ...
524  }
525 #endif
526 
527 } PACK_STRUCT;
528 
529 #include "./Compiler/poppack1.h"
530 
532 // ---------------------------------------------------------------------------
536 enum aiPropertyTypeInfo
537 {
544  aiPTI_Float = 0x1,
545 
551  aiPTI_String = 0x3,
552 
559  aiPTI_Integer = 0x4,
560 
561 
564  aiPTI_Buffer = 0x5,
565 
566 
570 #ifndef SWIG
571  _aiPTI_Force32Bit = INT_MAX
572 #endif
573 };
574 
575 // ---------------------------------------------------------------------------
595 struct aiMaterialProperty
596 {
600  C_STRUCT aiString mKey;
601 
606  unsigned int mSemantic;
607 
611  unsigned int mIndex;
612 
616  unsigned int mDataLength;
617 
625  C_ENUM aiPropertyTypeInfo mType;
626 
630  char* mData;
631 
632 #ifdef __cplusplus
633 
634  aiMaterialProperty()
635  : mSemantic( 0 )
636  , mIndex( 0 )
637  , mDataLength( 0 )
638  , mType( aiPTI_Float )
639  , mData( NULL )
640  {
641  }
642 
643  ~aiMaterialProperty() {
644  delete[] mData;
645  }
646 
647 #endif
648 };
650 
651 #ifdef __cplusplus
652 } // We need to leave the "C" block here to allow template member functions
653 #endif
654 
655 // ---------------------------------------------------------------------------
664 #ifdef __cplusplus
665 struct ASSIMP_API aiMaterial
666 #else
667 struct aiMaterial
668 #endif
669 {
670 
671 #ifdef __cplusplus
672 
673 public:
674 
675  aiMaterial();
676  ~aiMaterial();
677 
678  // -------------------------------------------------------------------
690  template <typename Type>
691  aiReturn Get(const char* pKey,unsigned int type,
692  unsigned int idx, Type* pOut, unsigned int* pMax) const;
693 
694  aiReturn Get(const char* pKey,unsigned int type,
695  unsigned int idx, int* pOut, unsigned int* pMax) const;
696 
697  aiReturn Get(const char* pKey,unsigned int type,
698  unsigned int idx, float* pOut, unsigned int* pMax) const;
699 
700  // -------------------------------------------------------------------
710  template <typename Type>
711  aiReturn Get(const char* pKey,unsigned int type,
712  unsigned int idx,Type& pOut) const;
713 
714 
715  aiReturn Get(const char* pKey,unsigned int type,
716  unsigned int idx, int& pOut) const;
717 
718  aiReturn Get(const char* pKey,unsigned int type,
719  unsigned int idx, float& pOut) const;
720 
721  aiReturn Get(const char* pKey,unsigned int type,
722  unsigned int idx, aiString& pOut) const;
723 
724  aiReturn Get(const char* pKey,unsigned int type,
725  unsigned int idx, aiColor3D& pOut) const;
726 
727  aiReturn Get(const char* pKey,unsigned int type,
728  unsigned int idx, aiColor4D& pOut) const;
729 
730  aiReturn Get(const char* pKey,unsigned int type,
731  unsigned int idx, aiUVTransform& pOut) const;
732 
733  // -------------------------------------------------------------------
738  unsigned int GetTextureCount(aiTextureType type) const;
739 
740  // -------------------------------------------------------------------
767  // -------------------------------------------------------------------
768  aiReturn GetTexture(aiTextureType type,
769  unsigned int index,
770  C_STRUCT aiString* path,
771  aiTextureMapping* mapping = NULL,
772  unsigned int* uvindex = NULL,
773  float* blend = NULL,
774  aiTextureOp* op = NULL,
775  aiTextureMapMode* mapmode = NULL) const;
776 
777 
778  // Setters
779 
780 
781  // ------------------------------------------------------------------------------
791  aiReturn AddBinaryProperty (const void* pInput,
792  unsigned int pSizeInBytes,
793  const char* pKey,
794  unsigned int type ,
795  unsigned int index ,
796  aiPropertyTypeInfo pType);
797 
798  // ------------------------------------------------------------------------------
806  aiReturn AddProperty (const aiString* pInput,
807  const char* pKey,
808  unsigned int type = 0,
809  unsigned int index = 0);
810 
811  // ------------------------------------------------------------------------------
818  template<class TYPE>
819  aiReturn AddProperty (const TYPE* pInput,
820  unsigned int pNumValues,
821  const char* pKey,
822  unsigned int type = 0,
823  unsigned int index = 0);
824 
825  aiReturn AddProperty (const aiVector3D* pInput,
826  unsigned int pNumValues,
827  const char* pKey,
828  unsigned int type = 0,
829  unsigned int index = 0);
830 
831  aiReturn AddProperty (const aiColor3D* pInput,
832  unsigned int pNumValues,
833  const char* pKey,
834  unsigned int type = 0,
835  unsigned int index = 0);
836 
837  aiReturn AddProperty (const aiColor4D* pInput,
838  unsigned int pNumValues,
839  const char* pKey,
840  unsigned int type = 0,
841  unsigned int index = 0);
842 
843  aiReturn AddProperty (const int* pInput,
844  unsigned int pNumValues,
845  const char* pKey,
846  unsigned int type = 0,
847  unsigned int index = 0);
848 
849  aiReturn AddProperty (const float* pInput,
850  unsigned int pNumValues,
851  const char* pKey,
852  unsigned int type = 0,
853  unsigned int index = 0);
854 
855  aiReturn AddProperty (const aiUVTransform* pInput,
856  unsigned int pNumValues,
857  const char* pKey,
858  unsigned int type = 0,
859  unsigned int index = 0);
860 
861  // ------------------------------------------------------------------------------
866  aiReturn RemoveProperty (const char* pKey,
867  unsigned int type = 0,
868  unsigned int index = 0);
869 
870  // ------------------------------------------------------------------------------
874  void Clear();
875 
876  // ------------------------------------------------------------------------------
881  static void CopyPropertyList(aiMaterial* pcDest,
882  const aiMaterial* pcSrc);
883 
884 
885 #endif
886 
888  C_STRUCT aiMaterialProperty** mProperties;
889 
891  unsigned int mNumProperties;
892 
894  unsigned int mNumAllocated;
895 };
896 
897 // Go back to extern "C" again
898 #ifdef __cplusplus
899 extern "C" {
900 #endif
901 
902 // ---------------------------------------------------------------------------
903 #define AI_MATKEY_NAME "?mat.name",0,0
904 #define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
905 #define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
906 #define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
907 #define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
908 #define AI_MATKEY_OPACITY "$mat.opacity",0,0
909 #define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
910 #define AI_MATKEY_SHININESS "$mat.shininess",0,0
911 #define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
912 #define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
913 #define AI_MATKEY_REFRACTI "$mat.refracti",0,0
914 #define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
915 #define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
916 #define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
917 #define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
918 #define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
919 #define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
920 #define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
921 
922 // ---------------------------------------------------------------------------
923 // Pure key names for all texture-related properties
925 #define _AI_MATKEY_TEXTURE_BASE "$tex.file"
926 #define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc"
927 #define _AI_MATKEY_TEXOP_BASE "$tex.op"
928 #define _AI_MATKEY_MAPPING_BASE "$tex.mapping"
929 #define _AI_MATKEY_TEXBLEND_BASE "$tex.blend"
930 #define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu"
931 #define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev"
932 #define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis"
933 #define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo"
934 #define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags"
935 
937 // ---------------------------------------------------------------------------
938 #define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
939 
940 // For backward compatibility and simplicity
942 #define AI_MATKEY_TEXTURE_DIFFUSE(N) \
943  AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
944 
945 #define AI_MATKEY_TEXTURE_SPECULAR(N) \
946  AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
947 
948 #define AI_MATKEY_TEXTURE_AMBIENT(N) \
949  AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
950 
951 #define AI_MATKEY_TEXTURE_EMISSIVE(N) \
952  AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
953 
954 #define AI_MATKEY_TEXTURE_NORMALS(N) \
955  AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
956 
957 #define AI_MATKEY_TEXTURE_HEIGHT(N) \
958  AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
959 
960 #define AI_MATKEY_TEXTURE_SHININESS(N) \
961  AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
962 
963 #define AI_MATKEY_TEXTURE_OPACITY(N) \
964  AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
965 
966 #define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \
967  AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
968 
969 #define AI_MATKEY_TEXTURE_LIGHTMAP(N) \
970  AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
971 
972 #define AI_MATKEY_TEXTURE_REFLECTION(N) \
973  AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
974 
976 
977 // ---------------------------------------------------------------------------
978 #define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
979 
980 // For backward compatibility and simplicity
982 #define AI_MATKEY_UVWSRC_DIFFUSE(N) \
983  AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
984 
985 #define AI_MATKEY_UVWSRC_SPECULAR(N) \
986  AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
987 
988 #define AI_MATKEY_UVWSRC_AMBIENT(N) \
989  AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
990 
991 #define AI_MATKEY_UVWSRC_EMISSIVE(N) \
992  AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
993 
994 #define AI_MATKEY_UVWSRC_NORMALS(N) \
995  AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
996 
997 #define AI_MATKEY_UVWSRC_HEIGHT(N) \
998  AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
999 
1000 #define AI_MATKEY_UVWSRC_SHININESS(N) \
1001  AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
1002 
1003 #define AI_MATKEY_UVWSRC_OPACITY(N) \
1004  AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
1005 
1006 #define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \
1007  AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
1008 
1009 #define AI_MATKEY_UVWSRC_LIGHTMAP(N) \
1010  AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
1011 
1012 #define AI_MATKEY_UVWSRC_REFLECTION(N) \
1013  AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
1014 
1016 // ---------------------------------------------------------------------------
1017 #define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
1018 
1019 // For backward compatibility and simplicity
1021 #define AI_MATKEY_TEXOP_DIFFUSE(N) \
1022  AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
1023 
1024 #define AI_MATKEY_TEXOP_SPECULAR(N) \
1025  AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
1026 
1027 #define AI_MATKEY_TEXOP_AMBIENT(N) \
1028  AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
1029 
1030 #define AI_MATKEY_TEXOP_EMISSIVE(N) \
1031  AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
1032 
1033 #define AI_MATKEY_TEXOP_NORMALS(N) \
1034  AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
1035 
1036 #define AI_MATKEY_TEXOP_HEIGHT(N) \
1037  AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
1038 
1039 #define AI_MATKEY_TEXOP_SHININESS(N) \
1040  AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
1041 
1042 #define AI_MATKEY_TEXOP_OPACITY(N) \
1043  AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
1044 
1045 #define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
1046  AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
1047 
1048 #define AI_MATKEY_TEXOP_LIGHTMAP(N) \
1049  AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
1050 
1051 #define AI_MATKEY_TEXOP_REFLECTION(N) \
1052  AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
1053 
1055 // ---------------------------------------------------------------------------
1056 #define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
1057 
1058 // For backward compatibility and simplicity
1060 #define AI_MATKEY_MAPPING_DIFFUSE(N) \
1061  AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
1062 
1063 #define AI_MATKEY_MAPPING_SPECULAR(N) \
1064  AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
1065 
1066 #define AI_MATKEY_MAPPING_AMBIENT(N) \
1067  AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
1068 
1069 #define AI_MATKEY_MAPPING_EMISSIVE(N) \
1070  AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
1071 
1072 #define AI_MATKEY_MAPPING_NORMALS(N) \
1073  AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
1074 
1075 #define AI_MATKEY_MAPPING_HEIGHT(N) \
1076  AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
1077 
1078 #define AI_MATKEY_MAPPING_SHININESS(N) \
1079  AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
1080 
1081 #define AI_MATKEY_MAPPING_OPACITY(N) \
1082  AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
1083 
1084 #define AI_MATKEY_MAPPING_DISPLACEMENT(N) \
1085  AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
1086 
1087 #define AI_MATKEY_MAPPING_LIGHTMAP(N) \
1088  AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
1089 
1090 #define AI_MATKEY_MAPPING_REFLECTION(N) \
1091  AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
1092 
1094 // ---------------------------------------------------------------------------
1095 #define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
1096 
1097 // For backward compatibility and simplicity
1099 #define AI_MATKEY_TEXBLEND_DIFFUSE(N) \
1100  AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
1101 
1102 #define AI_MATKEY_TEXBLEND_SPECULAR(N) \
1103  AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
1104 
1105 #define AI_MATKEY_TEXBLEND_AMBIENT(N) \
1106  AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
1107 
1108 #define AI_MATKEY_TEXBLEND_EMISSIVE(N) \
1109  AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
1110 
1111 #define AI_MATKEY_TEXBLEND_NORMALS(N) \
1112  AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
1113 
1114 #define AI_MATKEY_TEXBLEND_HEIGHT(N) \
1115  AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
1116 
1117 #define AI_MATKEY_TEXBLEND_SHININESS(N) \
1118  AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
1119 
1120 #define AI_MATKEY_TEXBLEND_OPACITY(N) \
1121  AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
1122 
1123 #define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \
1124  AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
1125 
1126 #define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \
1127  AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
1128 
1129 #define AI_MATKEY_TEXBLEND_REFLECTION(N) \
1130  AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
1131 
1133 // ---------------------------------------------------------------------------
1134 #define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
1135 
1136 // For backward compatibility and simplicity
1138 #define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \
1139  AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
1140 
1141 #define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
1142  AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
1143 
1144 #define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \
1145  AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
1146 
1147 #define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
1148  AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
1149 
1150 #define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \
1151  AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
1152 
1153 #define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \
1154  AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
1155 
1156 #define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \
1157  AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
1158 
1159 #define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \
1160  AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
1161 
1162 #define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
1163  AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
1164 
1165 #define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
1166  AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
1167 
1168 #define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \
1169  AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
1170 
1172 // ---------------------------------------------------------------------------
1173 #define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
1174 
1175 // For backward compatibility and simplicity
1177 #define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \
1178  AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
1179 
1180 #define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
1181  AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
1182 
1183 #define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \
1184  AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
1185 
1186 #define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
1187  AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
1188 
1189 #define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \
1190  AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
1191 
1192 #define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \
1193  AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
1194 
1195 #define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \
1196  AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
1197 
1198 #define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \
1199  AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
1200 
1201 #define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
1202  AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
1203 
1204 #define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
1205  AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
1206 
1207 #define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \
1208  AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
1209 
1211 // ---------------------------------------------------------------------------
1212 #define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
1213 
1214 // For backward compatibility and simplicity
1216 #define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \
1217  AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
1218 
1219 #define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \
1220  AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
1221 
1222 #define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \
1223  AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
1224 
1225 #define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \
1226  AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
1227 
1228 #define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \
1229  AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
1230 
1231 #define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
1232  AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
1233 
1234 #define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \
1235  AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
1236 
1237 #define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \
1238  AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
1239 
1240 #define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \
1241  AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
1242 
1243 #define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \
1244  AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
1245 
1246 #define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
1247  AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
1248 
1250 // ---------------------------------------------------------------------------
1251 #define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
1252 
1253 // For backward compatibility and simplicity
1255 #define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \
1256  AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
1257 
1258 #define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \
1259  AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
1260 
1261 #define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \
1262  AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
1263 
1264 #define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \
1265  AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
1266 
1267 #define AI_MATKEY_UVTRANSFORM_NORMALS(N) \
1268  AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
1269 
1270 #define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
1271  AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
1272 
1273 #define AI_MATKEY_UVTRANSFORM_SHININESS(N) \
1274  AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
1275 
1276 #define AI_MATKEY_UVTRANSFORM_OPACITY(N) \
1277  AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
1278 
1279 #define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \
1280  AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
1281 
1282 #define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \
1283  AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
1284 
1285 #define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
1286  AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
1287 
1288 #define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \
1289  AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
1290 
1292 // ---------------------------------------------------------------------------
1293 #define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
1294 
1295 // For backward compatibility and simplicity
1297 #define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \
1298  AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
1299 
1300 #define AI_MATKEY_TEXFLAGS_SPECULAR(N) \
1301  AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
1302 
1303 #define AI_MATKEY_TEXFLAGS_AMBIENT(N) \
1304  AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT,N)
1305 
1306 #define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \
1307  AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE,N)
1308 
1309 #define AI_MATKEY_TEXFLAGS_NORMALS(N) \
1310  AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS,N)
1311 
1312 #define AI_MATKEY_TEXFLAGS_HEIGHT(N) \
1313  AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT,N)
1314 
1315 #define AI_MATKEY_TEXFLAGS_SHININESS(N) \
1316  AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS,N)
1317 
1318 #define AI_MATKEY_TEXFLAGS_OPACITY(N) \
1319  AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY,N)
1320 
1321 #define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \
1322  AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT,N)
1323 
1324 #define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \
1325  AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP,N)
1326 
1327 #define AI_MATKEY_TEXFLAGS_REFLECTION(N) \
1328  AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION,N)
1329 
1330 #define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
1331  AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
1332 
1333 // ---------------------------------------------------------------------------
1343 // ---------------------------------------------------------------------------
1344 ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
1345  const C_STRUCT aiMaterial* pMat,
1346  const char* pKey,
1347  unsigned int type,
1348  unsigned int index,
1349  const C_STRUCT aiMaterialProperty** pPropOut);
1350 
1351 // ---------------------------------------------------------------------------
1376 // ---------------------------------------------------------------------------
1377 ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
1378  const C_STRUCT aiMaterial* pMat,
1379  const char* pKey,
1380  unsigned int type,
1381  unsigned int index,
1382  float* pOut,
1383  unsigned int* pMax);
1384 
1385 
1386 #ifdef __cplusplus
1387 
1388 // ---------------------------------------------------------------------------
1406 // ---------------------------------------------------------------------------
1407 inline aiReturn aiGetMaterialFloat(const aiMaterial* pMat,
1408  const char* pKey,
1409  unsigned int type,
1410  unsigned int index,
1411  float* pOut)
1412 {
1413  return aiGetMaterialFloatArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
1414 }
1415 
1416 #else
1417 
1418 // Use our friend, the C preprocessor
1419 #define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
1420  aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
1421 
1422 #endif
1423 
1424 
1425 // ---------------------------------------------------------------------------
1430 ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial* pMat,
1431  const char* pKey,
1432  unsigned int type,
1433  unsigned int index,
1434  int* pOut,
1435  unsigned int* pMax);
1436 
1437 
1438 #ifdef __cplusplus
1439 
1440 // ---------------------------------------------------------------------------
1444 // ---------------------------------------------------------------------------
1445 inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
1446  const char* pKey,
1447  unsigned int type,
1448  unsigned int index,
1449  int* pOut)
1450 {
1451  return aiGetMaterialIntegerArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
1452 }
1453 
1454 #else
1455 
1456 // use our friend, the C preprocessor
1457 #define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
1458  aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
1459 
1460 #endif
1461 
1462 
1463 
1464 // ---------------------------------------------------------------------------
1468 // ---------------------------------------------------------------------------
1469 ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
1470  const char* pKey,
1471  unsigned int type,
1472  unsigned int index,
1473  C_STRUCT aiColor4D* pOut);
1474 
1475 
1476 // ---------------------------------------------------------------------------
1480 // ---------------------------------------------------------------------------
1481 ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial* pMat,
1482  const char* pKey,
1483  unsigned int type,
1484  unsigned int index,
1485  C_STRUCT aiUVTransform* pOut);
1486 
1487 
1488 // ---------------------------------------------------------------------------
1492 // ---------------------------------------------------------------------------
1493 ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial* pMat,
1494  const char* pKey,
1495  unsigned int type,
1496  unsigned int index,
1497  C_STRUCT aiString* pOut);
1498 
1499 // ---------------------------------------------------------------------------
1505 // ---------------------------------------------------------------------------
1506 ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMat,
1507  C_ENUM aiTextureType type);
1508 
1509 // ---------------------------------------------------------------------------
1541 // ---------------------------------------------------------------------------
1542 #ifdef __cplusplus
1543 ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
1544  aiTextureType type,
1545  unsigned int index,
1546  aiString* path,
1547  aiTextureMapping* mapping = NULL,
1548  unsigned int* uvindex = NULL,
1549  float* blend = NULL,
1550  aiTextureOp* op = NULL,
1551  aiTextureMapMode* mapmode = NULL,
1552  unsigned int* flags = NULL);
1553 #else
1554 C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
1555  C_ENUM aiTextureType type,
1556  unsigned int index,
1557  C_STRUCT aiString* path,
1558  C_ENUM aiTextureMapping* mapping /*= NULL*/,
1559  unsigned int* uvindex /*= NULL*/,
1560  float* blend /*= NULL*/,
1561  C_ENUM aiTextureOp* op /*= NULL*/,
1562  C_ENUM aiTextureMapMode* mapmode /*= NULL*/,
1563  unsigned int* flags /*= NULL*/);
1564 #endif // !#ifdef __cplusplus
1565 
1566 #ifdef __cplusplus
1567 }
1568 
1569 #include "material.inl"
1570 
1571 #endif
1572 #endif
T = T1 / T2.
Definition: material.h:89
T = T1 + (T2-0.5)
Definition: material.h:95
No shading at all.
Definition: material.h:370
T = T1 * T2.
Definition: material.h:80
Formula:
Definition: material.h:458
aiBlendMode
Defines alpha-blend flags.
Definition: material.h:450
OrenNayar-Shading per pixel.
Definition: material.h:353
A texture coordinate u|v is translated to u%1|v%1.
Definition: material.h:117
Basic data types and primitives, such as vectors or colors.
T = T1 - T2.
Definition: material.h:86
The texture is a (tangent space) normal-map.
Definition: material.h:249
Explicit request to the application to process the alpha channel of the texture.
Definition: material.h:414
The texture is a height map.
Definition: material.h:241
aiTextureFlags
Defines some mixed flags for a particular texture.
Definition: material.h:399
Planar mapping.
Definition: material.h:173
Represents a two-dimensional vector.
Definition: vector2.h:105
Undefined mapping.
Definition: material.h:176
Flat shading.
Definition: material.h:328
T = (T1 + T2) - (T1 * T2)
Definition: material.h:92
Cylindrical mapping.
Definition: material.h:167
Texture coordinates outside [0...1] are clamped to the nearest valid value.
Definition: material.h:122
unsigned int mNumProperties
Number of properties in the data base.
Definition: material.h:891
float mRotation
Rotation - in counter-clockwise direction.
Definition: material.h:515
Fresnel shading.
Definition: material.h:374
aiShadingMode
Defines all shading models supported by the library.
Definition: material.h:323
C_STRUCT aiVector2D mTranslation
Translation on the u and v axes.
Definition: material.h:501
Cubic mapping.
Definition: material.h:170
The texture is combined with the result of the ambient lighting equation.
Definition: material.h:229
Unknown texture.
Definition: material.h:296
Dummy value.
Definition: material.h:212
Displacement texture.
Definition: material.h:272
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:251
aiTextureMapMode
Defines how UV coordinates outside the [0...1] range are handled.
Definition: material.h:113
The texture is added to the result of the lighting calculation.
Definition: material.h:234
CookTorrance-Shading per pixel.
Definition: material.h:366
Defines how an UV channel is transformed.
Definition: material.h:495
Phong-Blinn-Shading.
Definition: material.h:340
A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and 1-(u%1)|1-(v%1) otherwise...
Definition: material.h:132
aiTextureMapping
Defines how the mapping coords for a texture are generated.
Definition: material.h:153
The texture is combined with the result of the specular lighting equation.
Definition: material.h:224
C_STRUCT aiVector2D mScaling
Scaling on the u and v axes.
Definition: material.h:507
Definition: vector3.h:134
The mapping coordinates are taken from an UV channel.
Definition: material.h:161
Represents a color in Red-Green-Blue space.
Definition: types.h:159
The texture is combined with the result of the diffuse lighting equation.
Definition: material.h:219
*/
Definition: material.h:665
Additive blending.
Definition: material.h:467
The texture&#39;s color values have to be inverted (componentwise 1-n)
Definition: material.h:403
Spherical mapping.
Definition: material.h:164
aiTextureOp
Defines how the Nth texture of a specific type is combined with the result of all previous layers...
Definition: material.h:77
aiTextureType
Defines the purpose of a texture.
Definition: material.h:204
Toon-Shading per pixel.
Definition: material.h:346
Definition: color4.h:96
T = T1 + T2.
Definition: material.h:83
The texture defines per-pixel opacity.
Definition: material.h:265
unsigned int mNumAllocated
Storage allocated.
Definition: material.h:894
Explicit request to the application to ignore the alpha channel of the texture.
Definition: material.h:421
Phong-Shading -.
Definition: material.h:336
If the texture coordinates for a pixel are outside [0...1] the texture is not applied to that pixel...
Definition: material.h:127
Lightmap texture (aka Ambient Occlusion)
Definition: material.h:281
Simple Gouraud shading.
Definition: material.h:332
Minnaert-Shading per pixel.
Definition: material.h:360
C_STRUCT aiMaterialProperty ** mProperties
List of all material properties loaded.
Definition: material.h:888
Reflection texture.
Definition: material.h:288
The texture defines the glossiness of the material.
Definition: material.h:258