Class SpatialCamera

java.lang.Object
com.eco.bio7.spatial.SpatialCamera

public class SpatialCamera extends Object
This class offers methods to adjust a custom camera and methods to get camera coordinates (walk-through camera).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Copies the camera rotated with the mouse to the main view camera (the same view, then the position and the look at can be changed).
    static void
    Copies the position and the look at of the walkthrough (or flythrough) camera to the custom camera, with the coordinates of the walkthrough (the same view, also when the walkthrough is disabled).
    static void
    Copies the position and the look at of the walkthrough (or flythrough) camera to the main view camera, with the coordinates of the walkthrough.
    static void
    Copies the position and the look at of the walkthrough (or flythrough) camera to the camera of the split view, with the coordinates of the walkthrough.
    static double[]
    Returns the position and the look at of the custom camera.
    static double[]
    Returns the position and the look at of the main view camera.
    static double[]
    Returns the position and the look at of the camera of the split view.
    static double[]
    Returns the position and the look at of the camera rotated with the mouse (the normal camera, looking at the center).
    static double[]
    Returns the position and the look at of the walkthrough (and flythrough) camera.
    static double
    This method returns the x-position of the camera (the walkthrough camera).
    static double
    This method returns the y-position of the camera.
    static double
    This method returns the z-position of the camera.
    static boolean
    Returns true if the custom camera is displayed in the main view (see setCustomCameraInMainView).
    static boolean
    Returns true if the coordinates of the custom camera are in the space of the walkthrough.
    static boolean
    Returns true if the main view camera is used.
    static boolean
    Returns true if the coordinates of the split view camera are in the space of the walkthrough.
    static void
    setCustomCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
    A method to adjust the custom camera coordinates in the Spatial view.
    static void
    setCustomCameraInMainView(boolean mainView)
    Displays the custom camera in the main view.
    static void
    setCustomCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
    The coordinates of the custom camera are in the space of the walkthrough: the scene is shown like in the walkthrough (without the rotation of the mouse and without the centering of the data).
    static void
    setMainCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
    Sets the camera of the main view (see setMainCameraEnabled).
    static void
    setMainCameraEnabled(boolean enabled)
    Uses the camera of the main view (see setMainCamera) instead of the camera rotated with the mouse: another perspective without a rotation of the world (e.g., with the custom camera in the small view of the split view).
    static void
    setMainCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
    The coordinates of the main view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).
    static void
    setSplitCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
    Sets the camera of the split view (the small view if the custom camera is not used there).
    static void
    setSplitCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
    The coordinates of the split view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpatialCamera

      public SpatialCamera()
  • Method Details

    • setCustomCamera

      public static void setCustomCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
      A method to adjust the custom camera coordinates in the Spatial view.
      Parameters:
      xpos - the x-position of the camera.
      ypos - the y-position of the camera.
      zpos - the z-position of the camera.
      xlook - the x look at coordinate.
      ylook - the y look at coordinate.
      zlook - the z look at coordinate.
    • getXCamPos

      public static double getXCamPos()
      This method returns the x-position of the camera (the walkthrough camera).
      Returns:
      the x-position as a double.
    • getYCamPos

      public static double getYCamPos()
      This method returns the y-position of the camera.
      Returns:
      the y-position as a double.
    • getZCamPos

      public static double getZCamPos()
      This method returns the z-position of the camera.
      Returns:
      the z-position as a double.
    • setCustomCameraInMainView

      public static void setCustomCameraInMainView(boolean mainView)
      Displays the custom camera in the main view. With the split view the small view then shows the normal camera (rotated with the mouse). Else (the default) the custom camera is displayed in the small view of the split view. Without the split view the custom camera is always displayed in the view.
      Parameters:
      mainView - true for the main view
    • isCustomCameraInMainView

      public static boolean isCustomCameraInMainView()
      Returns true if the custom camera is displayed in the main view (see setCustomCameraInMainView).
      Returns:
      true for the main view
    • getCustomCamera

      public static double[] getCustomCamera()
      Returns the position and the look at of the custom camera.
      Returns:
      x, y, z of the position and x, y, z of the look at
    • setCustomCameraWalkthroughCoordinates

      public static void setCustomCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
      The coordinates of the custom camera are in the space of the walkthrough: the scene is shown like in the walkthrough (without the rotation of the mouse and without the centering of the data). Set by copyWalkthroughToCustomCamera.
      Parameters:
      walkthroughCoordinates - true for the coordinates of the walkthrough
    • isCustomCameraWalkthroughCoordinates

      public static boolean isCustomCameraWalkthroughCoordinates()
      Returns true if the coordinates of the custom camera are in the space of the walkthrough.
      Returns:
      true for the coordinates of the walkthrough
    • setSplitCamera

      public static void setSplitCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
      Sets the camera of the split view (the small view if the custom camera is not used there).
      Parameters:
      xpos - the x-position of the camera
      ypos - the y-position of the camera
      zpos - the z-position of the camera
      xlook - the x look at coordinate
      ylook - the y look at coordinate
      zlook - the z look at coordinate
    • getSplitCamera

      public static double[] getSplitCamera()
      Returns the position and the look at of the camera of the split view.
      Returns:
      x, y, z of the position and x, y, z of the look at (null if the 3D view is not opened)
    • setSplitCameraWalkthroughCoordinates

      public static void setSplitCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
      The coordinates of the split view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).
      Parameters:
      walkthroughCoordinates - true for the coordinates of the walkthrough
    • isSplitCameraWalkthroughCoordinates

      public static boolean isSplitCameraWalkthroughCoordinates()
      Returns true if the coordinates of the split view camera are in the space of the walkthrough.
      Returns:
      true for the coordinates of the walkthrough
    • getWalkthroughCamera

      public static double[] getWalkthroughCamera()
      Returns the position and the look at of the walkthrough (and flythrough) camera.
      Returns:
      x, y, z of the position and x, y, z of the look at (null if the 3D view is not opened)
    • copyWalkthroughToCustomCamera

      public static void copyWalkthroughToCustomCamera()
      Copies the position and the look at of the walkthrough (or flythrough) camera to the custom camera, with the coordinates of the walkthrough (the same view, also when the walkthrough is disabled).
    • copyWalkthroughToSplitCamera

      public static void copyWalkthroughToSplitCamera()
      Copies the position and the look at of the walkthrough (or flythrough) camera to the camera of the split view, with the coordinates of the walkthrough.
    • setMainCameraEnabled

      public static void setMainCameraEnabled(boolean enabled)
      Uses the camera of the main view (see setMainCamera) instead of the camera rotated with the mouse: another perspective without a rotation of the world (e.g., with the custom camera in the small view of the split view). The custom camera has priority if it is displayed in the main view.
      Parameters:
      enabled - true to use the main view camera
    • isMainCameraEnabled

      public static boolean isMainCameraEnabled()
      Returns true if the main view camera is used.
      Returns:
      true if the main view camera is enabled
    • setMainCamera

      public static void setMainCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook)
      Sets the camera of the main view (see setMainCameraEnabled).
      Parameters:
      xpos - the x-position of the camera
      ypos - the y-position of the camera
      zpos - the z-position of the camera
      xlook - the x look at coordinate
      ylook - the y look at coordinate
      zlook - the z look at coordinate
    • getMainCamera

      public static double[] getMainCamera()
      Returns the position and the look at of the main view camera.
      Returns:
      x, y, z of the position and x, y, z of the look at (null if the 3D view is not opened)
    • setMainCameraWalkthroughCoordinates

      public static void setMainCameraWalkthroughCoordinates(boolean walkthroughCoordinates)
      The coordinates of the main view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).
      Parameters:
      walkthroughCoordinates - true for the coordinates of the walkthrough
    • getViewCamera

      public static double[] getViewCamera()
      Returns the position and the look at of the camera rotated with the mouse (the normal camera, looking at the center).
      Returns:
      x, y, z of the position and x, y, z of the look at (null if the 3D view is not opened)
    • copyViewToMainCamera

      public static void copyViewToMainCamera()
      Copies the camera rotated with the mouse to the main view camera (the same view, then the position and the look at can be changed).
    • copyWalkthroughToMainCamera

      public static void copyWalkthroughToMainCamera()
      Copies the position and the look at of the walkthrough (or flythrough) camera to the main view camera, with the coordinates of the walkthrough.