[devlog] Bullet SoftBody in JME3.1

Thank’s! Here’s another question: How to compile SDK? SDK directory has been removed from git.

git clone GitHub - jMonkeyEngine/sdk: The jMonkeyEngine3 SDK based on netbeans

1 Like

@grizeldi thank’s!

@Strijar i updated the native libraries, for android, linux and windows.

2 Likes

Thank’s! But now I have another error - SIGSEGV (Application crash)

D/CrashAnrDetector( 583): backtrace:
D/CrashAnrDetector( 583): #00 pc 0004b9c4 /system/lib/libdvm.so
D/CrashAnrDetector( 583): #01 pc 00062563 /data/app-lib/ru.strijar.vs-1/libbulletjme.so (_JNIEnv::GetFloatField(_jobject*, _jfieldID*)+8)
D/CrashAnrDetector( 583): #02 pc 000625a1 /data/app-lib/ru.strijar.vs-1/libbulletjme.so (jmeBulletUtil::convert(_JNIEnv*, _jobject*, btVector3*)+32)
D/CrashAnrDetector( 583): #03 pc 00063e91 /data/app-lib/ru.strijar.vs-1/libbulletjme.so (jmePhysicsSoftSpace::createPhysicsSoftSpace(_jobject*, _jobject*, int, unsigned char)+32)
D/CrashAnrDetector( 583): #04 pc 00061509 /data/app-lib/ru.strijar.vs-1/libbulletjme.so (Java_com_jme3_bullet_PhysicsSoftSpace_createPhysicsSoftSpace+76)

I recompiled the library itself (android-ndk-r10d), but it did not solve the problem

Hello there,

Little update since the last one (of Feb 15).
I fixed a issue with joint finalizing, this took me a lot of time to figured it out.

I have a question about the serialization of a PhysicsSoftBody.

Why serialization isn’t easy : because the whole softbody structure need to be saved.
For example imagine an elastic rope attached to two walls. First we need to save positions of the rope, then we also need to save it’s “elastic” propriety. But we also need to save its forces that prevent the rope from touching the ground, and maybe also it’s masses, velocities, ect …

I see three options :

  1. don’t :
  • pro : easy, serialize only the “initial” state by the user code.
  • cons : no serialization
  1. do it in jme
  • pro : yeah serialization, and access on the saved data
  • cons : huge amount of work, some values are not used on the jme side but still need to be saved.
  1. use bullet internal serialization
  • pro : yeah serialization
  • cons : only binary saves, can be problematic if bullet’s serialization change, have to deal with joints.

IMO it is ok to not serialize a PhysicsSoftBody, and to just save a “initial” state. For the elastic rope example this would a straight line. And maybe this can be by default implemented in the SoftBodyControler.

1 Like

@Empire_Phoenix mentioned that there were some issues with respect to bullet serialization when it comes to various platforms (e.g. 32 bit vs 64 bit). It doesn’t seem like anybody at bullet is interested in getting those issues fixed.

If the serialization cannot be handled the same by all platforms then IMO it is useless and we should not support it.

Hi Friends
softBody wiki page is missing from http://davidb.github.io/sandbox_wiki_jme/jme3.html
and is not available at https://web.archive.org/web/20160427002233/http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:softbody
If anybody has the link please report it
https://github.com/davidB/sandbox_wiki_jme/issues/3

Thanks

Here is the link: https://jmonkeyengine.github.io/wiki/jme3/advanced/softbody.html

2 Likes

what is the right bullet url? I get an error with http://bullet.googlecode.com/files/bullet-2.82-r2704.zip

Bullet repo is now on GitHub GitHub - bulletphysics/bullet3: Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
You can still find bullet-2.82 release here Release 2.82: fix double precision, and remove alloca · bulletphysics/bullet3 · GitHub

1 Like

Sorry to reopen this old thread, but I can’t compile the native library. (Gradle is not really my strength)
I followed the tutorial from the wiki, downloaded the repository, set buildNativeProjects=true, updated the path to bullet as above, and executed ./gradlew build.
The library, however, is not built. The build process produces no output that any cpp file is compiled, nor is the libs/ folder updated. It still contains old binaries that don’t work with the current state of the repository. Deleting these files does not trigger the compilation either.
My system: Windows 10, Visual Studio Enterprise 2017 and MinGW 6.3.0 are installed.
Thank you in advance.

Thanks for your feedback.
The softbody branch is a bit dusty and frankly I don’t really know what issue you’re encountering.
Dumb question: which version of bullet do you use ?
I will try to push an update to align the softbody branch on jme 3.2.

3 Likes

I use bullet 2.82 as linked in your post above.
I think, my problem is more that I don’t get Gradle to compile the native library, so it’s more Gradle related.

And it would be awesome, if you could update it to jme3.2.
I also wondered, could this be turned into a pull request? This seems to be a great enhancement to the core engine to me.

The thing is that I don’t remember using bullet 2.82 :sweat_smile:
I just put a link because someone couldn’t find it.

I just checked with the latest release of bullet. Still no compilation of the native code.

So the threaded physics solver is not supported anymore (I don’t know if someone ever used-it anyway).

I pushed a fix on the tip a new branch bullet_SoftBody-v3.2.1 which is the entire bullet_softbody mess rebased on the v3.2.1-stable tag.

I’ll try to do some git magic to make a cleaner softbody branch. So I wont have a bounty killer on me in case this mess gets to the jme master branch. :-]

Edit:
If it compile it works ! … yes ?

1 Like

Sadly no, the library still does not compile. Instead, the c++ sources are copied into jme3-bullet-native-sources.jar and the jme3-bullet-native.jar contains the old prebuild binaries from 7 months ago.
Could you maybe simply update the prebuild binaries?

Hello, I want to use softbody on android, but I will be stuck as soon as I call the PhysicsSoftBody code.
Sorry for my English

Hi, I am sorry but I don’t understand your problem.
You said that the application crash on code related to PhysicsSoftBody, can you be more specific?
Can you give me more details?