nuclear@0: /* nuclear@0: --------------------------------------------------------------------------- nuclear@0: Open Asset Import Library (assimp) nuclear@0: --------------------------------------------------------------------------- nuclear@0: nuclear@0: Copyright (c) 2006-2018, assimp team nuclear@0: nuclear@0: nuclear@0: nuclear@0: All rights reserved. nuclear@0: nuclear@0: Redistribution and use of this software in source and binary forms, nuclear@0: with or without modification, are permitted provided that the following nuclear@0: conditions are met: nuclear@0: nuclear@0: * Redistributions of source code must retain the above nuclear@0: copyright notice, this list of conditions and the nuclear@0: following disclaimer. nuclear@0: nuclear@0: * Redistributions in binary form must reproduce the above nuclear@0: copyright notice, this list of conditions and the nuclear@0: following disclaimer in the documentation and/or other nuclear@0: materials provided with the distribution. nuclear@0: nuclear@0: * Neither the name of the assimp team, nor the names of its nuclear@0: contributors may be used to endorse or promote products nuclear@0: derived from this software without specific prior nuclear@0: written permission of the assimp team. nuclear@0: nuclear@0: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS nuclear@0: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT nuclear@0: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR nuclear@0: A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT nuclear@0: OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, nuclear@0: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT nuclear@0: LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, nuclear@0: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY nuclear@0: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT nuclear@0: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE nuclear@0: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. nuclear@0: --------------------------------------------------------------------------- nuclear@0: */ nuclear@0: nuclear@0: /** @file cimport.h nuclear@0: * @brief Defines the C-API to the Open Asset Import Library. nuclear@0: */ nuclear@0: #pragma once nuclear@0: #ifndef AI_ASSIMP_H_INC nuclear@0: #define AI_ASSIMP_H_INC nuclear@0: nuclear@0: #include nuclear@0: #include "importerdesc.h" nuclear@0: nuclear@0: #ifdef __cplusplus nuclear@0: extern "C" { nuclear@0: #endif nuclear@0: nuclear@0: struct aiScene; // aiScene.h nuclear@0: struct aiFileIO; // aiFileIO.h nuclear@0: typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** C-API: Represents a log stream. A log stream receives all log messages and nuclear@0: * streams them _somewhere_. nuclear@0: * @see aiGetPredefinedLogStream nuclear@0: * @see aiAttachLogStream nuclear@0: * @see aiDetachLogStream */ nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: struct aiLogStream nuclear@0: { nuclear@0: /** callback to be called */ nuclear@0: aiLogStreamCallback callback; nuclear@0: nuclear@0: /** user data to be passed to the callback */ nuclear@0: char* user; nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** C-API: Represents an opaque set of settings to be used during importing. nuclear@0: * @see aiCreatePropertyStore nuclear@0: * @see aiReleasePropertyStore nuclear@0: * @see aiImportFileExWithProperties nuclear@0: * @see aiSetPropertyInteger nuclear@0: * @see aiSetPropertyFloat nuclear@0: * @see aiSetPropertyString nuclear@0: * @see aiSetPropertyMatrix nuclear@0: */ nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: struct aiPropertyStore { char sentinel; }; nuclear@0: nuclear@0: /** Our own C boolean type */ nuclear@0: typedef int aiBool; nuclear@0: nuclear@0: #define AI_FALSE 0 nuclear@0: #define AI_TRUE 1 nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Reads the given file and returns its content. nuclear@0: * nuclear@0: * If the call succeeds, the imported data is returned in an aiScene structure. nuclear@0: * The data is intended to be read-only, it stays property of the ASSIMP nuclear@0: * library and will be stable until aiReleaseImport() is called. After you're nuclear@0: * done with it, call aiReleaseImport() to free the resources associated with nuclear@0: * this file. If the import fails, NULL is returned instead. Call nuclear@0: * aiGetErrorString() to retrieve a human-readable error text. nuclear@0: * @param pFile Path and filename of the file to be imported, nuclear@0: * expected to be a null-terminated c-string. NULL is not a valid value. nuclear@0: * @param pFlags Optional post processing steps to be executed after nuclear@0: * a successful import. Provide a bitwise combination of the nuclear@0: * #aiPostProcessSteps flags. nuclear@0: * @return Pointer to the imported data or NULL if the import failed. nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiImportFile( nuclear@0: const char* pFile, nuclear@0: unsigned int pFlags); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Reads the given file using user-defined I/O functions and returns nuclear@0: * its content. nuclear@0: * nuclear@0: * If the call succeeds, the imported data is returned in an aiScene structure. nuclear@0: * The data is intended to be read-only, it stays property of the ASSIMP nuclear@0: * library and will be stable until aiReleaseImport() is called. After you're nuclear@0: * done with it, call aiReleaseImport() to free the resources associated with nuclear@0: * this file. If the import fails, NULL is returned instead. Call nuclear@0: * aiGetErrorString() to retrieve a human-readable error text. nuclear@0: * @param pFile Path and filename of the file to be imported, nuclear@0: * expected to be a null-terminated c-string. NULL is not a valid value. nuclear@0: * @param pFlags Optional post processing steps to be executed after nuclear@0: * a successful import. Provide a bitwise combination of the nuclear@0: * #aiPostProcessSteps flags. nuclear@0: * @param pFS aiFileIO structure. Will be used to open the model file itself nuclear@0: * and any other files the loader needs to open. Pass NULL to use the default nuclear@0: * implementation. nuclear@0: * @return Pointer to the imported data or NULL if the import failed. nuclear@0: * @note Include for the definition of #aiFileIO. nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiImportFileEx( nuclear@0: const char* pFile, nuclear@0: unsigned int pFlags, nuclear@0: C_STRUCT aiFileIO* pFS); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Same as #aiImportFileEx, but adds an extra parameter containing importer settings. nuclear@0: * nuclear@0: * @param pFile Path and filename of the file to be imported, nuclear@0: * expected to be a null-terminated c-string. NULL is not a valid value. nuclear@0: * @param pFlags Optional post processing steps to be executed after nuclear@0: * a successful import. Provide a bitwise combination of the nuclear@0: * #aiPostProcessSteps flags. nuclear@0: * @param pFS aiFileIO structure. Will be used to open the model file itself nuclear@0: * and any other files the loader needs to open. Pass NULL to use the default nuclear@0: * implementation. nuclear@0: * @param pProps #aiPropertyStore instance containing import settings. nuclear@0: * @return Pointer to the imported data or NULL if the import failed. nuclear@0: * @note Include for the definition of #aiFileIO. nuclear@0: * @see aiImportFileEx nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties( nuclear@0: const char* pFile, nuclear@0: unsigned int pFlags, nuclear@0: C_STRUCT aiFileIO* pFS, nuclear@0: const C_STRUCT aiPropertyStore* pProps); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Reads the given file from a given memory buffer, nuclear@0: * nuclear@0: * If the call succeeds, the contents of the file are returned as a pointer to an nuclear@0: * aiScene object. The returned data is intended to be read-only, the importer keeps nuclear@0: * ownership of the data and will destroy it upon destruction. If the import fails, nuclear@0: * NULL is returned. nuclear@0: * A human-readable error description can be retrieved by calling aiGetErrorString(). nuclear@0: * @param pBuffer Pointer to the file data nuclear@0: * @param pLength Length of pBuffer, in bytes nuclear@0: * @param pFlags Optional post processing steps to be executed after nuclear@0: * a successful import. Provide a bitwise combination of the nuclear@0: * #aiPostProcessSteps flags. If you wish to inspect the imported nuclear@0: * scene first in order to fine-tune your post-processing setup, nuclear@0: * consider to use #aiApplyPostProcessing(). nuclear@0: * @param pHint An additional hint to the library. If this is a non empty string, nuclear@0: * the library looks for a loader to support the file extension specified by pHint nuclear@0: * and passes the file to the first matching loader. If this loader is unable to nuclear@0: * completely the request, the library continues and tries to determine the file nuclear@0: * format on its own, a task that may or may not be successful. nuclear@0: * Check the return value, and you'll know ... nuclear@0: * @return A pointer to the imported data, NULL if the import failed. nuclear@0: * nuclear@0: * @note This is a straightforward way to decode models from memory nuclear@0: * buffers, but it doesn't handle model formats that spread their nuclear@0: * data across multiple files or even directories. Examples include nuclear@0: * OBJ or MD3, which outsource parts of their material info into nuclear@0: * external scripts. If you need full functionality, provide nuclear@0: * a custom IOSystem to make Assimp find these files and use nuclear@0: * the regular aiImportFileEx()/aiImportFileExWithProperties() API. nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory( nuclear@0: const char* pBuffer, nuclear@0: unsigned int pLength, nuclear@0: unsigned int pFlags, nuclear@0: const char* pHint); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings. nuclear@0: * nuclear@0: * @param pBuffer Pointer to the file data nuclear@0: * @param pLength Length of pBuffer, in bytes nuclear@0: * @param pFlags Optional post processing steps to be executed after nuclear@0: * a successful import. Provide a bitwise combination of the nuclear@0: * #aiPostProcessSteps flags. If you wish to inspect the imported nuclear@0: * scene first in order to fine-tune your post-processing setup, nuclear@0: * consider to use #aiApplyPostProcessing(). nuclear@0: * @param pHint An additional hint to the library. If this is a non empty string, nuclear@0: * the library looks for a loader to support the file extension specified by pHint nuclear@0: * and passes the file to the first matching loader. If this loader is unable to nuclear@0: * completely the request, the library continues and tries to determine the file nuclear@0: * format on its own, a task that may or may not be successful. nuclear@0: * Check the return value, and you'll know ... nuclear@0: * @param pProps #aiPropertyStore instance containing import settings. nuclear@0: * @return A pointer to the imported data, NULL if the import failed. nuclear@0: * nuclear@0: * @note This is a straightforward way to decode models from memory nuclear@0: * buffers, but it doesn't handle model formats that spread their nuclear@0: * data across multiple files or even directories. Examples include nuclear@0: * OBJ or MD3, which outsource parts of their material info into nuclear@0: * external scripts. If you need full functionality, provide nuclear@0: * a custom IOSystem to make Assimp find these files and use nuclear@0: * the regular aiImportFileEx()/aiImportFileExWithProperties() API. nuclear@0: * @see aiImportFileFromMemory nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties( nuclear@0: const char* pBuffer, nuclear@0: unsigned int pLength, nuclear@0: unsigned int pFlags, nuclear@0: const char* pHint, nuclear@0: const C_STRUCT aiPropertyStore* pProps); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Apply post-processing to an already-imported scene. nuclear@0: * nuclear@0: * This is strictly equivalent to calling #aiImportFile()/#aiImportFileEx with the nuclear@0: * same flags. However, you can use this separate function to inspect the imported nuclear@0: * scene first to fine-tune your post-processing setup. nuclear@0: * @param pScene Scene to work on. nuclear@0: * @param pFlags Provide a bitwise combination of the #aiPostProcessSteps flags. nuclear@0: * @return A pointer to the post-processed data. Post processing is done in-place, nuclear@0: * meaning this is still the same #aiScene which you passed for pScene. However, nuclear@0: * _if_ post-processing failed, the scene could now be NULL. That's quite a rare nuclear@0: * case, post processing steps are not really designed to 'fail'. To be exact, nuclear@0: * the #aiProcess_ValidateDataStructure flag is currently the only post processing step nuclear@0: * which can actually cause the scene to be reset to NULL. nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing( nuclear@0: const C_STRUCT aiScene* pScene, nuclear@0: unsigned int pFlags); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Get one of the predefine log streams. This is the quick'n'easy solution to nuclear@0: * access Assimp's log system. Attaching a log stream can slightly reduce Assimp's nuclear@0: * overall import performance. nuclear@0: * nuclear@0: * Usage is rather simple (this will stream the log to a file, named log.txt, and nuclear@0: * the stdout stream of the process: nuclear@0: * @code nuclear@0: * struct aiLogStream c; nuclear@0: * c = aiGetPredefinedLogStream(aiDefaultLogStream_FILE,"log.txt"); nuclear@0: * aiAttachLogStream(&c); nuclear@0: * c = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL); nuclear@0: * aiAttachLogStream(&c); nuclear@0: * @endcode nuclear@0: * nuclear@0: * @param pStreams One of the #aiDefaultLogStream enumerated values. nuclear@0: * @param file Solely for the #aiDefaultLogStream_FILE flag: specifies the file to write to. nuclear@0: * Pass NULL for all other flags. nuclear@0: * @return The log stream. callback is set to NULL if something went wrong. nuclear@0: */ nuclear@0: ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream( nuclear@0: C_ENUM aiDefaultLogStream pStreams, nuclear@0: const char* file); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Attach a custom log stream to the libraries' logging system. nuclear@0: * nuclear@0: * Attaching a log stream can slightly reduce Assimp's overall import nuclear@0: * performance. Multiple log-streams can be attached. nuclear@0: * @param stream Describes the new log stream. nuclear@0: * @note To ensure proper destruction of the logging system, you need to manually nuclear@0: * call aiDetachLogStream() on every single log stream you attach. nuclear@0: * Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided. nuclear@0: */ nuclear@0: ASSIMP_API void aiAttachLogStream( nuclear@0: const C_STRUCT aiLogStream* stream); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Enable verbose logging. Verbose logging includes debug-related stuff and nuclear@0: * detailed import statistics. This can have severe impact on import performance nuclear@0: * and memory consumption. However, it might be useful to find out why a file nuclear@0: * didn't read correctly. nuclear@0: * @param d AI_TRUE or AI_FALSE, your decision. nuclear@0: */ nuclear@0: ASSIMP_API void aiEnableVerboseLogging(aiBool d); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Detach a custom log stream from the libraries' logging system. nuclear@0: * nuclear@0: * This is the counterpart of #aiAttachLogStream. If you attached a stream, nuclear@0: * don't forget to detach it again. nuclear@0: * @param stream The log stream to be detached. nuclear@0: * @return AI_SUCCESS if the log stream has been detached successfully. nuclear@0: * @see aiDetachAllLogStreams nuclear@0: */ nuclear@0: ASSIMP_API C_ENUM aiReturn aiDetachLogStream( nuclear@0: const C_STRUCT aiLogStream* stream); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Detach all active log streams from the libraries' logging system. nuclear@0: * This ensures that the logging system is terminated properly and all nuclear@0: * resources allocated by it are actually freed. If you attached a stream, nuclear@0: * don't forget to detach it again. nuclear@0: * @see aiAttachLogStream nuclear@0: * @see aiDetachLogStream nuclear@0: */ nuclear@0: ASSIMP_API void aiDetachAllLogStreams(void); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Releases all resources associated with the given import process. nuclear@0: * nuclear@0: * Call this function after you're done with the imported data. nuclear@0: * @param pScene The imported data to release. NULL is a valid value. nuclear@0: */ nuclear@0: ASSIMP_API void aiReleaseImport( nuclear@0: const C_STRUCT aiScene* pScene); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Returns the error text of the last failed import process. nuclear@0: * nuclear@0: * @return A textual description of the error that occurred at the last nuclear@0: * import process. NULL if there was no error. There can't be an error if you nuclear@0: * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing. nuclear@0: */ nuclear@0: ASSIMP_API const char* aiGetErrorString(void); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Returns whether a given file extension is supported by ASSIMP nuclear@0: * nuclear@0: * @param szExtension Extension for which the function queries support for. nuclear@0: * Must include a leading dot '.'. Example: ".3ds", ".md3" nuclear@0: * @return AI_TRUE if the file extension is supported. nuclear@0: */ nuclear@0: ASSIMP_API aiBool aiIsExtensionSupported( nuclear@0: const char* szExtension); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Get a list of all file extensions supported by ASSIMP. nuclear@0: * nuclear@0: * If a file extension is contained in the list this does, of course, not nuclear@0: * mean that ASSIMP is able to load all files with this extension. nuclear@0: * @param szOut String to receive the extension list. nuclear@0: * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter. nuclear@0: */ nuclear@0: ASSIMP_API void aiGetExtensionList( nuclear@0: C_STRUCT aiString* szOut); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Get the approximated storage required by an imported asset nuclear@0: * @param pIn Input asset. nuclear@0: * @param in Data structure to be filled. nuclear@0: */ nuclear@0: ASSIMP_API void aiGetMemoryRequirements( nuclear@0: const C_STRUCT aiScene* pIn, nuclear@0: C_STRUCT aiMemoryInfo* in); nuclear@0: nuclear@0: nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Create an empty property store. Property stores are used to collect import nuclear@0: * settings. nuclear@0: * @return New property store. Property stores need to be manually destroyed using nuclear@0: * the #aiReleasePropertyStore API function. nuclear@0: */ nuclear@0: ASSIMP_API C_STRUCT aiPropertyStore* aiCreatePropertyStore(void); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Delete a property store. nuclear@0: * @param p Property store to be deleted. nuclear@0: */ nuclear@0: ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Set an integer property. nuclear@0: * nuclear@0: * This is the C-version of #Assimp::Importer::SetPropertyInteger(). In the C nuclear@0: * interface, properties are always shared by all imports. It is not possible to nuclear@0: * specify them per import. nuclear@0: * nuclear@0: * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. nuclear@0: * @param szName Name of the configuration property to be set. All supported nuclear@0: * public properties are defined in the config.h header file (AI_CONFIG_XXX). nuclear@0: * @param value New value for the property nuclear@0: */ nuclear@0: ASSIMP_API void aiSetImportPropertyInteger( nuclear@0: C_STRUCT aiPropertyStore* store, nuclear@0: const char* szName, nuclear@0: int value); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Set a floating-point property. nuclear@0: * nuclear@0: * This is the C-version of #Assimp::Importer::SetPropertyFloat(). In the C nuclear@0: * interface, properties are always shared by all imports. It is not possible to nuclear@0: * specify them per import. nuclear@0: * nuclear@0: * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. nuclear@0: * @param szName Name of the configuration property to be set. All supported nuclear@0: * public properties are defined in the config.h header file (AI_CONFIG_XXX). nuclear@0: * @param value New value for the property nuclear@0: */ nuclear@0: ASSIMP_API void aiSetImportPropertyFloat( nuclear@0: C_STRUCT aiPropertyStore* store, nuclear@0: const char* szName, nuclear@0: ai_real value); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Set a string property. nuclear@0: * nuclear@0: * This is the C-version of #Assimp::Importer::SetPropertyString(). In the C nuclear@0: * interface, properties are always shared by all imports. It is not possible to nuclear@0: * specify them per import. nuclear@0: * nuclear@0: * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. nuclear@0: * @param szName Name of the configuration property to be set. All supported nuclear@0: * public properties are defined in the config.h header file (AI_CONFIG_XXX). nuclear@0: * @param st New value for the property nuclear@0: */ nuclear@0: ASSIMP_API void aiSetImportPropertyString( nuclear@0: C_STRUCT aiPropertyStore* store, nuclear@0: const char* szName, nuclear@0: const C_STRUCT aiString* st); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Set a matrix property. nuclear@0: * nuclear@0: * This is the C-version of #Assimp::Importer::SetPropertyMatrix(). In the C nuclear@0: * interface, properties are always shared by all imports. It is not possible to nuclear@0: * specify them per import. nuclear@0: * nuclear@0: * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store. nuclear@0: * @param szName Name of the configuration property to be set. All supported nuclear@0: * public properties are defined in the config.h header file (AI_CONFIG_XXX). nuclear@0: * @param mat New value for the property nuclear@0: */ nuclear@0: ASSIMP_API void aiSetImportPropertyMatrix( nuclear@0: C_STRUCT aiPropertyStore* store, nuclear@0: const char* szName, nuclear@0: const C_STRUCT aiMatrix4x4* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Construct a quaternion from a 3x3 rotation matrix. nuclear@0: * @param quat Receives the output quaternion. nuclear@0: * @param mat Matrix to 'quaternionize'. nuclear@0: * @see aiQuaternion(const aiMatrix3x3& pRotMatrix) nuclear@0: */ nuclear@0: ASSIMP_API void aiCreateQuaternionFromMatrix( nuclear@0: C_STRUCT aiQuaternion* quat, nuclear@0: const C_STRUCT aiMatrix3x3* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Decompose a transformation matrix into its rotational, translational and nuclear@0: * scaling components. nuclear@0: * nuclear@0: * @param mat Matrix to decompose nuclear@0: * @param scaling Receives the scaling component nuclear@0: * @param rotation Receives the rotational component nuclear@0: * @param position Receives the translational component. nuclear@0: * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const; nuclear@0: */ nuclear@0: ASSIMP_API void aiDecomposeMatrix( nuclear@0: const C_STRUCT aiMatrix4x4* mat, nuclear@0: C_STRUCT aiVector3D* scaling, nuclear@0: C_STRUCT aiQuaternion* rotation, nuclear@0: C_STRUCT aiVector3D* position); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Transpose a 4x4 matrix. nuclear@0: * @param mat Pointer to the matrix to be transposed nuclear@0: */ nuclear@0: ASSIMP_API void aiTransposeMatrix4( nuclear@0: C_STRUCT aiMatrix4x4* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Transpose a 3x3 matrix. nuclear@0: * @param mat Pointer to the matrix to be transposed nuclear@0: */ nuclear@0: ASSIMP_API void aiTransposeMatrix3( nuclear@0: C_STRUCT aiMatrix3x3* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Transform a vector by a 3x3 matrix nuclear@0: * @param vec Vector to be transformed. nuclear@0: * @param mat Matrix to transform the vector with. nuclear@0: */ nuclear@0: ASSIMP_API void aiTransformVecByMatrix3( nuclear@0: C_STRUCT aiVector3D* vec, nuclear@0: const C_STRUCT aiMatrix3x3* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Transform a vector by a 4x4 matrix nuclear@0: * @param vec Vector to be transformed. nuclear@0: * @param mat Matrix to transform the vector with. nuclear@0: */ nuclear@0: ASSIMP_API void aiTransformVecByMatrix4( nuclear@0: C_STRUCT aiVector3D* vec, nuclear@0: const C_STRUCT aiMatrix4x4* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Multiply two 4x4 matrices. nuclear@0: * @param dst First factor, receives result. nuclear@0: * @param src Matrix to be multiplied with 'dst'. nuclear@0: */ nuclear@0: ASSIMP_API void aiMultiplyMatrix4( nuclear@0: C_STRUCT aiMatrix4x4* dst, nuclear@0: const C_STRUCT aiMatrix4x4* src); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Multiply two 3x3 matrices. nuclear@0: * @param dst First factor, receives result. nuclear@0: * @param src Matrix to be multiplied with 'dst'. nuclear@0: */ nuclear@0: ASSIMP_API void aiMultiplyMatrix3( nuclear@0: C_STRUCT aiMatrix3x3* dst, nuclear@0: const C_STRUCT aiMatrix3x3* src); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Get a 3x3 identity matrix. nuclear@0: * @param mat Matrix to receive its personal identity nuclear@0: */ nuclear@0: ASSIMP_API void aiIdentityMatrix3( nuclear@0: C_STRUCT aiMatrix3x3* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Get a 4x4 identity matrix. nuclear@0: * @param mat Matrix to receive its personal identity nuclear@0: */ nuclear@0: ASSIMP_API void aiIdentityMatrix4( nuclear@0: C_STRUCT aiMatrix4x4* mat); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Returns the number of import file formats available in the current Assimp build. nuclear@0: * Use aiGetImportFormatDescription() to retrieve infos of a specific import format. nuclear@0: */ nuclear@0: ASSIMP_API size_t aiGetImportFormatCount(void); nuclear@0: nuclear@0: // -------------------------------------------------------------------------------- nuclear@0: /** Returns a description of the nth import file format. Use #aiGetImportFormatCount() nuclear@0: * to learn how many import formats are supported. nuclear@0: * @param pIndex Index of the import format to retrieve information for. Valid range is nuclear@0: * 0 to #aiGetImportFormatCount() nuclear@0: * @return A description of that specific import format. NULL if pIndex is out of range. nuclear@0: */ nuclear@0: ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex); nuclear@0: #ifdef __cplusplus nuclear@0: } nuclear@0: #endif nuclear@0: nuclear@0: #endif // AI_ASSIMP_H_INC