miniassimp
diff include/miniassimp/cimport.h @ 0:879c81d94345
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 28 Jan 2019 18:19:26 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/include/miniassimp/cimport.h Mon Jan 28 18:19:26 2019 +0200 1.3 @@ -0,0 +1,565 @@ 1.4 +/* 1.5 +--------------------------------------------------------------------------- 1.6 +Open Asset Import Library (assimp) 1.7 +--------------------------------------------------------------------------- 1.8 + 1.9 +Copyright (c) 2006-2018, assimp team 1.10 + 1.11 + 1.12 + 1.13 +All rights reserved. 1.14 + 1.15 +Redistribution and use of this software in source and binary forms, 1.16 +with or without modification, are permitted provided that the following 1.17 +conditions are met: 1.18 + 1.19 +* Redistributions of source code must retain the above 1.20 + copyright notice, this list of conditions and the 1.21 + following disclaimer. 1.22 + 1.23 +* Redistributions in binary form must reproduce the above 1.24 + copyright notice, this list of conditions and the 1.25 + following disclaimer in the documentation and/or other 1.26 + materials provided with the distribution. 1.27 + 1.28 +* Neither the name of the assimp team, nor the names of its 1.29 + contributors may be used to endorse or promote products 1.30 + derived from this software without specific prior 1.31 + written permission of the assimp team. 1.32 + 1.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.44 +--------------------------------------------------------------------------- 1.45 +*/ 1.46 + 1.47 +/** @file cimport.h 1.48 + * @brief Defines the C-API to the Open Asset Import Library. 1.49 + */ 1.50 +#pragma once 1.51 +#ifndef AI_ASSIMP_H_INC 1.52 +#define AI_ASSIMP_H_INC 1.53 + 1.54 +#include <miniassimp/types.h> 1.55 +#include "importerdesc.h" 1.56 + 1.57 +#ifdef __cplusplus 1.58 +extern "C" { 1.59 +#endif 1.60 + 1.61 +struct aiScene; // aiScene.h 1.62 +struct aiFileIO; // aiFileIO.h 1.63 +typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */); 1.64 + 1.65 +// -------------------------------------------------------------------------------- 1.66 +/** C-API: Represents a log stream. A log stream receives all log messages and 1.67 + * streams them _somewhere_. 1.68 + * @see aiGetPredefinedLogStream 1.69 + * @see aiAttachLogStream 1.70 + * @see aiDetachLogStream */ 1.71 +// -------------------------------------------------------------------------------- 1.72 +struct aiLogStream 1.73 +{ 1.74 + /** callback to be called */ 1.75 + aiLogStreamCallback callback; 1.76 + 1.77 + /** user data to be passed to the callback */ 1.78 + char* user; 1.79 +}; 1.80 + 1.81 + 1.82 +// -------------------------------------------------------------------------------- 1.83 +/** C-API: Represents an opaque set of settings to be used during importing. 1.84 + * @see aiCreatePropertyStore 1.85 + * @see aiReleasePropertyStore 1.86 + * @see aiImportFileExWithProperties 1.87 + * @see aiSetPropertyInteger 1.88 + * @see aiSetPropertyFloat 1.89 + * @see aiSetPropertyString 1.90 + * @see aiSetPropertyMatrix 1.91 + */ 1.92 +// -------------------------------------------------------------------------------- 1.93 +struct aiPropertyStore { char sentinel; }; 1.94 + 1.95 +/** Our own C boolean type */ 1.96 +typedef int aiBool; 1.97 + 1.98 +#define AI_FALSE 0 1.99 +#define AI_TRUE 1 1.100 + 1.101 +// -------------------------------------------------------------------------------- 1.102 +/** Reads the given file and returns its content. 1.103 + * 1.104 + * If the call succeeds, the imported data is returned in an aiScene structure. 1.105 + * The data is intended to be read-only, it stays property of the ASSIMP 1.106 + * library and will be stable until aiReleaseImport() is called. After you're 1.107 + * done with it, call aiReleaseImport() to free the resources associated with 1.108 + * this file. If the import fails, NULL is returned instead. Call 1.109 + * aiGetErrorString() to retrieve a human-readable error text. 1.110 + * @param pFile Path and filename of the file to be imported, 1.111 + * expected to be a null-terminated c-string. NULL is not a valid value. 1.112 + * @param pFlags Optional post processing steps to be executed after 1.113 + * a successful import. Provide a bitwise combination of the 1.114 + * #aiPostProcessSteps flags. 1.115 + * @return Pointer to the imported data or NULL if the import failed. 1.116 + */ 1.117 +ASSIMP_API const C_STRUCT aiScene* aiImportFile( 1.118 + const char* pFile, 1.119 + unsigned int pFlags); 1.120 + 1.121 +// -------------------------------------------------------------------------------- 1.122 +/** Reads the given file using user-defined I/O functions and returns 1.123 + * its content. 1.124 + * 1.125 + * If the call succeeds, the imported data is returned in an aiScene structure. 1.126 + * The data is intended to be read-only, it stays property of the ASSIMP 1.127 + * library and will be stable until aiReleaseImport() is called. After you're 1.128 + * done with it, call aiReleaseImport() to free the resources associated with 1.129 + * this file. If the import fails, NULL is returned instead. Call 1.130 + * aiGetErrorString() to retrieve a human-readable error text. 1.131 + * @param pFile Path and filename of the file to be imported, 1.132 + * expected to be a null-terminated c-string. NULL is not a valid value. 1.133 + * @param pFlags Optional post processing steps to be executed after 1.134 + * a successful import. Provide a bitwise combination of the 1.135 + * #aiPostProcessSteps flags. 1.136 + * @param pFS aiFileIO structure. Will be used to open the model file itself 1.137 + * and any other files the loader needs to open. Pass NULL to use the default 1.138 + * implementation. 1.139 + * @return Pointer to the imported data or NULL if the import failed. 1.140 + * @note Include <aiFileIO.h> for the definition of #aiFileIO. 1.141 + */ 1.142 +ASSIMP_API const C_STRUCT aiScene* aiImportFileEx( 1.143 + const char* pFile, 1.144 + unsigned int pFlags, 1.145 + C_STRUCT aiFileIO* pFS); 1.146 + 1.147 +// -------------------------------------------------------------------------------- 1.148 +/** Same as #aiImportFileEx, but adds an extra parameter containing importer settings. 1.149 + * 1.150 + * @param pFile Path and filename of the file to be imported, 1.151 + * expected to be a null-terminated c-string. NULL is not a valid value. 1.152 + * @param pFlags Optional post processing steps to be executed after 1.153 + * a successful import. Provide a bitwise combination of the 1.154 + * #aiPostProcessSteps flags. 1.155 + * @param pFS aiFileIO structure. Will be used to open the model file itself 1.156 + * and any other files the loader needs to open. Pass NULL to use the default 1.157 + * implementation. 1.158 + * @param pProps #aiPropertyStore instance containing import settings. 1.159 + * @return Pointer to the imported data or NULL if the import failed. 1.160 + * @note Include <aiFileIO.h> for the definition of #aiFileIO. 1.161 + * @see aiImportFileEx 1.162 + */ 1.163 +ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties( 1.164 + const char* pFile, 1.165 + unsigned int pFlags, 1.166 + C_STRUCT aiFileIO* pFS, 1.167 + const C_STRUCT aiPropertyStore* pProps); 1.168 + 1.169 +// -------------------------------------------------------------------------------- 1.170 +/** Reads the given file from a given memory buffer, 1.171 + * 1.172 + * If the call succeeds, the contents of the file are returned as a pointer to an 1.173 + * aiScene object. The returned data is intended to be read-only, the importer keeps 1.174 + * ownership of the data and will destroy it upon destruction. If the import fails, 1.175 + * NULL is returned. 1.176 + * A human-readable error description can be retrieved by calling aiGetErrorString(). 1.177 + * @param pBuffer Pointer to the file data 1.178 + * @param pLength Length of pBuffer, in bytes 1.179 + * @param pFlags Optional post processing steps to be executed after 1.180 + * a successful import. Provide a bitwise combination of the 1.181 + * #aiPostProcessSteps flags. If you wish to inspect the imported 1.182 + * scene first in order to fine-tune your post-processing setup, 1.183 + * consider to use #aiApplyPostProcessing(). 1.184 + * @param pHint An additional hint to the library. If this is a non empty string, 1.185 + * the library looks for a loader to support the file extension specified by pHint 1.186 + * and passes the file to the first matching loader. If this loader is unable to 1.187 + * completely the request, the library continues and tries to determine the file 1.188 + * format on its own, a task that may or may not be successful. 1.189 + * Check the return value, and you'll know ... 1.190 + * @return A pointer to the imported data, NULL if the import failed. 1.191 + * 1.192 + * @note This is a straightforward way to decode models from memory 1.193 + * buffers, but it doesn't handle model formats that spread their 1.194 + * data across multiple files or even directories. Examples include 1.195 + * OBJ or MD3, which outsource parts of their material info into 1.196 + * external scripts. If you need full functionality, provide 1.197 + * a custom IOSystem to make Assimp find these files and use 1.198 + * the regular aiImportFileEx()/aiImportFileExWithProperties() API. 1.199 + */ 1.200 +ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory( 1.201 + const char* pBuffer, 1.202 + unsigned int pLength, 1.203 + unsigned int pFlags, 1.204 + const char* pHint); 1.205 + 1.206 +// -------------------------------------------------------------------------------- 1.207 +/** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings. 1.208 + * 1.209 + * @param pBuffer Pointer to the file data 1.210 + * @param pLength Length of pBuffer, in bytes 1.211 + * @param pFlags Optional post processing steps to be executed after 1.212 + * a successful import. Provide a bitwise combination of the 1.213 + * #aiPostProcessSteps flags. If you wish to inspect the imported 1.214 + * scene first in order to fine-tune your post-processing setup, 1.215 + * consider to use #aiApplyPostProcessing(). 1.216 + * @param pHint An additional hint to the library. If this is a non empty string, 1.217 + * the library looks for a loader to support the file extension specified by pHint 1.218 + * and passes the file to the first matching loader. If this loader is unable to 1.219 + * completely the request, the library continues and tries to determine the file 1.220 + * format on its own, a task that may or may not be successful. 1.221 + * Check the return value, and you'll know ... 1.222 + * @param pProps #aiPropertyStore instance containing import settings. 1.223 + * @return A pointer to the imported data, NULL if the import failed. 1.224 + * 1.225 + * @note This is a straightforward way to decode models from memory 1.226 + * buffers, but it doesn't handle model formats that spread their 1.227 + * data across multiple files or even directories. Examples include 1.228 + * OBJ or MD3, which outsource parts of their material info into 1.229 + * external scripts. If you need full functionality, provide 1.230 + * a custom IOSystem to make Assimp find these files and use 1.231 + * the regular aiImportFileEx()/aiImportFileExWithProperties() API. 1.232 + * @see aiImportFileFromMemory 1.233 + */ 1.234 +ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties( 1.235 + const char* pBuffer, 1.236 + unsigned int pLength, 1.237 + unsigned int pFlags, 1.238 + const char* pHint, 1.239 + const C_STRUCT aiPropertyStore* pProps); 1.240 + 1.241 +// -------------------------------------------------------------------------------- 1.242 +/** Apply post-processing to an already-imported scene. 1.243 + * 1.244 + * This is strictly equivalent to calling #aiImportFile()/#aiImportFileEx with the 1.245 + * same flags. However, you can use this separate function to inspect the imported 1.246 + * scene first to fine-tune your post-processing setup. 1.247 + * @param pScene Scene to work on. 1.248 + * @param pFlags Provide a bitwise combination of the #aiPostProcessSteps flags. 1.249 + * @return A pointer to the post-processed data. Post processing is done in-place, 1.250 + * meaning this is still the same #aiScene which you passed for pScene. However, 1.251 + * _if_ post-processing failed, the scene could now be NULL. That's quite a rare 1.252 + * case, post processing steps are not really designed to 'fail'. To be exact, 1.253 + * the #aiProcess_ValidateDataStructure flag is currently the only post processing step 1.254 + * which can actually cause the scene to be reset to NULL. 1.255 + */ 1.256 +ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing( 1.257 + const C_STRUCT aiScene* pScene, 1.258 + unsigned int pFlags); 1.259 + 1.260 +// -------------------------------------------------------------------------------- 1.261 +/** Get one of the predefine log streams. This is the quick'n'easy solution to 1.262 + * access Assimp's log system. Attaching a log stream can slightly reduce Assimp's 1.263 + * overall import performance. 1.264 + * 1.265 + * Usage is rather simple (this will stream the log to a file, named log.txt, and 1.266 + * the stdout stream of the process: 1.267 + * @code 1.268 + * struct aiLogStream c; 1.269 + * c = aiGetPredefinedLogStream(aiDefaultLogStream_FILE,"log.txt"); 1.270 + * aiAttachLogStream(&c); 1.271 + * c = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL); 1.272 + * aiAttachLogStream(&c); 1.273 + * @endcode 1.274 + * 1.275 + * @param pStreams One of the #aiDefaultLogStream enumerated values. 1.276 + * @param file Solely for the #aiDefaultLogStream_FILE flag: specifies the file to write to. 1.277 + * Pass NULL for all other flags. 1.278 + * @return The log stream. callback is set to NULL if something went wrong. 1.279 + */ 1.280 +ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream( 1.281 + C_ENUM aiDefaultLogStream pStreams, 1.282 + const char* file); 1.283 + 1.284 +// -------------------------------------------------------------------------------- 1.285 +/** Attach a custom log stream to the libraries' logging system. 1.286 + * 1.287 + * Attaching a log stream can slightly reduce Assimp's overall import 1.288 + * performance. Multiple log-streams can be attached. 1.289 + * @param stream Describes the new log stream. 1.290 + * @note To ensure proper destruction of the logging system, you need to manually 1.291 + * call aiDetachLogStream() on every single log stream you attach. 1.292 + * Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided. 1.293 + */ 1.294 +ASSIMP_API void aiAttachLogStream( 1.295 + const C_STRUCT aiLogStream* stream); 1.296 + 1.297 +// -------------------------------------------------------------------------------- 1.298 +/** Enable verbose logging. Verbose logging includes debug-related stuff and 1.299 + * detailed import statistics. This can have severe impact on import performance 1.300 + * and memory consumption. However, it might be useful to find out why a file 1.301 + * didn't read correctly. 1.302 + * @param d AI_TRUE or AI_FALSE, your decision. 1.303 + */ 1.304 +ASSIMP_API void aiEnableVerboseLogging(aiBool d); 1.305 + 1.306 +// -------------------------------------------------------------------------------- 1.307 +/** Detach a custom log stream from the libraries' logging system. 1.308 + * 1.309 + * This is the counterpart of #aiAttachLogStream. If you attached a stream, 1.310 + * don't forget to detach it again. 1.311 + * @param stream The log stream to be detached. 1.312 + * @return AI_SUCCESS if the log stream has been detached successfully. 1.313 + * @see aiDetachAllLogStreams 1.314 + */ 1.315 +ASSIMP_API C_ENUM aiReturn aiDetachLogStream( 1.316 + const C_STRUCT aiLogStream* stream); 1.317 + 1.318 +// -------------------------------------------------------------------------------- 1.319 +/** Detach all active log streams from the libraries' logging system. 1.320 + * This ensures that the logging system is terminated properly and all 1.321 + * resources allocated by it are actually freed. If you attached a stream, 1.322 + * don't forget to detach it again. 1.323 + * @see aiAttachLogStream 1.324 + * @see aiDetachLogStream 1.325 + */ 1.326 +ASSIMP_API void aiDetachAllLogStreams(void); 1.327 + 1.328 +// -------------------------------------------------------------------------------- 1.329 +/** Releases all resources associated with the given import process. 1.330 + * 1.331 + * Call this function after you're done with the imported data. 1.332 + * @param pScene The imported data to release. NULL is a valid value. 1.333 + */ 1.334 +ASSIMP_API void aiReleaseImport( 1.335 + const C_STRUCT aiScene* pScene); 1.336 + 1.337 +// -------------------------------------------------------------------------------- 1.338 +/** Returns the error text of the last failed import process. 1.339 + * 1.340 + * @return A textual description of the error that occurred at the last 1.341 + * import process. NULL if there was no error. There can't be an error if you 1.342 + * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing. 1.343 + */ 1.344 +ASSIMP_API const char* aiGetErrorString(void); 1.345 + 1.346 +// -------------------------------------------------------------------------------- 1.347 +/** Returns whether a given file extension is supported by ASSIMP 1.348 + * 1.349 + * @param szExtension Extension for which the function queries support for. 1.350 + * Must include a leading dot '.'. Example: ".3ds", ".md3" 1.351 + * @return AI_TRUE if the file extension is supported. 1.352 + */ 1.353 +ASSIMP_API aiBool aiIsExtensionSupported( 1.354 + const char* szExtension); 1.355 + 1.356 +// -------------------------------------------------------------------------------- 1.357 +/** Get a list of all file extensions supported by ASSIMP. 1.358 + * 1.359 + * If a file extension is contained in the list this does, of course, not 1.360 + * mean that ASSIMP is able to load all files with this extension. 1.361 + * @param szOut String to receive the extension list. 1.362 + * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter. 1.363 + */ 1.364 +ASSIMP_API void aiGetExtensionList( 1.365 + C_STRUCT aiString* szOut); 1.366 + 1.367 +// -------------------------------------------------------------------------------- 1.368 +/** Get the approximated storage required by an imported asset 1.369 + * @param pIn Input asset. 1.370 + * @param in Data structure to be filled. 1.371 + */ 1.372 +ASSIMP_API void aiGetMemoryRequirements( 1.373 + const C_STRUCT aiScene* pIn, 1.374 + C_STRUCT aiMemoryInfo* in); 1.375 + 1.376 + 1.377 + 1.378 +// -------------------------------------------------------------------------------- 1.379 +/** Create an empty property store. Property stores are used to collect import 1.380 + * settings. 1.381 + * @return New property store. Property stores need to be manually destroyed using 1.382 + * the #aiReleasePropertyStore API function. 1.383 + */ 1.384 +ASSIMP_API C_STRUCT aiPropertyStore* aiCreatePropertyStore(void); 1.385 + 1.386 +// -------------------------------------------------------------------------------- 1.387 +/** Delete a property store. 1.388 + * @param p Property store to be deleted. 1.389 + */ 1.390 +ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p); 1.391 + 1.392 +// -------------------------------------------------------------------------------- 1.393 +/** Set an integer property. 1.394 + * 1.395 + * This is the C-version of #Assimp::Importer::SetPropertyInteger(). In the C 1.396 + * interface, properties are always shared by all imports. It is not possible to 1.397 + * specify them per import. 1.398 + * 1.399 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. 1.400 + * @param szName Name of the configuration property to be set. All supported 1.401 + * public properties are defined in the config.h header file (AI_CONFIG_XXX). 1.402 + * @param value New value for the property 1.403 + */ 1.404 +ASSIMP_API void aiSetImportPropertyInteger( 1.405 + C_STRUCT aiPropertyStore* store, 1.406 + const char* szName, 1.407 + int value); 1.408 + 1.409 +// -------------------------------------------------------------------------------- 1.410 +/** Set a floating-point property. 1.411 + * 1.412 + * This is the C-version of #Assimp::Importer::SetPropertyFloat(). In the C 1.413 + * interface, properties are always shared by all imports. It is not possible to 1.414 + * specify them per import. 1.415 + * 1.416 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. 1.417 + * @param szName Name of the configuration property to be set. All supported 1.418 + * public properties are defined in the config.h header file (AI_CONFIG_XXX). 1.419 + * @param value New value for the property 1.420 + */ 1.421 +ASSIMP_API void aiSetImportPropertyFloat( 1.422 + C_STRUCT aiPropertyStore* store, 1.423 + const char* szName, 1.424 + ai_real value); 1.425 + 1.426 +// -------------------------------------------------------------------------------- 1.427 +/** Set a string property. 1.428 + * 1.429 + * This is the C-version of #Assimp::Importer::SetPropertyString(). In the C 1.430 + * interface, properties are always shared by all imports. It is not possible to 1.431 + * specify them per import. 1.432 + * 1.433 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. 1.434 + * @param szName Name of the configuration property to be set. All supported 1.435 + * public properties are defined in the config.h header file (AI_CONFIG_XXX). 1.436 + * @param st New value for the property 1.437 + */ 1.438 +ASSIMP_API void aiSetImportPropertyString( 1.439 + C_STRUCT aiPropertyStore* store, 1.440 + const char* szName, 1.441 + const C_STRUCT aiString* st); 1.442 + 1.443 +// -------------------------------------------------------------------------------- 1.444 +/** Set a matrix property. 1.445 + * 1.446 + * This is the C-version of #Assimp::Importer::SetPropertyMatrix(). In the C 1.447 + * interface, properties are always shared by all imports. It is not possible to 1.448 + * specify them per import. 1.449 + * 1.450 + * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. 1.451 + * @param szName Name of the configuration property to be set. All supported 1.452 + * public properties are defined in the config.h header file (AI_CONFIG_XXX). 1.453 + * @param mat New value for the property 1.454 + */ 1.455 +ASSIMP_API void aiSetImportPropertyMatrix( 1.456 + C_STRUCT aiPropertyStore* store, 1.457 + const char* szName, 1.458 + const C_STRUCT aiMatrix4x4* mat); 1.459 + 1.460 +// -------------------------------------------------------------------------------- 1.461 +/** Construct a quaternion from a 3x3 rotation matrix. 1.462 + * @param quat Receives the output quaternion. 1.463 + * @param mat Matrix to 'quaternionize'. 1.464 + * @see aiQuaternion(const aiMatrix3x3& pRotMatrix) 1.465 + */ 1.466 +ASSIMP_API void aiCreateQuaternionFromMatrix( 1.467 + C_STRUCT aiQuaternion* quat, 1.468 + const C_STRUCT aiMatrix3x3* mat); 1.469 + 1.470 +// -------------------------------------------------------------------------------- 1.471 +/** Decompose a transformation matrix into its rotational, translational and 1.472 + * scaling components. 1.473 + * 1.474 + * @param mat Matrix to decompose 1.475 + * @param scaling Receives the scaling component 1.476 + * @param rotation Receives the rotational component 1.477 + * @param position Receives the translational component. 1.478 + * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const; 1.479 + */ 1.480 +ASSIMP_API void aiDecomposeMatrix( 1.481 + const C_STRUCT aiMatrix4x4* mat, 1.482 + C_STRUCT aiVector3D* scaling, 1.483 + C_STRUCT aiQuaternion* rotation, 1.484 + C_STRUCT aiVector3D* position); 1.485 + 1.486 +// -------------------------------------------------------------------------------- 1.487 +/** Transpose a 4x4 matrix. 1.488 + * @param mat Pointer to the matrix to be transposed 1.489 + */ 1.490 +ASSIMP_API void aiTransposeMatrix4( 1.491 + C_STRUCT aiMatrix4x4* mat); 1.492 + 1.493 +// -------------------------------------------------------------------------------- 1.494 +/** Transpose a 3x3 matrix. 1.495 + * @param mat Pointer to the matrix to be transposed 1.496 + */ 1.497 +ASSIMP_API void aiTransposeMatrix3( 1.498 + C_STRUCT aiMatrix3x3* mat); 1.499 + 1.500 +// -------------------------------------------------------------------------------- 1.501 +/** Transform a vector by a 3x3 matrix 1.502 + * @param vec Vector to be transformed. 1.503 + * @param mat Matrix to transform the vector with. 1.504 + */ 1.505 +ASSIMP_API void aiTransformVecByMatrix3( 1.506 + C_STRUCT aiVector3D* vec, 1.507 + const C_STRUCT aiMatrix3x3* mat); 1.508 + 1.509 +// -------------------------------------------------------------------------------- 1.510 +/** Transform a vector by a 4x4 matrix 1.511 + * @param vec Vector to be transformed. 1.512 + * @param mat Matrix to transform the vector with. 1.513 + */ 1.514 +ASSIMP_API void aiTransformVecByMatrix4( 1.515 + C_STRUCT aiVector3D* vec, 1.516 + const C_STRUCT aiMatrix4x4* mat); 1.517 + 1.518 +// -------------------------------------------------------------------------------- 1.519 +/** Multiply two 4x4 matrices. 1.520 + * @param dst First factor, receives result. 1.521 + * @param src Matrix to be multiplied with 'dst'. 1.522 + */ 1.523 +ASSIMP_API void aiMultiplyMatrix4( 1.524 + C_STRUCT aiMatrix4x4* dst, 1.525 + const C_STRUCT aiMatrix4x4* src); 1.526 + 1.527 +// -------------------------------------------------------------------------------- 1.528 +/** Multiply two 3x3 matrices. 1.529 + * @param dst First factor, receives result. 1.530 + * @param src Matrix to be multiplied with 'dst'. 1.531 + */ 1.532 +ASSIMP_API void aiMultiplyMatrix3( 1.533 + C_STRUCT aiMatrix3x3* dst, 1.534 + const C_STRUCT aiMatrix3x3* src); 1.535 + 1.536 +// -------------------------------------------------------------------------------- 1.537 +/** Get a 3x3 identity matrix. 1.538 + * @param mat Matrix to receive its personal identity 1.539 + */ 1.540 +ASSIMP_API void aiIdentityMatrix3( 1.541 + C_STRUCT aiMatrix3x3* mat); 1.542 + 1.543 +// -------------------------------------------------------------------------------- 1.544 +/** Get a 4x4 identity matrix. 1.545 + * @param mat Matrix to receive its personal identity 1.546 + */ 1.547 +ASSIMP_API void aiIdentityMatrix4( 1.548 + C_STRUCT aiMatrix4x4* mat); 1.549 + 1.550 +// -------------------------------------------------------------------------------- 1.551 +/** Returns the number of import file formats available in the current Assimp build. 1.552 + * Use aiGetImportFormatDescription() to retrieve infos of a specific import format. 1.553 + */ 1.554 +ASSIMP_API size_t aiGetImportFormatCount(void); 1.555 + 1.556 +// -------------------------------------------------------------------------------- 1.557 +/** Returns a description of the nth import file format. Use #aiGetImportFormatCount() 1.558 + * to learn how many import formats are supported. 1.559 + * @param pIndex Index of the import format to retrieve information for. Valid range is 1.560 + * 0 to #aiGetImportFormatCount() 1.561 + * @return A description of that specific import format. NULL if pIndex is out of range. 1.562 + */ 1.563 +ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex); 1.564 +#ifdef __cplusplus 1.565 +} 1.566 +#endif 1.567 + 1.568 +#endif // AI_ASSIMP_H_INC