BulletSharpUnity3d icon indicating copy to clipboard operation
BulletSharpUnity3d copied to clipboard

WebGL

Open franckmolto opened this issue 9 years ago • 3 comments

Well, it's not exactly an issue, but it would be great to have a build for WebGL. It seems that it has already been done with pevious version of bullet, using Emscripten.

Regards

franckmolto avatar Aug 12 '16 15:08 franckmolto

http://forum.unity3d.com/threads/include-native-c-code-into-webgl-build-how.307262/

franckmolto avatar Aug 12 '16 15:08 franckmolto

Hi, ‘Plugins’ folder doesn’t contain WebGL entry. Do you plan to add one? The issue is old and probably something has changed since 2016. Thanks in advance!

asimplestd avatar Oct 26 '21 06:10 asimplestd

I don't have plans to add a WebGL entry.

Bullet Physics is a big plugin written in pure C++ code. In theory a WebGL build can be added by adding all the Bullet Source to the il2cpp folder and Unity will magically compile it into the rest of its IL2CPP c++ code as it is being built. For WebGL this includes converting the compiled code to Javascript.

I am reluctant to try this for a few reasons: This process is different than dropping .dlls into the plugin's forlder. Also I am very skeptical that this will work. C++ is a very quirky language. High performance C++ usually does a lot of tricks with pointers that cannot be done in higher level languages like Javascript. I would be very surprised if the code worked in Javascript. Also I think the performance would be terrible. There is a good reason Bullet was written in C++ and not a high level interpreted language like Javascript.

Phong13 avatar Oct 26 '21 15:10 Phong13