us.ihmc.graphics3DAdapter.camera
Class ClassicCameraController

java.lang.Object
  extended by us.ihmc.graphics3DAdapter.camera.ClassicCameraController
All Implemented Interfaces:
CameraController, CameraPropertiesHolder, TrackingDollyCameraController, KeyListener, MouseListener, SelectedListener

public class ClassicCameraController
extends java.lang.Object
implements TrackingDollyCameraController, KeyListener, MouseListener, SelectedListener


Field Summary
static double MAX_FIELD_OF_VIEW
           
static double MIN_FIELD_OF_VIEW
           
 
Constructor Summary
ClassicCameraController(Graphics3DAdapter graphics3dAdapter, ViewportAdapter viewportAdapter, CameraTrackingAndDollyPositionHolder cameraTrackAndDollyVariablesHolder)
           
 
Method Summary
 void addKeyFrame(int time)
           
 void addKeyFrame(int i, int time)
           
 void computeTransform(javax.media.j3d.Transform3D currXform)
           
 void copyPositionTrackingDollyConfiguration(TrackingDollyCameraController otherCamera)
           
static ClassicCameraController createClassicCameraControllerAndAddListeners(ViewportAdapter viewportAdapter, CameraTrackingAndDollyPositionHolder cameraTrackAndDollyVariablesHolder, Graphics3DAdapter graphics3dAdapter)
           
 void doMouseDraggedLeft(double dx, double dy)
           
 void doMouseDraggedMiddle(double dx, double dy)
           
 void doMouseDraggedRight(double dx, double dy)
           
 CameraMountInterface getCameraMount()
           
 CameraTrackingAndDollyPositionHolder getCameraTrackAndDollyVariablesHolder()
           
 double getCamX()
           
 double getCamY()
           
 double getCamZ()
           
 double getClipFar()
           
 double getClipNear()
           
 double getDollyXOffset()
           
 double getDollyXVar()
           
 double getDollyYOffset()
           
 double getDollyYVar()
           
 double getDollyZOffset()
           
 double getDollyZVar()
           
 double getFixX()
           
 double getFixY()
           
 double getFixZ()
           
 double getHorizontalFieldOfViewInRadians()
           
 double getTrackingXOffset()
           
 double getTrackingYOffset()
           
 double getTrackingZOffset()
           
 double getTrackXVar()
           
 double getTrackYVar()
           
 double getTrackZVar()
           
 void gotoKey(int index)
           
 boolean isDolly()
           
 boolean isDollyX()
           
 boolean isDollyY()
           
 boolean isDollyZ()
           
 boolean isMounted()
           
 boolean isTracking()
           
 boolean isTrackingX()
           
 boolean isTrackingY()
           
 boolean isTrackingZ()
           
 void keyPressed(Key key)
           
 void keyReleased(Key key)
           
 void mouseDragged(MouseButton mouseButton, double dx, double dy)
           
 void nextCameraKeyPoint(int time)
           
 void nextStoredPosition()
           
 void pan(double dx, double dy)
           
 void previousCameraKeyPoint(int time)
           
 void previousStoredPosition()
           
 void removeCameraKeyPoint(int time)
           
 void removeKeyFrameByIndex(int i)
           
 int removeKeyFrameByTime(int time)
           
 void reset()
           
 void selected(Graphics3DNode graphics3dNode, ModifierKeyInterface modifierKeyHolder, javax.vecmath.Point3d location, javax.vecmath.Point3d cameraLocation, javax.vecmath.Quat4d cameraRotation)
          This function is called when a point on the screen is selected while holding the modifier key defined with getModifierKey()
 boolean setCameraKeyPoint(int time)
           
 void setCameraMount(CameraMountInterface mount)
           
 void setCameraPosition(double cx, double cy, double cz)
           
 void setCamX(double cx)
           
 void setCamY(double cy)
           
 void setCamZ(double cz)
           
 void setClipDistanceFar(double far)
           
 void setClipDistanceNear(double near)
           
 void setConfiguration(CameraConfiguration config, CameraMountList mountList)
           
 void setDolly(boolean dolly)
           
 void setDolly(boolean dolly, boolean dollyX, boolean dollyY, boolean dollyZ)
           
 void setDollyOffsets(double dx, double dy, double dz)
           
 void setDollyX(boolean dollyX)
           
 void setDollyXOffset(double dx)
           
 void setDollyY(boolean dollyY)
           
 void setDollyYOffset(double dy)
           
 void setDollyZ(boolean dollyZ)
           
 void setDollyZOffset(double dz)
           
 void setFieldOfView(double fov)
           
 void setFixPosition(double fx, double fy, double fz)
           
 void setFixX(double fx)
           
 void setFixY(double fy)
           
 void setFixZ(double fz)
           
 void setKeyFrameTime(int time)
           
 void setTracking(boolean track)
           
 void setTracking(boolean track, boolean trackX, boolean trackY, boolean trackZ)
           
 void setTrackingOffsets(double dx, double dy, double dz)
           
 void setTrackingX(boolean trackX)
           
 void setTrackingXOffset(double dx)
           
 void setTrackingY(boolean trackY)
           
 void setTrackingYOffset(double dy)
           
 void setTrackingZ(boolean trackZ)
           
 void setTrackingZOffset(double dz)
           
 void setUseCameraKeyPoints(boolean use)
           
 void storePosition()
           
 void toggleCameraKeyMode()
           
 void update()
           
 boolean useKeyCameraPoints()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_FIELD_OF_VIEW

