com.jme.scene
Class CameraNode

java.lang.Object
  extended bycom.jme.scene.Spatial
      extended bycom.jme.scene.Node
          extended bycom.jme.scene.CameraNode
All Implemented Interfaces:
java.io.Serializable

public class CameraNode
extends Node

CameraNode defines a node that contains a camera object. This allows a camera to be controlled by any other node, and allows the camera to be attached to any node. A call to updateWorldData will adjust the camera's frame by the world translation and the world rotation. The column 0 of the world rotation matrix is used for the camera left vector, column 1 is used for the camera up vector, column 2 is used for the camera direction vector.

Version:
$Id: CameraNode.java,v 1.5 2004/09/14 21:52:13 mojomonkey Exp $
Author:
Mark Powell
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.Node
children
 
Fields inherited from class com.jme.scene.Spatial
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
CameraNode(java.lang.String name, Camera camera)
          Constructor instantiates a new CameraNode object setting the camera to use for the frame reference.
 
Method Summary
 Camera getCamera()
          getCamera retrieves the camera object that this node controls.
 void setCamera(Camera camera)
          setCamera sets the camera that this node controls.
 void updateWorldData(float time)
          updateWorldData updates the rotation and translation of this node, and sets the camera's frame buffer to reflect the current view.
 
Methods inherited from class com.jme.scene.Node
applyRenderState, attachChild, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, drawBounds, findCollisions, findPick, getChild, getChild, getChildren, getQuantity, hasChild, hasCollision, putClone, setChild, setForceView, updateCollisionTree, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, isForceCulled, isForceView, onDraw, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, setZOrder, toString, updateGeometricState, updateRenderState, updateRenderState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CameraNode

public CameraNode(java.lang.String name,
                  Camera camera)
Constructor instantiates a new CameraNode object setting the camera to use for the frame reference.

Parameters:
name - the name of the scene element. This is required for identification and comparision purposes.
camera - the camera this node controls.
Method Detail

setCamera

public void setCamera(Camera camera)
setCamera sets the camera that this node controls.

Parameters:
camera - the camera that this node controls.

getCamera

public Camera getCamera()
getCamera retrieves the camera object that this node controls.

Returns:
the camera this node controls.

updateWorldData

public void updateWorldData(float time)
updateWorldData updates the rotation and translation of this node, and sets the camera's frame buffer to reflect the current view.

Overrides:
updateWorldData in class Node
Parameters:
time - the time between frames.