|
| 1 | +unit aiMaterial; |
| 2 | + |
| 3 | +interface |
| 4 | + |
| 5 | +uses aiTypes, aiVector2D, aiVector3D; |
| 6 | + |
| 7 | +{This following directive causes enums to be stored as double words (32bit), to be compatible with |
| 8 | + the assimp C Dll} |
| 9 | +{$Z4} |
| 10 | + |
| 11 | +type TaiTextureOp = ( |
| 12 | + aiTextureOp_Multiply = $0, |
| 13 | + aiTextureOp_Add = $1, |
| 14 | + aiTextureOp_Subtract = $2, |
| 15 | + aiTextureOp_Divide = $3, |
| 16 | + aiTextureOp_SmoothAdd = $4, |
| 17 | + aiTextureOp_SignedAdd = $5 |
| 18 | + //_aiTextureOp_Force32Bit = 0x9fffffff |
| 19 | +); |
| 20 | + |
| 21 | +type TaiTextureMapMode = ( |
| 22 | + aiTextureMapMode_Wrap = $0, |
| 23 | + aiTextureMapMode_Clamp = $1, |
| 24 | + aiTextureMapMode_Decal = $3, |
| 25 | + aiTextureMapMode_Mirror = $2 |
| 26 | + //_aiTextureMapMode_Force32Bit = 0x9fffffff |
| 27 | +); |
| 28 | + |
| 29 | +type TaiTextureMapping = ( |
| 30 | + aiTextureMapping_UV = $0, |
| 31 | + aiTextureMapping_SPHERE = $1, |
| 32 | + aiTextureMapping_CYLINDER = $2, |
| 33 | + aiTextureMapping_BOX = $3, |
| 34 | + aiTextureMapping_PLANE = $4, |
| 35 | + aiTextureMapping_OTHER = $5 |
| 36 | + //_aiTextureMapping_Force32Bit = 0x9fffffff |
| 37 | +); |
| 38 | + |
| 39 | +type TaiTextureType = ( |
| 40 | + aiTextureType_NONE = $0, |
| 41 | + aiTextureType_DIFFUSE = $1, |
| 42 | + aiTextureType_SPECULAR = $2, |
| 43 | + aiTextureType_AMBIENT = $3, |
| 44 | + aiTextureType_EMISSIVE = $4, |
| 45 | + aiTextureType_HEIGHT = $5, |
| 46 | + aiTextureType_NORMALS = $6, |
| 47 | + aiTextureType_SHININESS = $7, |
| 48 | + aiTextureType_OPACITY = $8, |
| 49 | + aiTextureType_DISPLACEMENT = $9, |
| 50 | + aiTextureType_LIGHTMAP = $A, |
| 51 | + aiTextureType_REFLECTION = $B, |
| 52 | + aiTextureType_UNKNOWN = $C |
| 53 | + //_aiTextureType_Force32Bit = 0x9fffffff |
| 54 | +); |
| 55 | + |
| 56 | +const AI_TEXTURE_TYPE_MAX = aiTextureType_UNKNOWN; |
| 57 | + |
| 58 | +type TaiShadingMode = ( |
| 59 | + aiShadingMode_Flat = $1, |
| 60 | + aiShadingMode_Gouraud = $2, |
| 61 | + aiShadingMode_Phong = $3, |
| 62 | + aiShadingMode_Blinn = $4, |
| 63 | + aiShadingMode_Toon = $5, |
| 64 | + aiShadingMode_OrenNayar = $6, |
| 65 | + aiShadingMode_Minnaert = $7, |
| 66 | + aiShadingMode_CookTorrance = $8, |
| 67 | + aiShadingMode_NoShading = $9, |
| 68 | + aiShadingMode_Fresnel = $A |
| 69 | + //_aiShadingMode_Force32Bit = 0x9fffffff |
| 70 | +); |
| 71 | + |
| 72 | + |
| 73 | +type TaiTextureFlags = ( |
| 74 | + aiTextureFlags_Invert = $1, |
| 75 | + aiTextureFlags_UseAlpha = $2, |
| 76 | + aiTextureFlags_IgnoreAlpha = $4 |
| 77 | + //_aiTextureFlags_Force32Bit = 0x9fffffff |
| 78 | +); |
| 79 | + |
| 80 | +type TaiBlendMode = ( |
| 81 | + aiBlendMode_Default = $0, |
| 82 | + aiBlendMode_Additive = $1 |
| 83 | + //_aiBlendMode_Force32Bit = 0x9fffffff |
| 84 | +); |
| 85 | + |
| 86 | +type TaiUVTransform = packed record |
| 87 | + mTranslation: TaiVector2D; |
| 88 | + mScaling: TaiVector2D; |
| 89 | + mRotation: single; |
| 90 | +end; |
| 91 | + |
| 92 | +type TaiPropertyTypeInfo = ( |
| 93 | + aiPTI_Float = $1, |
| 94 | + aiPTI_String = $3, |
| 95 | + aiPTI_Integer = $4, |
| 96 | + aiPTI_Buffer = $5 |
| 97 | + // _aiPTI_Force32Bit = 0x9fffffff |
| 98 | +); |
| 99 | + |
| 100 | +type TaiMaterialProperty = packed record |
| 101 | + mKey: aiString; |
| 102 | + mSemantic: Cardinal; |
| 103 | + mIndex: Cardinal; |
| 104 | + mDataLength: Cardinal; |
| 105 | + mType: TaiPropertyTypeInfo; |
| 106 | + mData: PChar; |
| 107 | +end; |
| 108 | +type PaiMaterialProperty = ^TaiMaterialProperty; |
| 109 | + |
| 110 | +type TaiMaterial = packed record |
| 111 | + mProperties: pointer; |
| 112 | + mNumProperties: Cardinal; |
| 113 | + mNumAllocated: Cardinal; |
| 114 | +end; |
| 115 | +type PaiMaterial = ^TaiMaterial; |
| 116 | +type PaiMaterialArray = array[0..0] of PaiMaterial; |
| 117 | +type PPaiMaterialArray = ^PaiMaterialArray; |
| 118 | + |
| 119 | +const AI_MATKEY_NAME = '?mat.name'; |
| 120 | +const AI_MATKEY_TWOSIDED = '$mat.twosided'; |
| 121 | +const AI_MATKEY_SHADING_MODEL = '$mat.shadingm'; |
| 122 | +const AI_MATKEY_ENABLE_WIREFRAME = '$mat.wireframe'; |
| 123 | +const AI_MATKEY_BLEND_FUNC = '$mat.blend'; |
| 124 | +const AI_MATKEY_OPACITY = '$mat.opacity'; |
| 125 | +const AI_MATKEY_BUMPSCALING = '$mat.bumpscaling'; |
| 126 | +const AI_MATKEY_SHININESS = '$mat.shininess'; |
| 127 | +const AI_MATKEY_REFLECTIVITY = '$mat.reflectivity'; |
| 128 | +const AI_MATKEY_SHININESS_STRENGTH = '$mat.shinpercent'; |
| 129 | +const AI_MATKEY_REFRACTI = '$mat.refracti'; |
| 130 | +const AI_MATKEY_COLOR_DIFFUSE = '$clr.diffuse'; |
| 131 | +const AI_MATKEY_COLOR_AMBIENT = '$clr.ambient'; |
| 132 | +const AI_MATKEY_COLOR_SPECULAR = '$clr.specular'; |
| 133 | +const AI_MATKEY_COLOR_EMISSIVE = '$clr.emissive'; |
| 134 | +const AI_MATKEY_COLOR_TRANSPARENT = '$clr.transparent'; |
| 135 | +const AI_MATKEY_COLOR_REFLECTIVE = '$clr.reflective'; |
| 136 | +const AI_MATKEY_GLOBAL_BACKGROUND_IMAGE = '?bg.global'; |
| 137 | + |
| 138 | +const _AI_MATKEY_TEXTURE_BASE = '$tex.file'; |
| 139 | +const _AI_MATKEY_UVWSRC_BASE = '$tex.uvwsrc'; |
| 140 | +const _AI_MATKEY_TEXOP_BASE = '$tex.op'; |
| 141 | +const _AI_MATKEY_MAPPING_BASE = '$tex.mapping'; |
| 142 | +const _AI_MATKEY_TEXBLEND_BASE = '$tex.blend'; |
| 143 | +const _AI_MATKEY_MAPPINGMODE_U_BASE = '$tex.mapmodeu'; |
| 144 | +const _AI_MATKEY_MAPPINGMODE_V_BASE = '$tex.mapmodev'; |
| 145 | +const _AI_MATKEY_TEXMAP_AXIS_BASE = '$tex.mapaxis'; |
| 146 | +const _AI_MATKEY_UVTRANSFORM_BASE = '$tex.uvtrafo'; |
| 147 | +const _AI_MATKEY_TEXFLAGS_BASE = '$tex.flags'; |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | +implementation |
| 152 | + |
| 153 | +end. |
0 commit comments