public static final double MIN_FIELD_OF_VIEW
See Also:
Constant Field Values

MAX_FIELD_OF_VIEW

public static final double MAX_FIELD_OF_VIEW
See Also:
Constant Field Values
Constructor Detail

ClassicCameraController

public ClassicCameraController(Graphics3DAdapter graphics3dAdapter,
                               ViewportAdapter viewportAdapter,
                               CameraTrackingAndDollyPositionHolder cameraTrackAndDollyVariablesHolder)
Method Detail

createClassicCameraControllerAndAddListeners

public static ClassicCameraController createClassicCameraControllerAndAddListeners(ViewportAdapter viewportAdapter,
                                                                                   CameraTrackingAndDollyPositionHolder cameraTrackAndDollyVariablesHolder,
                                                                                   Graphics3DAdapter graphics3dAdapter)

setCameraMount

public void setCameraMount(CameraMountInterface mount)

getCameraMount

public CameraMountInterface getCameraMount()

isMounted

public boolean isMounted()

getCameraTrackAndDollyVariablesHolder

public CameraTrackingAndDollyPositionHolder getCameraTrackAndDollyVariablesHolder()
Specified by:
getCameraTrackAndDollyVariablesHolder in interface TrackingDollyCameraController

setConfiguration

public void setConfiguration(CameraConfiguration config,
                             CameraMountList mountList)
Specified by:
setConfiguration in interface TrackingDollyCameraController

isTracking

public boolean isTracking()
Specified by:
isTracking in interface CameraPropertiesHolder

isTrackingX

public boolean isTrackingX()
Specified by:
isTrackingX in interface CameraPropertiesHolder

isTrackingY

public boolean isTrackingY()
Specified by:
isTrackingY in interface CameraPropertiesHolder

isTrackingZ

public boolean isTrackingZ()
Specified by:
isTrackingZ in interface CameraPropertiesHolder

isDolly

public boolean isDolly()
Specified by:
isDolly in interface CameraPropertiesHolder

isDollyX

public boolean isDollyX()
Specified by:
isDollyX in interface CameraPropertiesHolder

isDollyY

public boolean isDollyY()
Specified by:
isDollyY in interface CameraPropertiesHolder

isDollyZ

public boolean isDollyZ()
Specified by:
isDollyZ in interface CameraPropertiesHolder

setTracking

public void setTracking(boolean track,
                        boolean trackX,
                        boolean trackY,
                        boolean trackZ)
Specified by:
setTracking in interface TrackingDollyCameraController

setDolly

public void setDolly(boolean dolly,
                     boolean dollyX,
                     boolean dollyY,
                     boolean dollyZ)
Specified by:
setDolly in interface TrackingDollyCameraController

setTrackingOffsets

public void setTrackingOffsets(double dx,
                               double dy,
                               double dz)
Specified by:
setTrackingOffsets in interface TrackingDollyCameraController

setDollyOffsets

public void setDollyOffsets(double dx,
                            double dy,
                            double dz)
Specified by:
setDollyOffsets in interface TrackingDollyCameraController

setTracking

public void setTracking(boolean track)
Specified by:
setTracking in interface CameraPropertiesHolder

setTrackingX

public void setTrackingX(boolean trackX)
Specified by:
setTrackingX in interface CameraPropertiesHolder

