org.jdesktop.wonderland.client.jme
Class CameraProcessor

java.lang.Object
  extended by org.jdesktop.mtgame.EntityComponent
      extended by org.jdesktop.mtgame.ProcessorComponent
          extended by org.jdesktop.wonderland.client.jme.CameraProcessor

public class CameraProcessor
extends org.jdesktop.mtgame.ProcessorComponent

The processor for the camera, the behavior of the camera is controlled by the pluggable CameraControllers.

Author:
paulby

Field Summary
protected  com.jme.scene.CameraNode cameraNode
           
 
Constructor Summary
CameraProcessor(com.jme.scene.CameraNode cameraNode, CameraController cameraController)
          Create a CameraProcessor for the specified cameraNode.
 
Method Summary
 void commit(org.jdesktop.mtgame.ProcessorArmingCollection p)
           
 void compute(org.jdesktop.mtgame.ProcessorArmingCollection p)
           
 CameraController getCameraController()
          Return the camera controller.
 void initialize()
           
 void setCameraController(CameraController cameraController)
          Set the camera controller.
 void viewMoved(CellTransform worldTransform)
          The view cell has moved, update the camera position.
 
Methods inherited from class org.jdesktop.mtgame.ProcessorComponent
addToChain, getArmingCondition, getCurrentTriggerCollection, getLocation, getLODLevel, getRunInRenderer, getSwingSafe, isEnabled, removeFromChain, setArmingCondition, setEnabled, setLocation, setRunInRenderer, setSwingSafe
 
Methods inherited from class org.jdesktop.mtgame.EntityComponent
getEntity, setEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cameraNode

protected com.jme.scene.CameraNode cameraNode
Constructor Detail

CameraProcessor

public CameraProcessor(com.jme.scene.CameraNode cameraNode,
                       CameraController cameraController)
Create a CameraProcessor for the specified cameraNode.

Parameters:
cameraNode - the cameraNode this processor will manipulate
Method Detail

initialize

public void initialize()
Specified by:
initialize in class org.jdesktop.mtgame.ProcessorComponent

viewMoved

public void viewMoved(CellTransform worldTransform)
The view cell has moved, update the camera position. This must be called from a commit or compute thread.

Parameters:
worldTransform - the worldTransform of the view cell

commit

public void commit(org.jdesktop.mtgame.ProcessorArmingCollection p)
Specified by:
commit in class org.jdesktop.mtgame.ProcessorComponent

compute

public void compute(org.jdesktop.mtgame.ProcessorArmingCollection p)
Specified by:
compute in class org.jdesktop.mtgame.ProcessorComponent

setCameraController

public void setCameraController(CameraController cameraController)
Set the camera controller. Note this call will return immediately but the camera controller will not be applied to the system until the next frame is rendererd, the change is applied in the compute method of this processor.

Parameters:
cameraController -

getCameraController

public CameraController getCameraController()
Return the camera controller. This method returns the most recently set cameraController, which may not be the controller being used this frame. CameraController changes are applied in the processor commit method, this method will return the most recently set camera controller, the application of which may still be pending.

Returns:


Open Wonderland - http://openwonderland.org