Package WildMagic.LibGraphics.SceneGraph
Class CameraNode
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.SceneGraph.Spatial
-
- WildMagic.LibGraphics.SceneGraph.Node
-
- WildMagic.LibGraphics.SceneGraph.CameraNode
-
- All Implemented Interfaces:
java.io.Serializable
,NameIdInterface
,StreamInterface
public class CameraNode extends Node implements NameIdInterface, StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Spatial.CullingMode
-
-
Field Summary
Fields Modifier and Type Field Description protected Camera
m_spkCamera
Camera contained in this node.private static long
serialVersionUID
-
Fields inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Culling, Local, m_iStartEffect, m_kEffects, m_kGlobalStates, m_kLights, m_pkParent, World, WorldBound, WorldBoundIsCurrent, WorldIsCurrent
-
-
Constructor Summary
Constructors Constructor Description CameraNode()
Construction and destruction.CameraNode(Camera pkCamera)
Construction and destruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
GetAllObjectsByName(java.lang.String rkName, java.util.Vector<GraphicsObject> rkObjects)
Writes all GraphicsObjects with the name that matches the input parameter, rkName into the Vector parameter rkObjects.Camera
GetCamera()
Return camera contained in this node.int
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.GraphicsObject
GetObjectByID(int uiID)
Returns the GraphicsObject with the ID that matches the input parameter, uiID.GraphicsObject
GetObjectByName(java.lang.String rkName)
Returns the GraphicsObject with the name that matches the input parameter, rkName.void
Link(Stream rkStream, Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.void
Load(Stream rkStream, Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.boolean
Register(Stream rkStream)
Registers this object with the input Stream parameter.void
Save(Stream rkStream)
Write this object and all it's children to the Stream.StringTree
SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.void
SetCamera(Camera pkCamera)
When you set the camera, the node's local transformation is set to the camera's current current coordinate system.void
UpdateWorldData(double dAppTime)
geometric updates-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.Node
AttachChild, DetachAllChildren, DetachChild, DetachChildAt, dispose, GetChild, GetQuantity, GetVisibleSet, SetChild, UpdateState, UpdateWorldBound
-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
AttachEffect, AttachGlobalState, AttachLight, DetachAllEffects, DetachAllGlobalStates, DetachAllLights, DetachEffect, DetachGlobalState, DetachLight, GetEffect, GetEffectQuantity, GetGlobalState, GetGlobalState, GetGlobalStateQuantity, GetLight, GetLightQuantity, GetParent, GetStartEffect, OnGetVisibleSet, PopState, PropagateBoundToRoot, PropagateStateFromRoot, PushState, SetParent, SetStartEffect, UpdateBS, UpdateGS, UpdateGS, UpdateRS, UpdateRS
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_spkCamera
protected Camera m_spkCamera
Camera contained in this node.
-
-
Constructor Detail
-
CameraNode
public CameraNode()
Construction and destruction. The node's world translation is used as the camera's location. The node's world rotation matrix is used for the camera's coordinate axes. Column 0 of the world rotation matrix is the camera's direction vector, column 1 of the world rotation matrix is the camera's up vector, and column 2 of the world rotation matrix is the camera's right vector. On construction, the node's local transformation is set to the camera's current coordinate system. local translation = camera location local rotation column 0 = camera direction local rotation column 1 = camera up local rotation column 2 = camera right
-
CameraNode
public CameraNode(Camera pkCamera)
Construction and destruction. The node's world translation is used as the camera's location. The node's world rotation matrix is used for the camera's coordinate axes. Column 0 of the world rotation matrix is the camera's direction vector, column 1 of the world rotation matrix is the camera's up vector, and column 2 of the world rotation matrix is the camera's right vector. On construction, the node's local transformation is set to the camera's current coordinate system. local translation = camera location local rotation column 0 = camera direction local rotation column 1 = camera up local rotation column 2 = camera right- Parameters:
pkCamera
- new Camera.
-
-
Method Detail
-
GetAllObjectsByName
public void GetAllObjectsByName(java.lang.String rkName, java.util.Vector<GraphicsObject> rkObjects)
Writes all GraphicsObjects with the name that matches the input parameter, rkName into the Vector parameter rkObjects.- Specified by:
GetAllObjectsByName
in interfaceNameIdInterface
- Overrides:
GetAllObjectsByName
in classNode
- Parameters:
rkName
- the name of the objects to return.rkObjects
- a Vector of all objects with the matching name.
-
GetCamera
public final Camera GetCamera()
Return camera contained in this node.- Returns:
- camera contained in this node.
-
GetDiskUsed
public int GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.- Specified by:
GetDiskUsed
in interfaceStreamInterface
- Overrides:
GetDiskUsed
in classNode
- Parameters:
rkVersion
- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetObjectByID
public GraphicsObject GetObjectByID(int uiID)
Returns the GraphicsObject with the ID that matches the input parameter, uiID.- Specified by:
GetObjectByID
in interfaceNameIdInterface
- Overrides:
GetObjectByID
in classNode
- Parameters:
uiID
- the ID of the object to return.- Returns:
- the GraphicsObject that matches the input name.
-
GetObjectByName
public GraphicsObject GetObjectByName(java.lang.String rkName)
Returns the GraphicsObject with the name that matches the input parameter, rkName.- Specified by:
GetObjectByName
in interfaceNameIdInterface
- Overrides:
GetObjectByName
in classNode
- Parameters:
rkName
- the name of the object to return.- Returns:
- the GraphicsObject that matches the input name.
-
Link
public void Link(Stream rkStream, Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.- Specified by:
Link
in interfaceStreamInterface
- Overrides:
Link
in classNode
- Parameters:
rkStream
- the Stream where the child objects are stored.pkLink
- the Link class from which the child object IDs are read.
-
Load
public void Load(Stream rkStream, Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.- Specified by:
Load
in interfaceStreamInterface
- Overrides:
Load
in classNode
- Parameters:
rkStream
- the Stream from which this object is being read.pkLink
- the Link class for storing the IDs of this object's children objects.
-
Register
public boolean Register(Stream rkStream)
Registers this object with the input Stream parameter. All objects streamed to disk are registered with the Stream so that a unique list of objects is maintained.- Specified by:
Register
in interfaceStreamInterface
- Overrides:
Register
in classNode
- Parameters:
rkStream
- the Stream where the child objects are stored.- Returns:
- true if this object is registered, false if the object has already been registered.
-
Save
public void Save(Stream rkStream)
Write this object and all it's children to the Stream.- Specified by:
Save
in interfaceStreamInterface
- Overrides:
Save
in classNode
- Parameters:
rkStream
- the Stream where the child objects are stored.
-
SaveStrings
public StringTree SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.- Specified by:
SaveStrings
in interfaceStreamInterface
- Overrides:
SaveStrings
in classNode
- Parameters:
acTitle
- the header for this object in the StringTree.- Returns:
- StringTree containing a String-based representation of this object and it's children.
-
SetCamera
public void SetCamera(Camera pkCamera)
When you set the camera, the node's local transformation is set to the camera's current current coordinate system. The node's world transformation is computed, and the camera's coordinate system is set to use the node's world transformation.- Parameters:
pkCamera
- new Camera.
-
UpdateWorldData
public void UpdateWorldData(double dAppTime)
geometric updates- Overrides:
UpdateWorldData
in classNode
- Parameters:
dAppTime
- animation time step from application.
-
-