setTrackingY

public void setTrackingY(boolean trackY)
Specified by:
setTrackingY in interface CameraPropertiesHolder

setTrackingZ

public void setTrackingZ(boolean trackZ)
Specified by:
setTrackingZ in interface CameraPropertiesHolder

setDolly

public void setDolly(boolean dolly)
Specified by:
setDolly in interface CameraPropertiesHolder

setDollyX

public void setDollyX(boolean dollyX)
Specified by:
setDollyX in interface CameraPropertiesHolder

setDollyY

public void setDollyY(boolean dollyY)
Specified by:
setDollyY in interface CameraPropertiesHolder

setDollyZ

public void setDollyZ(boolean dollyZ)
Specified by:
setDollyZ in interface CameraPropertiesHolder

getTrackingXOffset

public double getTrackingXOffset()
Specified by:
getTrackingXOffset in interface CameraPropertiesHolder

getTrackingYOffset

public double getTrackingYOffset()
Specified by:
getTrackingYOffset in interface CameraPropertiesHolder

getTrackingZOffset

public double getTrackingZOffset()
Specified by:
getTrackingZOffset in interface CameraPropertiesHolder

getDollyXOffset

public double getDollyXOffset()
Specified by:
getDollyXOffset in interface CameraPropertiesHolder

getDollyYOffset

public double getDollyYOffset()
Specified by:
getDollyYOffset in interface CameraPropertiesHolder

getDollyZOffset

public double getDollyZOffset()
Specified by:
getDollyZOffset in interface CameraPropertiesHolder

setTrackingXOffset

public void setTrackingXOffset(double dx)
Specified by:
setTrackingXOffset in interface CameraPropertiesHolder

setTrackingYOffset

public void setTrackingYOffset(double dy)
Specified by:
setTrackingYOffset in interface CameraPropertiesHolder

setTrackingZOffset

public void setTrackingZOffset(double dz)
Specified by:
setTrackingZOffset in interface CameraPropertiesHolder

setDollyXOffset

public void setDollyXOffset(double dx)
Specified by:
setDollyXOffset in interface CameraPropertiesHolder

setDollyYOffset

public void setDollyYOffset(double dy)
Specified by:
setDollyYOffset in interface CameraPropertiesHolder

setDollyZOffset

public void setDollyZOffset(double dz)
Specified by:
setDollyZOffset in interface CameraPropertiesHolder

update

public void update()
Specified by:
update in interface CameraPropertiesHolder

addKeyFrame

public void addKeyFrame(int time)

addKeyFrame

public void addKeyFrame(int i,
                        int time)

removeKeyFrameByTime

public int removeKeyFrameByTime(int time)

removeKeyFrameByIndex

public void removeKeyFrameByIndex(int i)

setKeyFrameTime

public void setKeyFrameTime(int time)
Specified by:
setKeyFrameTime in interface TrackingDollyCameraController

gotoKey

public void gotoKey(int index)

getFixX

public double getFixX()
Specified by:
getFixX in interface CameraPropertiesHolder

getFixY

public double getFixY()
Specified by:
getFixY in interface CameraPropertiesHolder

getFixZ

public double getFixZ()
Specified by:
getFixZ in interface CameraPropertiesHolder

getCamX

public double getCamX()
Specified by:
getCamX in interface CameraPropertiesHolder

getCamY

public double getCamY()
Specified by:
getCamY in interface CameraPropertiesHolder

getCamZ

public double getCamZ()
Specified by:
getCamZ in interface CameraPropertiesHolder

setFixX

public void setFixX(double fx)
Specified by:
setFixX in interface CameraPropertiesHolder

setFixY

public void setFixY(double fy)
Specified by:
setFixY in interface CameraPropertiesHolder

setFixZ

public void setFixZ(double fz)
Specified by:
setFixZ in interface CameraPropertiesHolder

setCamX

public void setCamX(double cx)
Specified by:
setCamX in interface CameraPropertiesHolder

setCamY

public void setCamY(double cy)
Specified by:
setCamY in interface CameraPropertiesHolder

setCamZ

public void setCamZ(double cz)
Specified by:
setCamZ in interface CameraPropertiesHolder

setFixPosition

public void setFixPosition(double fx,
                           double fy,
                           double fz)
Specified by:
setFixPosition in interface TrackingDollyCameraController

setCameraPosition

public void setCameraPosition(double cx,
                              double cy,
                              double cz)
