iokto / newton-dynamics

Automatically exported from code.google.com/p/newton-dynamics
0 stars 0 forks source link

Android NDK patch for Newton 2 (includes dCustomJoints, dScene) #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Patch that makes you able to use Newton on Android NDK. Patch should be applied 
to latest Newton (from svn).

ARM NEON/SIMD is not used for now, and coreLibrary_200 can be used 
(coreLibrary_300 won't work for now, but I'm planning to bring it to Android 
NDK too).
Packages like dMath, dContainers, dCustomJoints, thirdParty/tinyxml, dScene can 
be used too (there are Android.mk files for them).

Tested only on Samsung Galaxy SII (GT-I9100) Gingerbread 2.3.4 (using NDK r5c 
and r6), but I don't see reason why it would not work on other devices on 
Android 2.3 (except that don't have FPU, but all modern Android devices have 
it).
Newton on devices running Android 2.1 (Eclair) and 2.2 (Froyo) should work too, 
but I haven't tested it. Build scripts are configured to use armeabi-v7a (might 
work with armeabi too, but again: I haven't tested it).

Example screenshots of test project on Android: 
http://imageshack.us/g/835/sc20110911110327.png/ (for gravity vector I've used 
Accelerometer)
Android.mk and Application.mk (with screenshot of my test project dir 
structure) also included, so you should be able to easily use it in your 
project (which files should be included/etc).

More info here: http://newtondynamics.com/forum/viewtopic.php?f=26&t=6802

Original issue reported on code.google.com by krystian...@gmail.com on 11 Sep 2011 at 9:49

Attachments:

GoogleCodeExporter commented 9 years ago
excellent, very soon I will integrate this work with the current version of 
Newton.
Thank you for this work

Original comment by JerezJul...@gmail.com on 11 Sep 2011 at 3:43

GoogleCodeExporter commented 9 years ago
It looks like in patched dgTypes.cpp code:
#ifdef ANDROID
should be:
#ifdef __ANDROID__

http://newtondynamics.com/forum/viewtopic.php?f=26&t=6802&start=13
http://groups.google.com/group/android-ndk/browse_thread/thread/c93b0cedc6a6fdd9
 (__ANDROID__ didn't work correctly at least in NDK pre-r5)
http://groups.google.com/group/android-ndk/browse_thread/thread/9c1922c3b3e8e6e6
 (some bug related to ANDROID def. fixed in latest NDK r6b)

However in my app. both ANDROID and __ANDROID__ works correctly. But from links 
above you can read that guy from android recommends using __ANDROID__ in NDK, 
so in attachment there is a new patch (with that small #ifdef change in 
dgTypes.cpp)

Original comment by krystian...@gmail.com on 19 Sep 2011 at 5:12

Attachments:

GoogleCodeExporter commented 9 years ago
I see that applying patch by Tortoise SVN (1.6.16, x64) doesn't add new 
files/directories to local svn like:
- {NGD}\coreLibrary_200\projets\android\Android.mk (only NewtonSrc.mk was added 
properly and parent dir 'android')
- {NGD}\packages\projects\android (this dir and sub-dirs/files)
So those new files/dirs need to be added (Tortoise SVN->Add...) to SVN manually 
before committing.

Original comment by krystian...@gmail.com on 19 Sep 2011 at 9:12