Can I implement JBullet physics later in development

92 views Asked by At

I am a semi-new OpenGL programmer, and am in the process of learning of how VBO's and Shaders interact with each other. I have a basic demo set up, and it imports the model and places a light in the scene. Now, in the future I would like to have physics, but my knowledge of JBullet is at a minimum. Should I implement the physics into it from the ground up, while learning more about rendering, or is it something I can add later, assuming my engine's framework is somewhat flexible to new API's?

Note: I am using LWJGL, and plan on using JBullet along with GLSL

1

There are 1 answers

0
Vengarioth On

Short Answer

Yes

Long Answer

Your Graphics code should be separated from any Physics code. In most engines, from Unity to UDK the Physics has little to do with your Graphics code. The only place where they connect is your game code when you do something like

Position = PhysicsObject.GetPosition();
DrawableModel.Draw(Position);

Some engines put higher levels of abstraction on top of this, like UDK with UnrealScript. Others like Unity behave exactly like this.

You might also want to have a look at a pattern or architecture called Entity Component System