rev |
line source |
nuclear@0
|
1 /*
|
nuclear@0
|
2 ---------------------------------------------------------------------------
|
nuclear@0
|
3 Open Asset Import Library (assimp)
|
nuclear@0
|
4 ---------------------------------------------------------------------------
|
nuclear@0
|
5
|
nuclear@0
|
6 Copyright (c) 2006-2018, assimp team
|
nuclear@0
|
7
|
nuclear@0
|
8
|
nuclear@0
|
9
|
nuclear@0
|
10 All rights reserved.
|
nuclear@0
|
11
|
nuclear@0
|
12 Redistribution and use of this software in source and binary forms,
|
nuclear@0
|
13 with or without modification, are permitted provided that the following
|
nuclear@0
|
14 conditions are met:
|
nuclear@0
|
15
|
nuclear@0
|
16 * Redistributions of source code must retain the above
|
nuclear@0
|
17 copyright notice, this list of conditions and the
|
nuclear@0
|
18 following disclaimer.
|
nuclear@0
|
19
|
nuclear@0
|
20 * Redistributions in binary form must reproduce the above
|
nuclear@0
|
21 copyright notice, this list of conditions and the
|
nuclear@0
|
22 following disclaimer in the documentation and/or other
|
nuclear@0
|
23 materials provided with the distribution.
|
nuclear@0
|
24
|
nuclear@0
|
25 * Neither the name of the assimp team, nor the names of its
|
nuclear@0
|
26 contributors may be used to endorse or promote products
|
nuclear@0
|
27 derived from this software without specific prior
|
nuclear@0
|
28 written permission of the assimp team.
|
nuclear@0
|
29
|
nuclear@0
|
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
nuclear@0
|
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
nuclear@0
|
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
nuclear@0
|
33 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
nuclear@0
|
34 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
nuclear@0
|
35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
nuclear@0
|
36 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
nuclear@0
|
37 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
nuclear@0
|
38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
nuclear@0
|
39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
nuclear@0
|
40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
nuclear@0
|
41 ---------------------------------------------------------------------------
|
nuclear@0
|
42 */
|
nuclear@0
|
43
|
nuclear@0
|
44 /** @file cimport.h
|
nuclear@0
|
45 * @brief Defines the C-API to the Open Asset Import Library.
|
nuclear@0
|
46 */
|
nuclear@0
|
47 #pragma once
|
nuclear@0
|
48 #ifndef AI_ASSIMP_H_INC
|
nuclear@0
|
49 #define AI_ASSIMP_H_INC
|
nuclear@0
|
50
|
nuclear@0
|
51 #include <miniassimp/types.h>
|
nuclear@0
|
52 #include "importerdesc.h"
|
nuclear@0
|
53
|
nuclear@0
|
54 #ifdef __cplusplus
|
nuclear@0
|
55 extern "C" {
|
nuclear@0
|
56 #endif
|
nuclear@0
|
57
|
nuclear@0
|
58 struct aiScene; // aiScene.h
|
nuclear@0
|
59 struct aiFileIO; // aiFileIO.h
|
nuclear@0
|
60 typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */);
|
nuclear@0
|
61
|
nuclear@0
|
62 // --------------------------------------------------------------------------------
|
nuclear@0
|
63 /** C-API: Represents a log stream. A log stream receives all log messages and
|
nuclear@0
|
64 * streams them _somewhere_.
|
nuclear@0
|
65 * @see aiGetPredefinedLogStream
|
nuclear@0
|
66 * @see aiAttachLogStream
|
nuclear@0
|
67 * @see aiDetachLogStream */
|
nuclear@0
|
68 // --------------------------------------------------------------------------------
|
nuclear@0
|
69 struct aiLogStream
|
nuclear@0
|
70 {
|
nuclear@0
|
71 /** callback to be called */
|
nuclear@0
|
72 aiLogStreamCallback callback;
|
nuclear@0
|
73
|
nuclear@0
|
74 /** user data to be passed to the callback */
|
nuclear@0
|
75 char* user;
|
nuclear@0
|
76 };
|
nuclear@0
|
77
|
nuclear@0
|
78
|
nuclear@0
|
79 // --------------------------------------------------------------------------------
|
nuclear@0
|
80 /** C-API: Represents an opaque set of settings to be used during importing.
|
nuclear@0
|
81 * @see aiCreatePropertyStore
|
nuclear@0
|
82 * @see aiReleasePropertyStore
|
nuclear@0
|
83 * @see aiImportFileExWithProperties
|
nuclear@0
|
84 * @see aiSetPropertyInteger
|
nuclear@0
|
85 * @see aiSetPropertyFloat
|
nuclear@0
|
86 * @see aiSetPropertyString
|
nuclear@0
|
87 * @see aiSetPropertyMatrix
|
nuclear@0
|
88 */
|
nuclear@0
|
89 // --------------------------------------------------------------------------------
|
nuclear@0
|
90 struct aiPropertyStore { char sentinel; };
|
nuclear@0
|
91
|
nuclear@0
|
92 /** Our own C boolean type */
|
nuclear@0
|
93 typedef int aiBool;
|
nuclear@0
|
94
|
nuclear@0
|
95 #define AI_FALSE 0
|
nuclear@0
|
96 #define AI_TRUE 1
|
nuclear@0
|
97
|
nuclear@0
|
98 // --------------------------------------------------------------------------------
|
nuclear@0
|
99 /** Reads the given file and returns its content.
|
nuclear@0
|
100 *
|
nuclear@0
|
101 * If the call succeeds, the imported data is returned in an aiScene structure.
|
nuclear@0
|
102 * The data is intended to be read-only, it stays property of the ASSIMP
|
nuclear@0
|
103 * library and will be stable until aiReleaseImport() is called. After you're
|
nuclear@0
|
104 * done with it, call aiReleaseImport() to free the resources associated with
|
nuclear@0
|
105 * this file. If the import fails, NULL is returned instead. Call
|
nuclear@0
|
106 * aiGetErrorString() to retrieve a human-readable error text.
|
nuclear@0
|
107 * @param pFile Path and filename of the file to be imported,
|
nuclear@0
|
108 * expected to be a null-terminated c-string. NULL is not a valid value.
|
nuclear@0
|
109 * @param pFlags Optional post processing steps to be executed after
|
nuclear@0
|
110 * a successful import. Provide a bitwise combination of the
|
nuclear@0
|
111 * #aiPostProcessSteps flags.
|
nuclear@0
|
112 * @return Pointer to the imported data or NULL if the import failed.
|
nuclear@0
|
113 */
|
nuclear@0
|
114 ASSIMP_API const C_STRUCT aiScene* aiImportFile(
|
nuclear@0
|
115 const char* pFile,
|
nuclear@0
|
116 unsigned int pFlags);
|
nuclear@0
|
117
|
nuclear@0
|
118 // --------------------------------------------------------------------------------
|
nuclear@0
|
119 /** Reads the given file using user-defined I/O functions and returns
|
nuclear@0
|
120 * its content.
|
nuclear@0
|
121 *
|
nuclear@0
|
122 * If the call succeeds, the imported data is returned in an aiScene structure.
|
nuclear@0
|
123 * The data is intended to be read-only, it stays property of the ASSIMP
|
nuclear@0
|
124 * library and will be stable until aiReleaseImport() is called. After you're
|
nuclear@0
|
125 * done with it, call aiReleaseImport() to free the resources associated with
|
nuclear@0
|
126 * this file. If the import fails, NULL is returned instead. Call
|
nuclear@0
|
127 * aiGetErrorString() to retrieve a human-readable error text.
|
nuclear@0
|
128 * @param pFile Path and filename of the file to be imported,
|
nuclear@0
|
129 * expected to be a null-terminated c-string. NULL is not a valid value.
|
nuclear@0
|
130 * @param pFlags Optional post processing steps to be executed after
|
nuclear@0
|
131 * a successful import. Provide a bitwise combination of the
|
nuclear@0
|
132 * #aiPostProcessSteps flags.
|
nuclear@0
|
133 * @param pFS aiFileIO structure. Will be used to open the model file itself
|
nuclear@0
|
134 * and any other files the loader needs to open. Pass NULL to use the default
|
nuclear@0
|
135 * implementation.
|
nuclear@0
|
136 * @return Pointer to the imported data or NULL if the import failed.
|
nuclear@0
|
137 * @note Include <aiFileIO.h> for the definition of #aiFileIO.
|
nuclear@0
|
138 */
|
nuclear@0
|
139 ASSIMP_API const C_STRUCT aiScene* aiImportFileEx(
|
nuclear@0
|
140 const char* pFile,
|
nuclear@0
|
141 unsigned int pFlags,
|
nuclear@0
|
142 C_STRUCT aiFileIO* pFS);
|
nuclear@0
|
143
|
nuclear@0
|
144 // --------------------------------------------------------------------------------
|
nuclear@0
|
145 /** Same as #aiImportFileEx, but adds an extra parameter containing importer settings.
|
nuclear@0
|
146 *
|
nuclear@0
|
147 * @param pFile Path and filename of the file to be imported,
|
nuclear@0
|
148 * expected to be a null-terminated c-string. NULL is not a valid value.
|
nuclear@0
|
149 * @param pFlags Optional post processing steps to be executed after
|
nuclear@0
|
150 * a successful import. Provide a bitwise combination of the
|
nuclear@0
|
151 * #aiPostProcessSteps flags.
|
nuclear@0
|
152 * @param pFS aiFileIO structure. Will be used to open the model file itself
|
nuclear@0
|
153 * and any other files the loader needs to open. Pass NULL to use the default
|
nuclear@0
|
154 * implementation.
|
nuclear@0
|
155 * @param pProps #aiPropertyStore instance containing import settings.
|
nuclear@0
|
156 * @return Pointer to the imported data or NULL if the import failed.
|
nuclear@0
|
157 * @note Include <aiFileIO.h> for the definition of #aiFileIO.
|
nuclear@0
|
158 * @see aiImportFileEx
|
nuclear@0
|
159 */
|
nuclear@0
|
160 ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties(
|
nuclear@0
|
161 const char* pFile,
|
nuclear@0
|
162 unsigned int pFlags,
|
nuclear@0
|
163 C_STRUCT aiFileIO* pFS,
|
nuclear@0
|
164 const C_STRUCT aiPropertyStore* pProps);
|
nuclear@0
|
165
|
nuclear@0
|
166 // --------------------------------------------------------------------------------
|
nuclear@0
|
167 /** Reads the given file from a given memory buffer,
|
nuclear@0
|
168 *
|
nuclear@0
|
169 * If the call succeeds, the contents of the file are returned as a pointer to an
|
nuclear@0
|
170 * aiScene object. The returned data is intended to be read-only, the importer keeps
|
nuclear@0
|
171 * ownership of the data and will destroy it upon destruction. If the import fails,
|
nuclear@0
|
172 * NULL is returned.
|
nuclear@0
|
173 * A human-readable error description can be retrieved by calling aiGetErrorString().
|
nuclear@0
|
174 * @param pBuffer Pointer to the file data
|
nuclear@0
|
175 * @param pLength Length of pBuffer, in bytes
|
nuclear@0
|
176 * @param pFlags Optional post processing steps to be executed after
|
nuclear@0
|
177 * a successful import. Provide a bitwise combination of the
|
nuclear@0
|
178 * #aiPostProcessSteps flags. If you wish to inspect the imported
|
nuclear@0
|
179 * scene first in order to fine-tune your post-processing setup,
|
nuclear@0
|
180 * consider to use #aiApplyPostProcessing().
|
nuclear@0
|
181 * @param pHint An additional hint to the library. If this is a non empty string,
|
nuclear@0
|
182 * the library looks for a loader to support the file extension specified by pHint
|
nuclear@0
|
183 * and passes the file to the first matching loader. If this loader is unable to
|
nuclear@0
|
184 * completely the request, the library continues and tries to determine the file
|
nuclear@0
|
185 * format on its own, a task that may or may not be successful.
|
nuclear@0
|
186 * Check the return value, and you'll know ...
|
nuclear@0
|
187 * @return A pointer to the imported data, NULL if the import failed.
|
nuclear@0
|
188 *
|
nuclear@0
|
189 * @note This is a straightforward way to decode models from memory
|
nuclear@0
|
190 * buffers, but it doesn't handle model formats that spread their
|
nuclear@0
|
191 * data across multiple files or even directories. Examples include
|
nuclear@0
|
192 * OBJ or MD3, which outsource parts of their material info into
|
nuclear@0
|
193 * external scripts. If you need full functionality, provide
|
nuclear@0
|
194 * a custom IOSystem to make Assimp find these files and use
|
nuclear@0
|
195 * the regular aiImportFileEx()/aiImportFileExWithProperties() API.
|
nuclear@0
|
196 */
|
nuclear@0
|
197 ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory(
|
nuclear@0
|
198 const char* pBuffer,
|
nuclear@0
|
199 unsigned int pLength,
|
nuclear@0
|
200 unsigned int pFlags,
|
nuclear@0
|
201 const char* pHint);
|
nuclear@0
|
202
|
nuclear@0
|
203 // --------------------------------------------------------------------------------
|
nuclear@0
|
204 /** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings.
|
nuclear@0
|
205 *
|
nuclear@0
|
206 * @param pBuffer Pointer to the file data
|
nuclear@0
|
207 * @param pLength Length of pBuffer, in bytes
|
nuclear@0
|
208 * @param pFlags Optional post processing steps to be executed after
|
nuclear@0
|
209 * a successful import. Provide a bitwise combination of the
|
nuclear@0
|
210 * #aiPostProcessSteps flags. If you wish to inspect the imported
|
nuclear@0
|
211 * scene first in order to fine-tune your post-processing setup,
|
nuclear@0
|
212 * consider to use #aiApplyPostProcessing().
|
nuclear@0
|
213 * @param pHint An additional hint to the library. If this is a non empty string,
|
nuclear@0
|
214 * the library looks for a loader to support the file extension specified by pHint
|
nuclear@0
|
215 * and passes the file to the first matching loader. If this loader is unable to
|
nuclear@0
|
216 * completely the request, the library continues and tries to determine the file
|
nuclear@0
|
217 * format on its own, a task that may or may not be successful.
|
nuclear@0
|
218 * Check the return value, and you'll know ...
|
nuclear@0
|
219 * @param pProps #aiPropertyStore instance containing import settings.
|
nuclear@0
|
220 * @return A pointer to the imported data, NULL if the import failed.
|
nuclear@0
|
221 *
|
nuclear@0
|
222 * @note This is a straightforward way to decode models from memory
|
nuclear@0
|
223 * buffers, but it doesn't handle model formats that spread their
|
nuclear@0
|
224 * data across multiple files or even directories. Examples include
|
nuclear@0
|
225 * OBJ or MD3, which outsource parts of their material info into
|
nuclear@0
|
226 * external scripts. If you need full functionality, provide
|
nuclear@0
|
227 * a custom IOSystem to make Assimp find these files and use
|
nuclear@0
|
228 * the regular aiImportFileEx()/aiImportFileExWithProperties() API.
|
nuclear@0
|
229 * @see aiImportFileFromMemory
|
nuclear@0
|
230 */
|
nuclear@0
|
231 ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties(
|
nuclear@0
|
232 const char* pBuffer,
|
nuclear@0
|
233 unsigned int pLength,
|
nuclear@0
|
234 unsigned int pFlags,
|
nuclear@0
|
235 const char* pHint,
|
nuclear@0
|
236 const C_STRUCT aiPropertyStore* pProps);
|
nuclear@0
|
237
|
nuclear@0
|
238 // --------------------------------------------------------------------------------
|
nuclear@0
|
239 /** Apply post-processing to an already-imported scene.
|
nuclear@0
|
240 *
|
nuclear@0
|
241 * This is strictly equivalent to calling #aiImportFile()/#aiImportFileEx with the
|
nuclear@0
|
242 * same flags. However, you can use this separate function to inspect the imported
|
nuclear@0
|
243 * scene first to fine-tune your post-processing setup.
|
nuclear@0
|
244 * @param pScene Scene to work on.
|
nuclear@0
|
245 * @param pFlags Provide a bitwise combination of the #aiPostProcessSteps flags.
|
nuclear@0
|
246 * @return A pointer to the post-processed data. Post processing is done in-place,
|
nuclear@0
|
247 * meaning this is still the same #aiScene which you passed for pScene. However,
|
nuclear@0
|
248 * _if_ post-processing failed, the scene could now be NULL. That's quite a rare
|
nuclear@0
|
249 * case, post processing steps are not really designed to 'fail'. To be exact,
|
nuclear@0
|
250 * the #aiProcess_ValidateDataStructure flag is currently the only post processing step
|
nuclear@0
|
251 * which can actually cause the scene to be reset to NULL.
|
nuclear@0
|
252 */
|
nuclear@0
|
253 ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing(
|
nuclear@0
|
254 const C_STRUCT aiScene* pScene,
|
nuclear@0
|
255 unsigned int pFlags);
|
nuclear@0
|
256
|
nuclear@0
|
257 // --------------------------------------------------------------------------------
|
nuclear@0
|
258 /** Get one of the predefine log streams. This is the quick'n'easy solution to
|
nuclear@0
|
259 * access Assimp's log system. Attaching a log stream can slightly reduce Assimp's
|
nuclear@0
|
260 * overall import performance.
|
nuclear@0
|
261 *
|
nuclear@0
|
262 * Usage is rather simple (this will stream the log to a file, named log.txt, and
|
nuclear@0
|
263 * the stdout stream of the process:
|
nuclear@0
|
264 * @code
|
nuclear@0
|
265 * struct aiLogStream c;
|
nuclear@0
|
266 * c = aiGetPredefinedLogStream(aiDefaultLogStream_FILE,"log.txt");
|
nuclear@0
|
267 * aiAttachLogStream(&c);
|
nuclear@0
|
268 * c = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL);
|
nuclear@0
|
269 * aiAttachLogStream(&c);
|
nuclear@0
|
270 * @endcode
|
nuclear@0
|
271 *
|
nuclear@0
|
272 * @param pStreams One of the #aiDefaultLogStream enumerated values.
|
nuclear@0
|
273 * @param file Solely for the #aiDefaultLogStream_FILE flag: specifies the file to write to.
|
nuclear@0
|
274 * Pass NULL for all other flags.
|
nuclear@0
|
275 * @return The log stream. callback is set to NULL if something went wrong.
|
nuclear@0
|
276 */
|
nuclear@0
|
277 ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream(
|
nuclear@0
|
278 C_ENUM aiDefaultLogStream pStreams,
|
nuclear@0
|
279 const char* file);
|
nuclear@0
|
280
|
nuclear@0
|
281 // --------------------------------------------------------------------------------
|
nuclear@0
|
282 /** Attach a custom log stream to the libraries' logging system.
|
nuclear@0
|
283 *
|
nuclear@0
|
284 * Attaching a log stream can slightly reduce Assimp's overall import
|
nuclear@0
|
285 * performance. Multiple log-streams can be attached.
|
nuclear@0
|
286 * @param stream Describes the new log stream.
|
nuclear@0
|
287 * @note To ensure proper destruction of the logging system, you need to manually
|
nuclear@0
|
288 * call aiDetachLogStream() on every single log stream you attach.
|
nuclear@0
|
289 * Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided.
|
nuclear@0
|
290 */
|
nuclear@0
|
291 ASSIMP_API void aiAttachLogStream(
|
nuclear@0
|
292 const C_STRUCT aiLogStream* stream);
|
nuclear@0
|
293
|
nuclear@0
|
294 // --------------------------------------------------------------------------------
|
nuclear@0
|
295 /** Enable verbose logging. Verbose logging includes debug-related stuff and
|
nuclear@0
|
296 * detailed import statistics. This can have severe impact on import performance
|
nuclear@0
|
297 * and memory consumption. However, it might be useful to find out why a file
|
nuclear@0
|
298 * didn't read correctly.
|
nuclear@0
|
299 * @param d AI_TRUE or AI_FALSE, your decision.
|
nuclear@0
|
300 */
|
nuclear@0
|
301 ASSIMP_API void aiEnableVerboseLogging(aiBool d);
|
nuclear@0
|
302
|
nuclear@0
|
303 // --------------------------------------------------------------------------------
|
nuclear@0
|
304 /** Detach a custom log stream from the libraries' logging system.
|
nuclear@0
|
305 *
|
nuclear@0
|
306 * This is the counterpart of #aiAttachLogStream. If you attached a stream,
|
nuclear@0
|
307 * don't forget to detach it again.
|
nuclear@0
|
308 * @param stream The log stream to be detached.
|
nuclear@0
|
309 * @return AI_SUCCESS if the log stream has been detached successfully.
|
nuclear@0
|
310 * @see aiDetachAllLogStreams
|
nuclear@0
|
311 */
|
nuclear@0
|
312 ASSIMP_API C_ENUM aiReturn aiDetachLogStream(
|
nuclear@0
|
313 const C_STRUCT aiLogStream* stream);
|
nuclear@0
|
314
|
nuclear@0
|
315 // --------------------------------------------------------------------------------
|
nuclear@0
|
316 /** Detach all active log streams from the libraries' logging system.
|
nuclear@0
|
317 * This ensures that the logging system is terminated properly and all
|
nuclear@0
|
318 * resources allocated by it are actually freed. If you attached a stream,
|
nuclear@0
|
319 * don't forget to detach it again.
|
nuclear@0
|
320 * @see aiAttachLogStream
|
nuclear@0
|
321 * @see aiDetachLogStream
|
nuclear@0
|
322 */
|
nuclear@0
|
323 ASSIMP_API void aiDetachAllLogStreams(void);
|
nuclear@0
|
324
|
nuclear@0
|
325 // --------------------------------------------------------------------------------
|
nuclear@0
|
326 /** Releases all resources associated with the given import process.
|
nuclear@0
|
327 *
|
nuclear@0
|
328 * Call this function after you're done with the imported data.
|
nuclear@0
|
329 * @param pScene The imported data to release. NULL is a valid value.
|
nuclear@0
|
330 */
|
nuclear@0
|
331 ASSIMP_API void aiReleaseImport(
|
nuclear@0
|
332 const C_STRUCT aiScene* pScene);
|
nuclear@0
|
333
|
nuclear@0
|
334 // --------------------------------------------------------------------------------
|
nuclear@0
|
335 /** Returns the error text of the last failed import process.
|
nuclear@0
|
336 *
|
nuclear@0
|
337 * @return A textual description of the error that occurred at the last
|
nuclear@0
|
338 * import process. NULL if there was no error. There can't be an error if you
|
nuclear@0
|
339 * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing.
|
nuclear@0
|
340 */
|
nuclear@0
|
341 ASSIMP_API const char* aiGetErrorString(void);
|
nuclear@0
|
342
|
nuclear@0
|
343 // --------------------------------------------------------------------------------
|
nuclear@0
|
344 /** Returns whether a given file extension is supported by ASSIMP
|
nuclear@0
|
345 *
|
nuclear@0
|
346 * @param szExtension Extension for which the function queries support for.
|
nuclear@0
|
347 * Must include a leading dot '.'. Example: ".3ds", ".md3"
|
nuclear@0
|
348 * @return AI_TRUE if the file extension is supported.
|
nuclear@0
|
349 */
|
nuclear@0
|
350 ASSIMP_API aiBool aiIsExtensionSupported(
|
nuclear@0
|
351 const char* szExtension);
|
nuclear@0
|
352
|
nuclear@0
|
353 // --------------------------------------------------------------------------------
|
nuclear@0
|
354 /** Get a list of all file extensions supported by ASSIMP.
|
nuclear@0
|
355 *
|
nuclear@0
|
356 * If a file extension is contained in the list this does, of course, not
|
nuclear@0
|
357 * mean that ASSIMP is able to load all files with this extension.
|
nuclear@0
|
358 * @param szOut String to receive the extension list.
|
nuclear@0
|
359 * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter.
|
nuclear@0
|
360 */
|
nuclear@0
|
361 ASSIMP_API void aiGetExtensionList(
|
nuclear@0
|
362 C_STRUCT aiString* szOut);
|
nuclear@0
|
363
|
nuclear@0
|
364 // --------------------------------------------------------------------------------
|
nuclear@0
|
365 /** Get the approximated storage required by an imported asset
|
nuclear@0
|
366 * @param pIn Input asset.
|
nuclear@0
|
367 * @param in Data structure to be filled.
|
nuclear@0
|
368 */
|
nuclear@0
|
369 ASSIMP_API void aiGetMemoryRequirements(
|
nuclear@0
|
370 const C_STRUCT aiScene* pIn,
|
nuclear@0
|
371 C_STRUCT aiMemoryInfo* in);
|
nuclear@0
|
372
|
nuclear@0
|
373
|
nuclear@0
|
374
|
nuclear@0
|
375 // --------------------------------------------------------------------------------
|
nuclear@0
|
376 /** Create an empty property store. Property stores are used to collect import
|
nuclear@0
|
377 * settings.
|
nuclear@0
|
378 * @return New property store. Property stores need to be manually destroyed using
|
nuclear@0
|
379 * the #aiReleasePropertyStore API function.
|
nuclear@0
|
380 */
|
nuclear@0
|
381 ASSIMP_API C_STRUCT aiPropertyStore* aiCreatePropertyStore(void);
|
nuclear@0
|
382
|
nuclear@0
|
383 // --------------------------------------------------------------------------------
|
nuclear@0
|
384 /** Delete a property store.
|
nuclear@0
|
385 * @param p Property store to be deleted.
|
nuclear@0
|
386 */
|
nuclear@0
|
387 ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p);
|
nuclear@0
|
388
|
nuclear@0
|
389 // --------------------------------------------------------------------------------
|
nuclear@0
|
390 /** Set an integer property.
|
nuclear@0
|
391 *
|
nuclear@0
|
392 * This is the C-version of #Assimp::Importer::SetPropertyInteger(). In the C
|
nuclear@0
|
393 * interface, properties are always shared by all imports. It is not possible to
|
nuclear@0
|
394 * specify them per import.
|
nuclear@0
|
395 *
|
nuclear@0
|
396 * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
nuclear@0
|
397 * @param szName Name of the configuration property to be set. All supported
|
nuclear@0
|
398 * public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
nuclear@0
|
399 * @param value New value for the property
|
nuclear@0
|
400 */
|
nuclear@0
|
401 ASSIMP_API void aiSetImportPropertyInteger(
|
nuclear@0
|
402 C_STRUCT aiPropertyStore* store,
|
nuclear@0
|
403 const char* szName,
|
nuclear@0
|
404 int value);
|
nuclear@0
|
405
|
nuclear@0
|
406 // --------------------------------------------------------------------------------
|
nuclear@0
|
407 /** Set a floating-point property.
|
nuclear@0
|
408 *
|
nuclear@0
|
409 * This is the C-version of #Assimp::Importer::SetPropertyFloat(). In the C
|
nuclear@0
|
410 * interface, properties are always shared by all imports. It is not possible to
|
nuclear@0
|
411 * specify them per import.
|
nuclear@0
|
412 *
|
nuclear@0
|
413 * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
nuclear@0
|
414 * @param szName Name of the configuration property to be set. All supported
|
nuclear@0
|
415 * public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
nuclear@0
|
416 * @param value New value for the property
|
nuclear@0
|
417 */
|
nuclear@0
|
418 ASSIMP_API void aiSetImportPropertyFloat(
|
nuclear@0
|
419 C_STRUCT aiPropertyStore* store,
|
nuclear@0
|
420 const char* szName,
|
nuclear@0
|
421 ai_real value);
|
nuclear@0
|
422
|
nuclear@0
|
423 // --------------------------------------------------------------------------------
|
nuclear@0
|
424 /** Set a string property.
|
nuclear@0
|
425 *
|
nuclear@0
|
426 * This is the C-version of #Assimp::Importer::SetPropertyString(). In the C
|
nuclear@0
|
427 * interface, properties are always shared by all imports. It is not possible to
|
nuclear@0
|
428 * specify them per import.
|
nuclear@0
|
429 *
|
nuclear@0
|
430 * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
nuclear@0
|
431 * @param szName Name of the configuration property to be set. All supported
|
nuclear@0
|
432 * public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
nuclear@0
|
433 * @param st New value for the property
|
nuclear@0
|
434 */
|
nuclear@0
|
435 ASSIMP_API void aiSetImportPropertyString(
|
nuclear@0
|
436 C_STRUCT aiPropertyStore* store,
|
nuclear@0
|
437 const char* szName,
|
nuclear@0
|
438 const C_STRUCT aiString* st);
|
nuclear@0
|
439
|
nuclear@0
|
440 // --------------------------------------------------------------------------------
|
nuclear@0
|
441 /** Set a matrix property.
|
nuclear@0
|
442 *
|
nuclear@0
|
443 * This is the C-version of #Assimp::Importer::SetPropertyMatrix(). In the C
|
nuclear@0
|
444 * interface, properties are always shared by all imports. It is not possible to
|
nuclear@0
|
445 * specify them per import.
|
nuclear@0
|
446 *
|
nuclear@0
|
447 * @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
nuclear@0
|
448 * @param szName Name of the configuration property to be set. All supported
|
nuclear@0
|
449 * public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
nuclear@0
|
450 * @param mat New value for the property
|
nuclear@0
|
451 */
|
nuclear@0
|
452 ASSIMP_API void aiSetImportPropertyMatrix(
|
nuclear@0
|
453 C_STRUCT aiPropertyStore* store,
|
nuclear@0
|
454 const char* szName,
|
nuclear@0
|
455 const C_STRUCT aiMatrix4x4* mat);
|
nuclear@0
|
456
|
nuclear@0
|
457 // --------------------------------------------------------------------------------
|
nuclear@0
|
458 /** Construct a quaternion from a 3x3 rotation matrix.
|
nuclear@0
|
459 * @param quat Receives the output quaternion.
|
nuclear@0
|
460 * @param mat Matrix to 'quaternionize'.
|
nuclear@0
|
461 * @see aiQuaternion(const aiMatrix3x3& pRotMatrix)
|
nuclear@0
|
462 */
|
nuclear@0
|
463 ASSIMP_API void aiCreateQuaternionFromMatrix(
|
nuclear@0
|
464 C_STRUCT aiQuaternion* quat,
|
nuclear@0
|
465 const C_STRUCT aiMatrix3x3* mat);
|
nuclear@0
|
466
|
nuclear@0
|
467 // --------------------------------------------------------------------------------
|
nuclear@0
|
468 /** Decompose a transformation matrix into its rotational, translational and
|
nuclear@0
|
469 * scaling components.
|
nuclear@0
|
470 *
|
nuclear@0
|
471 * @param mat Matrix to decompose
|
nuclear@0
|
472 * @param scaling Receives the scaling component
|
nuclear@0
|
473 * @param rotation Receives the rotational component
|
nuclear@0
|
474 * @param position Receives the translational component.
|
nuclear@0
|
475 * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const;
|
nuclear@0
|
476 */
|
nuclear@0
|
477 ASSIMP_API void aiDecomposeMatrix(
|
nuclear@0
|
478 const C_STRUCT aiMatrix4x4* mat,
|
nuclear@0
|
479 C_STRUCT aiVector3D* scaling,
|
nuclear@0
|
480 C_STRUCT aiQuaternion* rotation,
|
nuclear@0
|
481 C_STRUCT aiVector3D* position);
|
nuclear@0
|
482
|
nuclear@0
|
483 // --------------------------------------------------------------------------------
|
nuclear@0
|
484 /** Transpose a 4x4 matrix.
|
nuclear@0
|
485 * @param mat Pointer to the matrix to be transposed
|
nuclear@0
|
486 */
|
nuclear@0
|
487 ASSIMP_API void aiTransposeMatrix4(
|
nuclear@0
|
488 C_STRUCT aiMatrix4x4* mat);
|
nuclear@0
|
489
|
nuclear@0
|
490 // --------------------------------------------------------------------------------
|
nuclear@0
|
491 /** Transpose a 3x3 matrix.
|
nuclear@0
|
492 * @param mat Pointer to the matrix to be transposed
|
nuclear@0
|
493 */
|
nuclear@0
|
494 ASSIMP_API void aiTransposeMatrix3(
|
nuclear@0
|
495 C_STRUCT aiMatrix3x3* mat);
|
nuclear@0
|
496
|
nuclear@0
|
497 // --------------------------------------------------------------------------------
|
nuclear@0
|
498 /** Transform a vector by a 3x3 matrix
|
nuclear@0
|
499 * @param vec Vector to be transformed.
|
nuclear@0
|
500 * @param mat Matrix to transform the vector with.
|
nuclear@0
|
501 */
|
nuclear@0
|
502 ASSIMP_API void aiTransformVecByMatrix3(
|
nuclear@0
|
503 C_STRUCT aiVector3D* vec,
|
nuclear@0
|
504 const C_STRUCT aiMatrix3x3* mat);
|
nuclear@0
|
505
|
nuclear@0
|
506 // --------------------------------------------------------------------------------
|
nuclear@0
|
507 /** Transform a vector by a 4x4 matrix
|
nuclear@0
|
508 * @param vec Vector to be transformed.
|
nuclear@0
|
509 * @param mat Matrix to transform the vector with.
|
nuclear@0
|
510 */
|
nuclear@0
|
511 ASSIMP_API void aiTransformVecByMatrix4(
|
nuclear@0
|
512 C_STRUCT aiVector3D* vec,
|
nuclear@0
|
513 const C_STRUCT aiMatrix4x4* mat);
|
nuclear@0
|
514
|
nuclear@0
|
515 // --------------------------------------------------------------------------------
|
nuclear@0
|
516 /** Multiply two 4x4 matrices.
|
nuclear@0
|
517 * @param dst First factor, receives result.
|
nuclear@0
|
518 * @param src Matrix to be multiplied with 'dst'.
|
nuclear@0
|
519 */
|
nuclear@0
|
520 ASSIMP_API void aiMultiplyMatrix4(
|
nuclear@0
|
521 C_STRUCT aiMatrix4x4* dst,
|
nuclear@0
|
522 const C_STRUCT aiMatrix4x4* src);
|
nuclear@0
|
523
|
nuclear@0
|
524 // --------------------------------------------------------------------------------
|
nuclear@0
|
525 /** Multiply two 3x3 matrices.
|
nuclear@0
|
526 * @param dst First factor, receives result.
|
nuclear@0
|
527 * @param src Matrix to be multiplied with 'dst'.
|
nuclear@0
|
528 */
|
nuclear@0
|
529 ASSIMP_API void aiMultiplyMatrix3(
|
nuclear@0
|
530 C_STRUCT aiMatrix3x3* dst,
|
nuclear@0
|
531 const C_STRUCT aiMatrix3x3* src);
|
nuclear@0
|
532
|
nuclear@0
|
533 // --------------------------------------------------------------------------------
|
nuclear@0
|
534 /** Get a 3x3 identity matrix.
|
nuclear@0
|
535 * @param mat Matrix to receive its personal identity
|
nuclear@0
|
536 */
|
nuclear@0
|
537 ASSIMP_API void aiIdentityMatrix3(
|
nuclear@0
|
538 C_STRUCT aiMatrix3x3* mat);
|
nuclear@0
|
539
|
nuclear@0
|
540 // --------------------------------------------------------------------------------
|
nuclear@0
|
541 /** Get a 4x4 identity matrix.
|
nuclear@0
|
542 * @param mat Matrix to receive its personal identity
|
nuclear@0
|
543 */
|
nuclear@0
|
544 ASSIMP_API void aiIdentityMatrix4(
|
nuclear@0
|
545 C_STRUCT aiMatrix4x4* mat);
|
nuclear@0
|
546
|
nuclear@0
|
547 // --------------------------------------------------------------------------------
|
nuclear@0
|
548 /** Returns the number of import file formats available in the current Assimp build.
|
nuclear@0
|
549 * Use aiGetImportFormatDescription() to retrieve infos of a specific import format.
|
nuclear@0
|
550 */
|
nuclear@0
|
551 ASSIMP_API size_t aiGetImportFormatCount(void);
|
nuclear@0
|
552
|
nuclear@0
|
553 // --------------------------------------------------------------------------------
|
nuclear@0
|
554 /** Returns a description of the nth import file format. Use #aiGetImportFormatCount()
|
nuclear@0
|
555 * to learn how many import formats are supported.
|
nuclear@0
|
556 * @param pIndex Index of the import format to retrieve information for. Valid range is
|
nuclear@0
|
557 * 0 to #aiGetImportFormatCount()
|
nuclear@0
|
558 * @return A description of that specific import format. NULL if pIndex is out of range.
|
nuclear@0
|
559 */
|
nuclear@0
|
560 ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex);
|
nuclear@0
|
561 #ifdef __cplusplus
|
nuclear@0
|
562 }
|
nuclear@0
|
563 #endif
|
nuclear@0
|
564
|
nuclear@0
|
565 #endif // AI_ASSIMP_H_INC
|