[devlog] Bullet SoftBody in JME3.1

Hello folks,

I made huge progress this month adding angular and linear joint for soft-rigid and soft-soft bodies.
It’s was a big chunk of work because bullet softbody joints do not work as rigid ones so i had to think of a bit of workaround to make them seamless to you. And it’s work pretty well, I still didn’t figure out how to use pivotA & pivotB from classic joint.

github commit


More informations can be found on the wiki page, which is still in early writing stage, so feel free to add your tips.

10 Likes

Hello! I want to run me application on Android. But the library for Android do not contain PhysicsSoftSpace. And I can not get to where he appeared! Linux libraries are compiled and work normally. I use fresh sources from git.

This is because the native libraries need to be recompiled for Android using the Android NDK and committed into the fork.
Maybe @Dokthar could do this.

Ok, I tried to compile using android-ndk-r11c and I got an error:

:jme3-android:build
:jme3-android-native:downloadStbImage
:jme3-android-native:copyStbiFiles
:jme3-android-native:copyTremorFiles
:jme3-android-native:generateJavahHeaders
Error: Could not find class file for ‘com.jme3.audio.plugins.NativeVorbisFile’.
Error: Could not find class file for ‘com.jme3.texture.plugins.AndroidNativeImageLoader’.
:jme3-android-native:generateJavahHeaders FAILED

@Strijar I am trying to build the libs for linux & android. I’ll keep you informed.

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.