Package com.ardor3d.scenegraph.extension
Class CameraNode
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.scenegraph.extension.CameraNode
Defines a node that manages a
Camera
object, allowing it to be part of a scenegraph. The updateWorldTransform
method is overridden to adjust the managed camera's location and orientation using this Node's 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.-
Field Summary
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
ConstructorDescriptionCameraNode
(String name, Camera camera) Constructor instantiates a newCameraNode
object setting the camera to use for the frame reference. -
Method Summary
Modifier and TypeMethodDescriptiongetCamera
retrieves the camera object that this node controls.void
read
(InputCapsule capsule) void
setCamera
sets the camera that this node controls.void
Forces rotation and translation of this node to be sync'd with the attached camera.void
updateWorldTransform
(boolean recurse) updateWorldTransform
updates the rotation and translation of this node, and sets the camera's frame buffer to reflect the current view.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.Node
acceptVisitor, attachChild, attachChildAt, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, sortLights, swapChildren, updateChildren, updateWorldBound, updateWorldRenderStates
Methods inherited from class com.ardor3d.scenegraph.Spatial
addController, addTranslation, addTranslation, applyWorldRenderStates, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, worldToLocal
-
Constructor Details
-
CameraNode
public CameraNode() -
CameraNode
Constructor instantiates a newCameraNode
object setting the camera to use for the frame reference.- Parameters:
name
- the name of the scene element. This is required for identification and comparison purposes.camera
- the camera this node controls.
-
-
Method Details
-
updateFromCamera
public void updateFromCamera()Forces rotation and translation of this node to be sync'd with the attached camera. (Assumes the node is in world space.) -
setCamera
setCamera
sets the camera that this node controls.- Parameters:
camera
- the camera that this node controls.
-
getCamera
getCamera
retrieves the camera object that this node controls.- Returns:
- the camera this node controls.
-
updateWorldTransform
public void updateWorldTransform(boolean recurse) updateWorldTransform
updates the rotation and translation of this node, and sets the camera's frame buffer to reflect the current view.- Overrides:
updateWorldTransform
in classNode
- Parameters:
recurse
- usually false when updating the tree. Set to true when you just want to update the world transforms for a branch without updating geometric state.
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classNode
- Parameters:
capsule
- the capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classNode
- Parameters:
capsule
- the input capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-