2016-02-02 09:52:28 +00:00
|
|
|
Build Asset Importer Lib for Android
|
|
|
|
====================================
|
2019-04-14 17:13:32 +00:00
|
|
|
This module provides a facade for the io-stream-access to files behind the android-asset-management within
|
2019-01-27 20:11:52 +00:00
|
|
|
an Android-native application.
|
2014-10-07 14:23:56 +00:00
|
|
|
- It is built as a static library
|
|
|
|
- It requires Android NDK with android API > 9 support.
|
|
|
|
|
2016-02-02 09:52:28 +00:00
|
|
|
### Building ###
|
2014-10-07 14:23:56 +00:00
|
|
|
To use this module please provide following cmake defines:
|
2016-02-02 10:00:28 +00:00
|
|
|
```
|
2014-10-07 14:23:56 +00:00
|
|
|
-DASSIMP_ANDROID_JNIIOSYSTEM=ON
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$SOME_PATH/android.toolchain.cmake
|
2016-02-02 10:00:28 +00:00
|
|
|
```
|
2014-10-07 14:23:56 +00:00
|
|
|
|
|
|
|
"SOME_PATH" is a path to your cmake android toolchain script.
|
|
|
|
|
2020-11-17 00:39:59 +00:00
|
|
|
|
|
|
|
The build script for this port is based on [android-cmake](https://github.com/taka-no-me/android-cmake).
|
|
|
|
See its documentation for more Android-specific cmake options (e.g. -DANDROID_ABI for the target ABI).
|
2020-12-01 07:58:45 +00:00
|
|
|
Check [Asset-Importer-Docs](https://assimp-docs.readthedocs.io/en/latest/) for more information.
|
2020-11-17 00:39:59 +00:00
|
|
|
|
2016-02-02 09:52:28 +00:00
|
|
|
### Code ###
|
|
|
|
A small example how to wrap assimp for Android:
|
|
|
|
```cpp
|
2014-10-07 14:23:56 +00:00
|
|
|
#include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h>
|
|
|
|
|
|
|
|
Assimp::Importer* importer = new Assimp::Importer();
|
2019-01-27 20:11:52 +00:00
|
|
|
Assimp::AndroidJNIIOSystem *ioSystem = new Assimp::AndroidJNIIOSystem(app->activity);
|
|
|
|
if ( nullptr != iosSystem ) {
|
|
|
|
importer->SetIOHandler(ioSystem);
|
|
|
|
}
|
2016-02-02 09:52:28 +00:00
|
|
|
```
|