The initial effort to bring JME concept and java code to run directly in the browser via jsweet and other custom made candies.
Purpose: To be able to use jme concepts and toolset to create browswer game. Good things people may want to use:
The core functions
The blender workflow
The UI eg: Lemur, Nifty
IDE like Netbean and Gradle
According to personal taste I made up such priority list. The port effort also follow this list and base in jME3 core 3,2,1 stable
Well… in my humble opinion transpiling is not the way to go. It’s very often very tedious and comes with major limitations.
However webassembly seems to be what we should be looking into if we want JME in a browser.
There are 2 known intiatives to make that come true
Though I do agree with you that transpiling isn’t the way to go JWebAssembly doesn’t seem ready at all yet. Meaning that we either have to wait until it is usable or go with something else in the meantime.
Also, I’m guessing that a lot of the work needs to be done either way like bindings for webgl so it may be useful to already start working on those changes and using jsweet in the meantime. That way, whenever compiling to webassembly becomes feasible a lot of the work has already been done.
Actually the transpiling process is pretty straight forward and simple because its mostly handled by JSweet maven task. The problem is i have to modify the current code base, we did successfully create a working example with lwjgl before so I think it’s possible. For now that’s a “not so bad” solution for what we need. But of course I’m looking for alternatives such as java byte code translate to js, there are a few now:
I tested Bytecoder with great success for an AI lib but my target is to “port” JME3 concepts and reuse the toolset. I will still folow this path. Not so bad, also some fun on the way indeed!
First I tried TeaVM and got so far that only Asset Loading and Rendering were missing but I was a bit unsatisfied with the direction the project is currently facing, so I tried to use Bytecoder, but currently compiling jme with it fails as some class libs weren’t implemented and as opposed to TeaVM, it doesn’t support passing them on your own, yet.
Waiting for the Dev on that one and then slowly and steadily progress from there
Do not know about Bytecoder, but regarding TeaVM seems it restrict some API usages and requires some manuall code rewriting:
Apparently CheerpJ provides a JRE in WebAssembly and does not require any change to be made to the source code.
CheerpJ achieves this by:
Covering 100% of the Java 8 language, including reflection and dynamic class generation;
Providing a full Java SE runtime library;
Supporting file system access (read and write), audio, printing through native browser features;
Supporting Java multi-threading and HTML5 WebWorkers;
Converting Java from bytecode, without requiring access to the application source code.
Differently from alternative solutions, CheerpJ does not require any change to be made to the source code of the application, supports 100% of the Java language and runtime.
One thing that I could not confirm is about the Java networking support.
Edit: Note that CheerpJ free licence is only for Non-commercial use
I am the project owner of JWebAssembly. I hope the pure JUnit test driven development to complete in 1-2 month. For continue development I search some real Java project that can be run in the browser.
I have play a little with jMonkeyEngine. Nice tool. But it seems very desktop orientated. Of course I does not understand many from the engine. But things like files or system properties make no sense in a WebAssembly environment. Do you have some work that is not such desktop orientated?
I have try to compile a simple com.jme3.app.SimpleApplication. Can be a mistake.
This is totally doable if you use threejs as a frontend engine,
At present, Threejs can implement a port of recast-detour for navmesh,
It can also implement Bullet physics (Ammo.js)
The engine renders pretty fast, its perks are awesome and broad for this purpose
Here are some of my works during my lazy period done with threejs, great performance also!