Hello !
It seems that there is a problem with:
public List rayTest(Vector3f from, Vector3f to, List results) from PhysicSpace
All works ok with jbullet, but the app crash with the android native version after a few raycasts… No bug trace as it’s jni :(,
It can’t use the jbullet version under Android as it is too slow, and generate a lot of garbage.
If someone has a clue to solve my problem it would be kind…
Thanks !
Kine
native bullet isn’t completed yet.
I am having this issue also, so I started to look into why this is. So far, I’ve found that the native bullet raytest works fine on the PC, but not for Android. I am only getting the library crash when running on android. If I configure the PC version to use native bullet, it works fine.
@normen Can you explain why the C routine has a “1” in the name? I haven’t seen this before and it doesn’t look like any of the other methods have this.
JNIEXPORT void JNICALL Java_com_jme3_bullet_PhysicsSpace_rayTest_1native
Nowhere near resolving this yet, but I think I have it narrowed down to the line that causes the crash. As I said before, native bullet ray tests on the PC work fine.
In jmeBulletUtil.cpp routine the crashes go away on Android if I comment out the following line:
[EDIT: in the addResult routine]
[java]
env->SetObjectField(singleresult, jmeClasses::PhysicsRay_collisionObject, up1->javaCollisionObject);
[/java]
If I leave this commented out, I successfully get back the number of objects the ray intersects with, the hitFraction, and the hitNormal.
With the line above left in, the logcat for Android shows the following:
[java]
04-05 23:48:10.289 15154 15154 I DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-05 23:48:10.289 15154 15154 I DEBUG : Build fingerprint: ‘verizon/targa_vzw/cdma_targa:2.3.4/5.5.1_84_DBN-71/120106:user/release-keys’
04-05 23:48:10.289 15154 15154 I DEBUG : pid: 15125, tid: 15146 >>> com.interstatewebgroup.cubiclelife <<<
04-05 23:48:10.289 15154 15154 I DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr de61dea7
04-05 23:48:10.289 15154 15154 I DEBUG : r0 de61dea7 r1 00000003 r2 de61dea7 r3 00000003
04-05 23:48:10.289 15154 15154 I DEBUG : r4 455aa468 r5 44c07de8 r6 459eec08 r7 000010f8
04-05 23:48:10.289 15154 15154 I DEBUG : r8 aca12080 r9 455aa466 10 00000000 fp acaa0368
04-05 23:48:10.289 15154 15154 I DEBUG : ip 000000f8 sp 459eebb8 lr aca17118 pc aca15e98 cpsr a0000010
04-05 23:48:10.289 15154 15154 I DEBUG : d0 002e003100280020 d1 00300020002c0030
04-05 23:48:10.289 15154 15154 I DEBUG : d2 0020002c0030002e d3 00290030002e0030
04-05 23:48:10.289 15154 15154 I DEBUG : d4 bd8f5b29c1411897 d5 41a230ac41f230ac
04-05 23:48:10.289 15154 15154 I DEBUG : d6 60924abe5f8cad71 d7 000003b742f42313
04-05 23:48:10.289 15154 15154 I DEBUG : d8 42574b9642b51739 d9 42bbfe6a42b51739
04-05 23:48:10.289 15154 15154 I DEBUG : d10 0000000000000000 d11 0000000000000000
04-05 23:48:10.289 15154 15154 I DEBUG : d12 0000000000000000 d13 0000000000000000
04-05 23:48:10.289 15154 15154 I DEBUG : d14 00000000bd233ea2 d15 0000000000000000
04-05 23:48:10.289 15154 15154 I DEBUG : d16 8000000000000000 d17 7e37e43c8800759c
04-05 23:48:10.289 15154 15154 I DEBUG : d18 bff0000000000000 d19 3fe00000002493d1
04-05 23:48:10.297 15154 15154 I DEBUG : d20 bfc4af584a226535 d21 be5acaf22bc332b0
04-05 23:48:10.297 15154 15154 I DEBUG : d22 0000000000000000 d23 3de5d93a5acfd57c
04-05 23:48:10.297 15154 15154 I DEBUG : d24 3fc746f2c0f4eddb d25 3fc39a09d078c69f
04-05 23:48:10.297 15154 15154 I DEBUG : d26 3f3043b3a18f8aef d27 3f43545b10f5feaa
04-05 23:48:10.297 15154 15154 I DEBUG : d28 3f12e167f9ad8af4 d29 3f1460ea3eff5d8f
04-05 23:48:10.297 15154 15154 I DEBUG : d30 3efb2a7074bf7ad4 d31 bff0000000000000
04-05 23:48:10.297 15154 15154 I DEBUG : scr 20000013
04-05 23:48:10.297 15154 15154 I DEBUG :
04-05 23:48:10.352 15154 15154 I DEBUG : #00 pc 00015e98 /system/lib/libdvm.so
04-05 23:48:10.352 15154 15154 I DEBUG : #01 pc 0001c298 /system/lib/libdvm.so
04-05 23:48:10.352 15154 15154 I DEBUG : #02 pc 0001b188 /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : #03 pc 0005a1cc /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : #04 pc 0005a3e4 /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : #05 pc 0004e696 /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : #06 pc 00011990 /system/lib/libc.so
04-05 23:48:10.360 15154 15154 I DEBUG : #07 pc 0001155c /system/lib/libc.so
04-05 23:48:10.360 15154 15154 I DEBUG :
04-05 23:48:10.360 15154 15154 I DEBUG : code around pc:
04-05 23:48:10.360 15154 15154 I DEBUG : aca15e78 e088f30c e320f000 e1d430b4 e1d410b2
04-05 23:48:10.360 15154 15154 I DEBUG : aca15e88 e203300f e7952103 e3520000 0a00050d
04-05 23:48:10.360 15154 15154 I DEBUG : aca15e98 e5922000 e5922074 e5054008 e7920101
04-05 23:48:10.360 15154 15154 I DEBUG : aca15ea8 eb00043e e320f000 e320f000 e320f000
04-05 23:48:10.360 15154 15154 I DEBUG : aca15eb8 e320f000 e320f000 e1d430b4 e1d410b2
04-05 23:48:10.360 15154 15154 I DEBUG :
04-05 23:48:10.360 15154 15154 I DEBUG : code around lr:
04-05 23:48:10.360 15154 15154 I DEBUG : aca170f8 e088f30c e1a01000 e5960018 fa010a07
04-05 23:48:10.360 15154 15154 I DEBUG : aca17108 ea000017 e3a00001 e3a09000 ebffff72
04-05 23:48:10.360 15154 15154 I DEBUG : aca17118 e2450014 e5905000 e5909004 e515200c
04-05 23:48:10.360 15154 15154 I DEBUG : aca17128 e5963018 e3520000 1592a000 e3a01000
04-05 23:48:10.360 15154 15154 I DEBUG : aca17138 0affff8a e1f970b6 e5862010 e59a1028
04-05 23:48:10.360 15154 15154 I DEBUG :
04-05 23:48:10.360 15154 15154 I DEBUG : stack:
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb78 002c45d0
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb7c aca4f42d /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb80 405b3f88
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb84 00000000
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb88 00000001
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb8c 000016d6
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb90 00100c20
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb94 aca66b53 /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb98 406b8dd8
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeb9c 00000021
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeba0 457c3008
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeba4 455aa45c
04-05 23:48:10.360 15154 15154 I DEBUG : 459eeba8 44c07de8
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebac 459eec08
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebb0 df002777
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebb4 e3a070ad
04-05 23:48:10.360 15154 15154 I DEBUG : #00 459eebb8 00000000
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebbc 459eec08
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebc0 00000001
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebc4 002e1338
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebc8 002c45d8
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebcc 00017000
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebd0 acaa5d38
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebd4 fffffe84
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebd8 acaa0368
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebdc aca1c29c /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : #01 459eebe0 459eec08
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebe4 002c45d0
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebe8 aca1c20c /system/lib/libdvm.so
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebec 42db3ab4
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebf0 00000000
04-05 23:48:10.360 15154 15154 I DEBUG : 459eebf4 aca1b18c /system/lib/libdvm.so
[/java]
raycasting in native was a contribution and its going a bit away from the style of the rest of the library, so I’ll probably rewrite that bit at some point anyway.
OK. I went to it because the using collidesWith with a ray was slowing my Android app down quite a bit. In the meantime, I’ll keep poking around and see it I can fix it. I need to get a fast way to detect when the character is moving over a power-up object in the scene. If I can’t get it working (not very experienced with JNI or C++), maybe I’ll change it to a ghost object and use the collision callback.