net.sf.tankbattles.scene.camera
Class ChaseCameraUpdateCallback

java.lang.Object
  extended by net.sf.tankbattles.scene.camera.ChaseCameraUpdateCallback
All Implemented Interfaces:
com.jmex.physics.PhysicsUpdateCallback

public class ChaseCameraUpdateCallback
extends java.lang.Object
implements com.jmex.physics.PhysicsUpdateCallback

PhysicsUpdateCallback for updating the chase camera. Should be added to the Physics update callbacks to avoid the stuttering that happens when there's a lack of sync between the openGL render and physics update timers.

Author:
Erick B Passos

Constructor Summary
ChaseCameraUpdateCallback(CustomChaseCamera chaseCamera)
          Initializes the chaseCamera witch is going to be updated with.
 
Method Summary
 void afterStep(com.jmex.physics.PhysicsSpace pSpace, float tpf)
          The camera update happens after the physics update step.
 void beforeStep(com.jmex.physics.PhysicsSpace pSpace, float tpf)
          Nothing happens before physics update step.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChaseCameraUpdateCallback

public ChaseCameraUpdateCallback(CustomChaseCamera chaseCamera)
Initializes the chaseCamera witch is going to be updated with.

Parameters:
chaseCamera - to be updated.
Method Detail

afterStep

public void afterStep(com.jmex.physics.PhysicsSpace pSpace,
                      float tpf)
The camera update happens after the physics update step.

Specified by:
afterStep in interface com.jmex.physics.PhysicsUpdateCallback

beforeStep

public void beforeStep(com.jmex.physics.PhysicsSpace pSpace,
                       float tpf)
Nothing happens before physics update step.

Specified by:
beforeStep in interface com.jmex.physics.PhysicsUpdateCallback