Ok, so I figure I will make the rendering in C++ and only interact with it asynchronously from Java.
That way I can avoid the GC pause but still hot-deploy changes directly into the running engine saving alot of development time.
And I need the performance of C++ because I want to build a VR MMO.
I already have the collada to OpenGL skinned mesh C++ code almost done (it works with a perfect example animation, but not with a real human made animation because there are bones that are unused and such)…
So the usage would look something like:
public class Meadow extends Game {
Animal fox;
public void init() {
fox = new Animal("model/fox.dae", "texture/fox.tga");
scene.add(fox);
camera.distance(3f);
camera.position(fox);
camera.rotation(mouse.rotation());
}
public void tick() {
if(key.up() && fox.velocity().x == 0) {
fox.velocity().x = 1;
}
if(!key.up() && fox.velocity().x != 0) {
fox.velocity().x = 0;
}
}
}
And the C++ thread would just render automatically.
So basically a very high level control game engine from the Java perspective.
I’ll see where the physics will happen, probably in Java first, then I’ll move it when/if it becomes too slow.
So atleast the system will use 3 cores since it will have 3 threads interacting asynchronously.
Java -> Physics -> Rendering