Class SpatialCamera
java.lang.Object
com.eco.bio7.spatial.SpatialCamera
This class offers methods to adjust a custom camera and methods to get camera
coordinates (walk-through camera).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCopies 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 voidCopies 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 voidCopies the position and the look at of the walkthrough (or flythrough) camera to the main view camera, with the coordinates of the walkthrough.static voidCopies 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 doubleThis method returns the x-position of the camera (the walkthrough camera).static doubleThis method returns the y-position of the camera.static doubleThis method returns the z-position of the camera.static booleanReturns true if the custom camera is displayed in the main view (see setCustomCameraInMainView).static booleanReturns true if the coordinates of the custom camera are in the space of the walkthrough.static booleanReturns true if the main view camera is used.static booleanReturns true if the coordinates of the split view camera are in the space of the walkthrough.static voidsetCustomCamera(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 voidsetCustomCameraInMainView(boolean mainView) Displays the custom camera in the main view.static voidsetCustomCameraWalkthroughCoordinates(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 voidsetMainCamera(double xpos, double ypos, double zpos, double xlook, double ylook, double zlook) Sets the camera of the main view (see setMainCameraEnabled).static voidsetMainCameraEnabled(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 voidsetMainCameraWalkthroughCoordinates(boolean walkthroughCoordinates) The coordinates of the main view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).static voidsetSplitCamera(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 voidsetSplitCameraWalkthroughCoordinates(boolean walkthroughCoordinates) The coordinates of the split view camera are in the space of the walkthrough (see setCustomCameraWalkthroughCoordinates).
-
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 cameraypos- the y-position of the camerazpos- the z-position of the cameraxlook- the x look at coordinateylook- the y look at coordinatezlook- 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 cameraypos- the y-position of the camerazpos- the z-position of the cameraxlook- the x look at coordinateylook- the y look at coordinatezlook- 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.
-