Extending PhysicsControls

Another thing that bothers me: I have been doing my game logic based on classes that extend RigidBodyControl or GhostControl. In my classes I override update(float tpf) function and first move my object (lets say it is evermoving elevator) and then call super.update(tpf).

Is this approach ok, or should I be moving my objects in separate control/AppState? I don’t really know how physics multithreading work, and suspect there could possibly be some problems later, when the game is updated with synchronization info from server or smth…

The update method is run on the opengl thread, so I guess most stuff you do cant hurt if you call super.update(). If you want to apply forces you should implement PhysicsTickListener.

1 Like