Specified by:
setCameraPosition in interface TrackingDollyCameraController

doMouseDraggedLeft

public void doMouseDraggedLeft(double dx,
                               double dy)

doMouseDraggedRight

public void doMouseDraggedRight(double dx,
                                double dy)

setFieldOfView

public void setFieldOfView(double fov)
Specified by:
setFieldOfView in interface CameraPropertiesHolder

doMouseDraggedMiddle

public void doMouseDraggedMiddle(double dx,
                                 double dy)

pan

public void pan(double dx,
                double dy)

toggleCameraKeyMode

public void toggleCameraKeyMode()
Specified by:
toggleCameraKeyMode in interface TrackingDollyCameraController

setUseCameraKeyPoints

public void setUseCameraKeyPoints(boolean use)
Specified by:
setUseCameraKeyPoints in interface TrackingDollyCameraController

useKeyCameraPoints

public boolean useKeyCameraPoints()
Specified by:
useKeyCameraPoints in interface TrackingDollyCameraController

setCameraKeyPoint

public boolean setCameraKeyPoint(int time)
Specified by:
setCameraKeyPoint in interface TrackingDollyCameraController

nextCameraKeyPoint

public void nextCameraKeyPoint(int time)
Specified by:
nextCameraKeyPoint in interface TrackingDollyCameraController

previousCameraKeyPoint

public void previousCameraKeyPoint(int time)
Specified by:
previousCameraKeyPoint in interface TrackingDollyCameraController

removeCameraKeyPoint

public void removeCameraKeyPoint(int time)
Specified by:
removeCameraKeyPoint in interface TrackingDollyCameraController

getTrackXVar

public double getTrackXVar()
Specified by:
getTrackXVar in interface CameraPropertiesHolder

getTrackYVar

public double getTrackYVar()
Specified by:
getTrackYVar in interface CameraPropertiesHolder

getTrackZVar

public double getTrackZVar()
Specified by:
getTrackZVar in interface CameraPropertiesHolder

getDollyXVar

public double getDollyXVar()
Specified by:
getDollyXVar in interface CameraPropertiesHolder

getDollyYVar

public double getDollyYVar()
Specified by:
getDollyYVar in interface CameraPropertiesHolder

getDollyZVar

public double getDollyZVar()
Specified by:
getDollyZVar in interface CameraPropertiesHolder

nextStoredPosition

public void nextStoredPosition()

previousStoredPosition

public void previousStoredPosition()

storePosition

public void storePosition()

reset

public void reset()
Specified by:
reset in interface TrackingDollyCameraController

computeTransform

public void computeTransform(javax.media.j3d.Transform3D currXform)
Specified by:
computeTransform in interface CameraController

keyPressed

public void keyPressed(Key key)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(Key key)
Specified by:
keyReleased in interface KeyListener

selected

public void selected(Graphics3DNode graphics3dNode,
                     ModifierKeyInterface modifierKeyHolder,
                     javax.vecmath.Point3d location,
                     javax.vecmath.Point3d cameraLocation,
                     javax.vecmath.Quat4d cameraRotation)
Description copied from interface: SelectedListener
This function is called when a point on the screen is selected while holding the modifier key defined with getModifierKey()

Specified by:
selected in interface SelectedListener
Parameters:
graphics3dNode - The node that was selected, null if none selected
location - location of the selected point
cameraLocation - camera position
cameraRotation - camera view direction

mouseDragged

public void mouseDragged(MouseButton mouseButton,
                         double dx,
                         double dy)
Specified by:
mouseDragged in interface MouseListener

getClipNear

public double getClipNear()
Specified by:
getClipNear in interface CameraController

getClipFar

public double getClipFar()
Specified by:
getClipFar in interface CameraController

getHorizontalFieldOfViewInRadians

public double getHorizontalFieldOfViewInRadians()
Specified by:
getHorizontalFieldOfViewInRadians in interface CameraController

setClipDistanceNear

public void setClipDistanceNear(double near)
Specified by:
setClipDistanceNear in interface CameraPropertiesHolder

setClipDistanceFar

public void setClipDistanceFar(double far)
Specified by:
setClipDistanceFar in interface CameraPropertiesHolder

copyPositionTrackingDollyConfiguration

public void copyPositionTrackingDollyConfiguration(TrackingDollyCameraController otherCamera)
Specified by:
copyPositionTrackingDollyConfiguration in interface TrackingDollyCameraController