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