yaarq.sys
Class yrqViewport

java.lang.Object
  |
  +--yaarq.sys.yrqViewport

public class yrqViewport
extends java.lang.Object

This class is used tby the engine to encapsule all Java3D viewport related objects and properties and to provide camera control without the need for external handling of transforms etc. The viewport is instantiated exactly once at engine initialisation. Calling applications have access to the camera control methods.

TODO: Add methods for other than target-based navigation, add ability to change basic viewport paramters like fov, finish documentation, IMPORTANT: Override (?) frame to allow for detach/attach viewport branch to allow intermediate changes to viewport objects (standard frames dont do this!!!)


Constructor Summary
yrqViewport(yrqEngine a_engine)
          This constructor initialises the viewport.
 
Method Summary
 javax.vecmath.Point3d getCamera()
          ...
 yrqFrame getFrame()
          This function returns the frame used by the viewport to provide positional and orientation information.
 javax.vecmath.Point3d getTarget()
          ...
 javax.media.j3d.View getView()
          This function is called by various internal classes of the engine to determine the view object of the viewport.
 void setCamera(javax.vecmath.Point3d a_position)
          ...
 void setTarget(javax.vecmath.Point3d a_position)
          ...
 void update()
          This method is called by the engine regulary to update flare visuals added to the viewport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

yrqViewport

public yrqViewport(yrqEngine a_engine)
This constructor initialises the viewport. THe engine automatically instantiates a viewort on initialisation.

Parameters:
a_engine - The engine instance
Method Detail

getCamera

public javax.vecmath.Point3d getCamera()
...

Returns:
The current location of the camera within the world

getFrame

public yrqFrame getFrame()
This function returns the frame used by the viewport to provide positional and orientation information. FlareVisuals and OverlayVisuals should exclusively be attached to this frame to ensure they function properly.

Applications can use this frame to create camera paths by setting animations to it.

Returns:
The frame associated with the viewport

getTarget

public javax.vecmath.Point3d getTarget()
...

Returns:
The current location of the camera target within the world

getView

public javax.media.j3d.View getView()
This function is called by various internal classes of the engine to determine the view object of the viewport.

Returns:
The view associated with the viewport

setCamera

public void setCamera(javax.vecmath.Point3d a_position)
...

Parameters:
a_position - The position at which the camera should be placed

setTarget

public void setTarget(javax.vecmath.Point3d a_position)
...


update

public void update()
This method is called by the engine regulary to update flare visuals added to the viewport