Interface IScriptingInterface

All Known Implementing Classes:
EventScriptingInterface

public interface IScriptingInterface
Scripting interface. Provides an interface to the Gaia Sandbox core and exposes all the methods that are callable from a script in order to interact with the program (create demonstrations, tutorials, load data, etc.). You should never use any integration other than this interface for scripting.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the current time frame to real time.
    void
    Sets the current time frame to simulation time.
    void
    addPolyline(String name, double[] points, double[] color)
    Adds a new polyline with the given name, points and color.
    void
    addPolyline(String name, double[] points, double[] color, double lineWidth)
    Adds a new polyline with the given name, points, color and line width.
    void
    addPolyline(String name, double[] points, double[] color, double lineWidth, boolean arrowCaps)
    Adds a new polyline with the given name, points, color and line width.
    void
    addPolyline(String name, double[] points, double[] color, double lineWidth, int primitive)
    Adds a new polyline with the given name, points, color, line width and primitive.
    void
    addPolyline(String name, double[] points, double[] color, double lineWidth, int primitive, boolean arrowCaps)
    Adds a new polyline with the given name, points, color, line width, primitive and arrow caps.
    void
    addShapeAroundObject(String shapeName, String shape, String primitive, double size, String objectName, float r, float g, float b, float a, boolean showLabel, boolean trackObject)
    Creates a shape object of the given type with the given size around the object with the given name.
    void
    Centers the camera to the focus, removing any deviation of the line of sight.
    void
    cameraForward(double value)
    Adds a forward movement to the camera with the given value.
    void
    cameraPitch(double amount)
    Adds a pitch to the camera.
    void
    cameraRoll(double roll)
    Adds a roll force to the camera.
    void
    cameraRotate(double deltaX, double deltaY)
    Adds a rotation movement to the camera around the current focus, or a pitch/yaw if in free mode.
    void
    Stops all camera motion.
    void
    cameraTransition(double[] camPos, double[] camDir, double[] camUp, double seconds)
    Creates a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} in the given number of seconds.
    void
    cameraTransition(double[] camPos, double[] camDir, double[] camUp, double seconds, boolean sync)
    Creates a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} in the given number of seconds.
    void
    cameraTransitionKm(double[] camPos, double[] camDir, double[] camUp, double seconds)
    Same as cameraTransition(double[], double[], double[], double) but the camera position is given in Km.
    void
    cameraTurn(double deltaX, double deltaY)
    Adds a turn force to the camera (yaw and/or pitch).
    void
    cameraYaw(double amount)
    Adds a yaw to the camera.
    void
    Clears both the subhead and the headline messages.
    void
    Clears the headline messge.
    void
    Clears the subhead message.
    void
    Collapses the component with the given name.
    void
    configureFrameOutput(int width, int height, double fps, String directory, String namePrefix)
    Configures the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix.
    void
    configureFrameOutput(int width, int height, int fps, String directory, String namePrefix)
    Configures the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix.
    void
    configureRenderOutput(int width, int height, int fps, String directory, String namePrefix)
    void
    configureScreenshots(int width, int height, String directory, String namePrefix)
    Configures the screenshot system, setting the resolution of the images, the output directory and the image name prefix.
    double[]
    cross3(double[] vec1, double[] vec2)
    Computes the cross product between the two 3D vectors.
    void
    Disables the GUI rendering.
    void
    Disables all input events from mouse, keyboard, touchscreen, etc.
    void
    displayImageObject(int id, String path, double x, double y, double[] color)
    Same as displayImageObject(int, String, float, float, float, float, float, float) but using a double array for the color instead of each component separately.
    void
    displayImageObject(int id, String path, float x, float y)
    Adds a new image object at the given coordinates.
    void
    displayImageObject(int id, String path, float x, float y, float r, float g, float b, float a)
    Adds a new image object at the given coordinates.
    void
    displayMessageObject(int id, String message, double x, double y, double[] color, double fontSize)
    Same as displayImageObject(int, String, float, float, float, float, float, float) but using an array for the color instead of giving each component separately.
    void
    displayMessageObject(int id, String message, float x, float y, float r, float g, float b, float a, float fontSize)
    Adds a new one-line message in the screen with the given id and the given coordinates.
    void
    Displays a popup notification on the screen for the default duration.
    void
    displayPopupNotification(String message, float duration)
    Displays a popup notification on the screen for the given duration.
    void
    displayTextObject(int id, String text, float x, float y, float maxWidth, float maxHeight, float r, float g, float b, float a, float fontSize)
    Adds a new multi-line text in the screen with the given id, coordinates and size.
    double
    dot3(double[] vec1, double[] vec2)
    Computes the dot product between the two 3D vectors.
    double[]
    eclipticToEquatorial(double[] eclInternal)
    Converts ecliptic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
    double[]
    eclipticToInternalCartesian(double l, double b, double r)
    Converts ecliptic coordinates to the internal cartesian coordinate system.
    void
    Enables the GUI rendering.
    void
    Enables all input events.
    double[]
    equatorialCartesianToInternalCartesian(double[] eq, double kmFactor)
    Converts regular cartesian coordinates, where XY is the equatorial plane, with X pointing to the vernal equinox (ra=0) and Y points to ra=90, and Z pointing to the celestial north pole (dec=90) to internal cartesian coordinates with internal units.
    double[]
    equatorialToEcliptic(double[] eqInternal)
    Converts equatorial cartesian coordinates (in the internal reference system) to ecliptic cartesian coordinates.
    double[]
    equatorialToGalactic(double[] eq)
    Converts equatorial cartesian coordinates (in the internal reference system) to galactic cartesian coordinates.
    double[]
    equatorialToInternalCartesian(double ra, double dec, double r)
    Converts equatorial coordinates to the internal cartesian coordinate system.
    void
    error(String message)
    Log an error using the internal logging system.
    void
    Expands the component with the given name.
    double[]
    galacticToEquatorial(double[] galInternal)
    Converts galactic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
    double[]
    galacticToInternalCartesian(double l, double b, double r)
    Converts galactic coordinates to the internal cartesian coordinate system.
    Gets the location of the assets folder.
    double[]
    Gets the current camera direction vector.
    double[]
    Gets the current camera position, in km.
    double
    Gets the current physical speed of the camera in km/h.
    double[]
    Gets the current camera up vector.
    Returns the closest object to the camera in this instant as a IFocus.
    boolean
    Gets the visibility of the component type described by the key.
    Gets the absolute path to the location of the configuration directory
    long
    Gets the current frame number.
    Gets the absolute path of the local data directory, configured in your config.yaml file.
    Gets the absolute path of the default directory where the camera files are saved.
    Gets the absolute path of the default directory where the still frames are saved.
    Gets the absolute path to the location of the inputListener mappings.
    Gets the absolute path to the location of the music files
    Gets the absolute path of the default directory where the screenshots are saved.
    double
    Returns the distance to the surface of the object identified with the given name.
    boolean
    Gets the value of the force display label flag for the object identified with the given name.
    long
    Gets the current frame number.
    double
    Gets the current FPS setting in the frame output system.
    double
    Returns the internal unit to meter conversion factor.
    Returns the default data directory.
    double
    Returns the meter to internal unit conversion factor.
    Gets an object from the scene graph by name or id (HIP, TYC, Gaia SourceId).
    getObject(String name, double timeOutSeconds)
    Gets an object by name or id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.
    double[]
    Gets the current position of the object identified by name in the internal coordinate system and internal units.
    double
    Gets the size of the object identified by name, in Km, by name or id (HIP, TYC, sourceId).
    boolean
    Gets the visibility of a particular object.
    float[]
    Returns the size and position of the GUI element that goes by the given name or null if such element does not exist.
    long
    Returns the current maximum number of velocity vectors per star group.
    double
    Deprecated.
    Use getFrameOutputFps() instead.
    int
    Returns the screen height in pixels.
    int
    Returns the screen width in pixels.
    long
    Returns the current simulation time as the number of milliseconds since Jan 1, 1970 GMT.
    int[]
    Returns the current UTC simulation time in an array.
    float
    Gets the star brightness value.
    float
    Gets the minimum star opacity.
    double[]
    Returns the star parameters given its identifier or name, if the star exists and it is loaded.
    float
    Gets the current star size value in pixels.
    Returns the version number string.
    void
    Runs a seamless trip to the object with the name focusName until the object view angle is 20 degrees.
    void
    goToObject(String name, double viewAngle)
    Runs a seamless trip to the object with the name focusName until the object view angle viewAngle is met.
    void
    goToObject(String name, double viewAngle, float waitTimeSeconds)
    Runs a seamless trip to the object with the name focusName until the object view angle viewAngle is met.
    void
    Sets the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.
    boolean
    Checks whether the dataset identified by the given name is loaded
    boolean
    Hides the dataset identified by the given name, if it exists and is not hidden.
    boolean
    highlightDataset(String dsName, boolean highlight)
    Enables or disables the dataset highlight using a plain color chosen by the system.
    boolean
    highlightDataset(String dsName, float r, float g, float b, float a, boolean highlight)
    Enables or disables the dataset highlight, using a given plain color.
    boolean
    highlightDataset(String dsName, int colorIndex, boolean highlight)
    Enables or disables the dataset highlight, using a plain color given by the color index: 0 - blue 1 - red 2 - yellow 3 - green 4 - pink 5 - orange 6 - purple 7 - brown 8 - magenta
    boolean
    highlightDataset(String dsName, String attributeName, String colorMap, double minMap, double maxMap, boolean highlight)
    Enables or disables the dataset highlight, using the given color map on the given attribute with the given maximum and minimum mapping values.
    double[]
    internalCartesianToEquatorial(double x, double y, double z)
    Converts internal cartesian coordinates to equatorial [ra, dec, distance] coordinates.
    double
    internalUnitsToKilometres(double internalUnits)
    Converts the value in internal units to Kilometers.
    double[]
    internalUnitsToKilometres(double[] internalUnits)
    Converts the array in internal units to Kilometers.
    double
    internalUnitsToMetres(double internalUnits)
    Converts the value in internal units to metres.
    boolean
    Is the frame output system on?
    boolean
    Deprecated.
    boolean
    Queries whether the time is on or not.
    double
    kilometresToInternalUnits(double kilometres)
    Converts the kilometres to internal units.
    void
    landAtObjectLocation(String name, double longitude, double latitude)
    Lands on the object with the given name, if it is an instance of Planet, at the location specified in by [latitude, longitude], in degrees.
    void
    landAtObjectLocation(String name, String locationName)
    Lands on the object with the given name, if it is an instance of Planet, at the location with the given name, if it exists.
    void
    Lands on the object with the given name, if it is an instance of Planet.
    Returns the names of all datasets currently loaded.
    boolean
    loadDataset(String dsName, String path)
    Loads a VOTable, FITS or CSV dataset file with the given name.
    boolean
    loadDataset(String dsName, String path, boolean sync)
    Loads a VOTable, FITS or CSV dataset file with the given name.
    boolean
    loadDataset(String dsName, String path, CatalogInfo.CatalogInfoSource type, DatasetOptions options, boolean sync)
    Loads a VOTable, FITS or CSV dataset file with the given name.
    boolean
    loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, double[] particleSizeLimits, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot).
    boolean
    loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, String ct, boolean sync)
    Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot).
    boolean
    loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot).
    boolean
    loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a star cluster dataset from a CSV file.
    boolean
    loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a star cluster dataset from a CSV file.
    boolean
    loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] labelColor, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a star cluster dataset from a CSV file.
    boolean
    loadStarClusterDataset(String dsName, String path, double[] particleColor, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a star cluster dataset from a CSV file.
    boolean
    loadStarDataset(String dsName, String path, boolean sync)
    Loads a star dataset from a VOTable file (.vot).
    boolean
    loadStarDataset(String dsName, String path, double magnitudeScale, boolean sync)
    Loads a star dataset from a VOTable file (.vot).
    boolean
    loadStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, boolean sync)
    Loads a star dataset from a VOTable file (.vot).
    boolean
    loadStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a star dataset from a VOTable file (.vot).
    boolean
    loadVariableStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
    Loads a variable star dataset from a VOTable file (.vot).
    void
    log(String message)
    Print text using the internal logging system.
    void
    Maximizes the interface window.
    double
    metresToInternalUnits(double metres)
    Converts the metres to internal units.
    void
    Minimizes the interface window.
    void
    parkRunnable(String id, Runnable runnable)
    Parks a Runnable to the main loop thread, and keeps it running every frame until it finishes or it is unparked by unparkRunnable(String).
    void
    void
    playCameraPath(String file, boolean sync)
    void
    pointAtSkyCoordinate(double ra, double dec)
    Sets the camera in free mode and points it to the given coordinates in equatorial system.
    void
    Posts a Runnable to the main loop thread.
    void
    Pre-loads the given image as a texture for later use.
    void
    Pre-loads the given images as textures for later use.
    void
    print(String message)
    Print text using the internal logging system.
    void
    Initiates the quit action to terminate the program.
    void
    Forces all orbits to refresh immediately.
    void
    Removes all objects.
    void
    Removes the tracking object from the camera, if any.
    boolean
    Removes the dataset identified by the given name, if it exists.
    void
    Removes the model object identified by the given name from the internal scene graph model of Gaia Sky, if it exists.
    void
    removeObject(int id)
    Removes the item with the given id.
    void
    removeObjects(int[] ids)
    Removes the items with the given ids.
    void
    Removes the runnable with the given id, if any.
    void
    Resets to zero the image sequence number used to generate the file names of the frame output images.
    double[]
    rotate2(double[] vector, double angle)
    Rotates a 2D vector by the specified angle in degrees, counter-clockwise assuming that the y axis points up.
    double[]
    rotate3(double[] vector, double[] axis, double angle)
    Rotates a 3D vector around the given axis by the specified angle in degrees.
    void
    Runs a .gsc camera path file and returns immediately.
    void
    runCameraPath(String file, boolean sync)
    Runs a .gsc camera path file and returns immediately.
    void
    Runs the camera recording file with the given path.
    void
    Takes a screenshot of the current frame and saves it to the configured location (see configureScreenshots(int, int, String, String)).
    void
    setAmbientLight(float value)
    Sets the ambient light to a certain value.
    void
    setBloom(float value)
    Sets the strength value for the bloom effect.
    void
    setBrightnessLevel(double level)
    Sets the brightness level of the render system.
    void
    setCameraCenterFocus(boolean centerFocus)
    Whether to look for the focus constantly when in focus mode and center it in the view or whether the view must be free.
    void
    setCameraDirection(double[] dir)
    Sets the camera direction vector to the given vector, in equatorial cartesian coordinates.
    void
    Sets the camera in focus mode with the focus object that bears the given focusName.
    void
    setCameraFocus(String focusName, float waitTimeSeconds)
    Sets the camera in focus mode with the focus object that bears the given focusName.
    void
    Sets the camera in focus mode with the given focus object.
    void
    Sets the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.
    void
    Sets the camera in FoV1 mode.
    void
    Sets the camera in Fov1 and 2 mode.
    void
    Sets the camera in FoV2 mode.
    void
    Sets the camera in free mode.
    void
    setCameraLock(boolean lock)
    Activates or deactivates the camera lock to the focus reference system when in focus mode.
    void
    Locks or unlocks the orientation of the camera to the focus object's rotation.
    void
    setCameraPosition(double[] vec)
    Sets the camera position to the given coordinates, in Km, equatorial system.
    void
    setCameraPosition(double x, double y, double z)
    Sets the camera position to the given coordinates, in Km, equatorial system.
    void
    setCameraPositionAndFocus(String focus, String other, double rotation, double viewAngle)
    Sets the focus and instantly moves the camera to a point in the line defined by focus-other and rotated rotation degrees around focus using the camera up vector as a rotation axis.
    void
    setCameraPostion(double[] vec)
    Deprecated.
    void
    setCameraRecorderFps(double targetFps)
    Sets the target frame rate of the camera recorder.
    void
    Changes the speed of the camera when it rotates around a focus.
    void
    setCameraSpeed(float speed)
    Changes the speed multiplier of the camera and its acceleration.
    void
    Sets the speed limit of the camera given an index.
    void
    setCameraState(double[] pos, double[] dir, double[] up)
    Sets the camera state (position, direction and up vector).
    void
    setCameraStateAndTime(double[] pos, double[] dir, double[] up, long time)
    Sets the camera state (position, direction and up vector) plus the current time.
    void
    Sets the camera to track the object with the given name.
    void
    setCameraTurningSpeed(float speed)
    Changes the turning speed of the camera.
    void
    setCameraUp(double[] up)
    Sets the camera up vector to the given vector, equatorial system.
    void
    setCinematicCamera(boolean cinematic)
    Enables or disables the cinematic camera mode.
    void
    Sets the visibility of the closest object crosshair.
    void
    setComponentTypeVisibility(String key, boolean visible)
    Sets the component described by the given name visible or invisible.
    void
    setContrastLevel(double level)
    Sets the contrast level of the render system.
    void
    setCrosshairVisibility(boolean visible)
    Sets the visibility of all cross-hairs.
    void
    setCubemapMode(boolean state, String projection)
    Enables and disables the cubemap mode.
    void
    Sets the cubemap projection to use.
    void
    setCubemapResolution(int resolution)
    Sets the resolution (width and height are the same) of each side of the frame buffers used to capture each of the 6 directions that go into the cubemap to construct the equirectangular image for the 360 mode.
    boolean
    setDatasetHighlightAllVisible(String dsName, boolean allVisible)
    Sets the 'all visible' property of datasets when highlighted.
    boolean
    setDatasetHighlightSizeFactor(String dsName, float sizeFactor)
    Sets the size increase factor of this dataset when highlighted.
    void
    setDatasetPointSizeMultiplier(String dsName, double multiplier)
    Sets the dataset point size multiplier.
    void
    Sets the exposure level.
    void
    setFocusCrosshairVisibility(boolean visible)
    Sets the visibility of the focus object crosshair.
    void
    setForceDisplayLabel(String name, boolean forceLabel)
    Forces the label to display for the given object, bypassing the solid angle requirements that are usually in place and determine label visibility.
    void
    setFov(float newFov)
    Changes the field of view of the camera.
    void
    setFrameOutput(boolean active)
    Activates or deactivates the image output system.
    void
    setFrameOutputMode(String screenshotMode)
    Sets the frame output mode.
    void
    Sets the gamma correction level.
    void
    setGuiPosition(float x, float y)
    Moves the interface window to a new position.
    void
    setGuiScrollPosition(float pixelY)
    Sets the vertical scroll position in the GUI.
    void
    Sets the high dynamic range tone mapping algorithm type.
    void
    Sets a headline message that will appear in a big font in the screen.
    void
    setHomeCrosshairVisibility(boolean visible)
    Sets the visibility of the home object crosshair.
    void
    setHueLevel(double level)
    Sets the hue level of the render system.
    void
    setLabelColor(String name, double[] color)
    Sets the label color of the object identified by the given name.
    void
    setLabelSizeFactor(float factor)
    Sets the label size factor.
    void
    setLensFlare(boolean state)
    Enables or deisables the lens flare effect.
    void
    setLimitFps(double limitFps)
    Limits the frame rate of Gaia Sky.
    void
    setLimitFps(int limitFps)
    Limits the frame rate of Gaia Sky.
    void
    setLineWidthFactor(float factor)
    Sets the line width factor.
    void
    Sets the maximum simulation time allowed, in years.
    void
    setMinimapVisibility(boolean visible)
    Shows or hides the minimap.
    void
    setMotionBlur(boolean state)
    Enables or disables the motion blur effect.
    void
    setObjectSizeScaling(String name, double scalingFactor)
    Sets the given size scaling factor to the object identified by name.
    boolean
    setObjectVisibility(String name, boolean visible)
    Sets the visibility of a particular object.
    void
    setOrbitCoordinatesScaling(String name, double scalingFactor)
    Sets the given orbit coordinates scaling factor to the AbstractOrbitCoordinates identified by name.
    void
    Sets the solid angle below which orbits fade and disappear.
    void
    setPanoramaMode(boolean state)
    Enables and disables the panorama mode.
    void
    setPlanetariumMode(boolean state)
    Enables and disables the planetarium mode.
    void
    setProjectionFov(float fov)
    Same as setFov(float), but bypassing the restriction of an active projection in the slave (slaves that have an active projection do not accept fov modification events).
    void
    setProjectionPitch(float pitch)
    Sets the projection pitch angle (if this is a slave instance), in degrees.
    void
    setProjectionRoll(float roll)
    Sets the projection roll angle (if this is a slave instance), in degrees.
    void
    setProjectionYaw(float yaw)
    Sets the projection yaw angle (if this is a slave instance), in degrees.
    void
    setProperMotionsArrowheads(boolean arrowheadsEnabled)
    Sets whether to show arrowheads or not for the velocity vectors.
    void
    Sets the color mode of proper motion vectors.
    void
    Sets the length of the proper motion vectors, in [500,30000].
    void
    setProperMotionsMaxNumber(long maxNumber)
    Sets the maximum number of proper motion vectors to add per star group.
    void
    Sets the number factor of proper motion vectors that are visible.
    void
    void
    setSaturationLevel(double level)
    Sets the saturation level of the render system.
    void
    setScreenshotsMode(String screenshotMode)
    Sets the screenshot mode.
    void
    setSimulationPace(double pace)
    Deprecated.
    void
    setSimulationTime(int year, int month, int day, int hour, int min, int sec, int millisec)
    Sets the time of the application, in UTC.
    void
    setSimulationTime(long time)
    Sets the time of the application.
    void
    setSmoothLodTransitions(boolean value)
    Sets the value of smooth lod transitions, allowing or disallowing octant fade-ins of as they come into view.
    void
    setStarBrightness(float brightness)
    Sets the star brightness value.
    void
    Sets the star brightness power profile value.
    void
    setStarGlow(boolean state)
    Enables or disables the star glow effect.
    void
    setStarGroupBillboard(boolean flag)
    Enable or disable the rendering of close stars as billboards.
    void
    Sets the number of nearest stars to be processed for each star group.
    void
    setStarMinOpacity(float opacity)
    Sets the minimum star opacity.
    void
    setStarSize(float size)
    Sets the size of the rasterized stars, in pixels.
    void
    Sets the star texture index, in [1, 4]
    void
    setStereoscopicMode(boolean state)
    Enables and disables the stereoscopic mode.
    void
    Changes the stereoscopic profile.
    void
    Sets a subhead message that will appear in a small font below the headline.
    void
    setTargetTime(int year, int month, int day, int hour, int min, int sec, int milliSec)
    Sets a time bookmark in the global clock that, when reached, the clock automatically stops.
    void
    setTargetTime(long ms)
    Sets a time bookmark in the global clock that, when reached, the clock automatically stops.
    void
    setTimeWarp(double pace)
    Sets the simulation time warp factor.
    void
    setTurningCameraSpeed(float speed)
    void
    setVisibility(String key, boolean visible)
    Deprecated. 
    boolean
    Shows (un-hides) the dataset identified by the given name, if it exists and is hidden
    void
    sleep(float seconds)
    Sleeps for the given number of seconds in the application time (FPS), so if we are capturing frames and the frame rate is set to 30 FPS, the command sleep(1) will put the script to sleep for 30 frames.
    void
    sleepFrames(long frames)
    Sleeps for a number of frames.
    void
    Starts recording the camera path to an auto-generated file in the default camera directory.
    void
    Starts recording a camera path with the given filename.
    void
    Starts the simulation.
    void
    Stops the current camera recording.
    void
    Stops the simulation time.
    void
    void
    Deprecated.
    void
    Unsets the target time bookmark from the global clock, if any.
    boolean
    waitFocus(String name, long timeoutMs)
    Blocks the script until the focus is the object indicated by the name.
    void
    Blocks the execution until the Enter key is pressed.
    void
    Blocks the execution until any kind of input (keyboard, mouse, etc.) is received.
    void
    waitForInput(int code)
    Blocks the execution until the given key or button is pressed.
  • Method Details

    • getAssetsLocation

      String getAssetsLocation()
      Gets the location of the assets folder.
    • preloadTextures

      void preloadTextures(String[] paths)
      Pre-loads the given images as textures for later use. They will be cached for the subsequent uses.
      Parameters:
      paths - The texture paths.
    • preloadTexture

      void preloadTexture(String path)
      Pre-loads the given image as a texture for later use. The texture will be cached for later use.
      Parameters:
      path - The path of the image file to preload.
    • activateRealTimeFrame

      void activateRealTimeFrame()
      Sets the current time frame to real time. All the commands executed after this command becomes active will be in the real time frame (clock ticks).
    • activateSimulationTimeFrame

      void activateSimulationTimeFrame()
      Sets the current time frame to simulation time. All the commands executed after this command becomes active will be in the simulation time frame (simulation clock in the app).
    • displayPopupNotification

      void displayPopupNotification(String message)
      Displays a popup notification on the screen for the default duration.
      Parameters:
      message - The message text.
    • displayPopupNotification

      void displayPopupNotification(String message, float duration)
      Displays a popup notification on the screen for the given duration.
      Parameters:
      message - The message text.
      duration - The duration in seconds until the notification is removed.
    • setHeadlineMessage

      void setHeadlineMessage(String headline)
      Sets a headline message that will appear in a big font in the screen.
      Parameters:
      headline - The headline text.
    • setSubheadMessage

      void setSubheadMessage(String subhead)
      Sets a subhead message that will appear in a small font below the headline.
      Parameters:
      subhead - The subhead text.
    • clearHeadlineMessage

      void clearHeadlineMessage()
      Clears the headline messge.
    • clearSubheadMessage

      void clearSubheadMessage()
      Clears the subhead message.
    • clearAllMessages

      void clearAllMessages()
      Clears both the subhead and the headline messages.
    • displayMessageObject

      void displayMessageObject(int id, String message, float x, float y, float r, float g, float b, float a, float fontSize)
      Adds a new one-line message in the screen with the given id and the given coordinates. If an object already exists with the given id, it is removed. However, if a message object already exists with the same id, its properties are updated. The messages placed with this method will not appear in the screenshots/frames in advanced mode. This is intended for running interactively only.
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      message - The string message, to be displayed in one line. But explicit newline breaks the line.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
      r - The red component of the color in [0,1].
      g - The green component of the color in [0,1].
      b - The blue component of the color in [0,1].
      a - The alpha component of the color in [0,1].
      fontSize - The size of the font. The system will use the existing font closest to the chosen size and scale it up or down to match the desired size. Scaling can cause artifacts, so to ensure the best font quality, stick to the existing sizes.
    • displayMessageObject

      void displayMessageObject(int id, String message, double x, double y, double[] color, double fontSize)
      Same as displayImageObject(int, String, float, float, float, float, float, float) but using an array for the color instead of giving each component separately.
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      message - The string message, to be displayed in one line. But explicit newline breaks the line.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
      color - The color as an array of RGBA (red, green, blue, alpha) values in [0,1].
      fontSize - The size of the font. The system will use the existing font closest to the chosen size and scale it up or down to match the desired size. Scaling can cause artifacts, so to ensure the best font quality, stick to the existing sizes.
    • displayTextObject

      void displayTextObject(int id, String text, float x, float y, float maxWidth, float maxHeight, float r, float g, float b, float a, float fontSize)
      Adds a new multi-line text in the screen with the given id, coordinates and size. If an object already exists with the given id, it is removed. However, if a text object already exists with the same id, its properties are updated. The texts placed with this method will not appear in the screenshots/frames in advanced mode. This is intended for running interactively only.
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      text - The string message, to be displayed line-wrapped in the box defined by maxWidth and maxHeight. Explicit newline still breaks the line.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
      maxWidth - The maximum width in screen percentage [0,1]. Set to 0 to let the system decide.
      maxHeight - The maximum height in screen percentage [0,1]. Set to 0 to let the system decide.
      r - The red component of the color in [0,1].
      g - The green component of the color in [0,1].
      b - The blue component of the color in [0,1].
      a - The alpha component of the color in [0,1].
      fontSize - The size of the font. The system will use the existing font closest to the chosen size.
    • displayImageObject

      void displayImageObject(int id, String path, float x, float y)
      Adds a new image object at the given coordinates. If an object already exists with the given id, it is removed. However, if an image object already exists with the same id, its properties are updated.
      The messages placed with this method will not appear in the screenshots/frames in advanced mode. This is intended for running interactively only.
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      path - The path to the image. It can either be an absolute path (not recommended) or a path relative to the Gaia Sky work directory.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
    • displayImageObject

      void displayImageObject(int id, String path, float x, float y, float r, float g, float b, float a)
      Adds a new image object at the given coordinates. If an object already exists with the given id, it is removed. However, if an image object already exists with the same id, its properties are updated.
      Warning: This method will only work in the asynchronous mode. Run the script with the "asynchronous" check box activated!
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      path - The path to the image. It can either be an absolute path (not recommended) or a path relative to the Gaia Sky work directory.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
      r - The red component of the color in [0,1].
      g - The green component of the color in [0,1].
      b - The blue component of the color in [0,1].
      a - The alpha component of the color in [0,1].
    • displayImageObject

      void displayImageObject(int id, String path, double x, double y, double[] color)
      Same as displayImageObject(int, String, float, float, float, float, float, float) but using a double array for the color instead of each component separately.
      Parameters:
      id - A unique identifier, used to identify this message when you want to remove it.
      path - The path to the image. It can either be an absolute path (not recommended) or a path relative to the Gaia Sky work directory.
      x - The x coordinate of the bottom-left corner, in [0,1] from left to right. This is not resolution-dependant.
      y - The y coordinate of the bottom-left corner, in [0,1] from bottom to top. This is not resolution-dependant.
      color - The color as an array of RGBA (red, green, blue, alpha) values in [0,1].
    • removeAllObjects

      void removeAllObjects()
      Removes all objects.
    • removeObject

      void removeObject(int id)
      Removes the item with the given id.
      Parameters:
      id - Integer with the integer id of the object to remove.
    • removeObjects

      void removeObjects(int[] ids)
      Removes the items with the given ids. They can either messages, images or whatever else.
      Parameters:
      ids - Vector with the integer ids of the objects to remove
    • disableInput

      void disableInput()
      Disables all input events from mouse, keyboard, touchscreen, etc.
    • enableInput

      void enableInput()
      Enables all input events.
    • setCinematicCamera

      void setCinematicCamera(boolean cinematic)
      Enables or disables the cinematic camera mode.
      Parameters:
      cinematic - Whether to enable or disable the cinematic mode.
    • setCameraFocus

      void setCameraFocus(String focusName)
      Sets the camera in focus mode with the focus object that bears the given focusName. It returns immediately, so it does not wait for the camera direction to point to the focus.
      Parameters:
      focusName - The name of the new focus object.
    • setCameraFocus

      void setCameraFocus(String focusName, float waitTimeSeconds)
      Sets the camera in focus mode with the focus object that bears the given focusName. The amount of time to block and wait for the camera to face the focus can also be specified in waitTimeSeconds.
      Parameters:
      focusName - The name of the new focus object.
      waitTimeSeconds - Maximum time in seconds to wait for the camera to face the focus. If negative, we wait indefinitely.
    • setCameraFocusInstant

      void setCameraFocusInstant(String focusName)
      Sets the camera in focus mode with the given focus object. It also instantly sets the camera direction vector to point towards the focus.
      Parameters:
      focusName - The name of the new focus object.
    • setCameraFocusInstantAndGo

      void setCameraFocusInstantAndGo(String focusName)
      Sets the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.
      Parameters:
      focusName - The name of the new focus object.
    • setCameraLock

      void setCameraLock(boolean lock)
      Activates or deactivates the camera lock to the focus reference system when in focus mode.
      Parameters:
      lock - Activate or deactivate the lock.
    • setCameraCenterFocus

      void setCameraCenterFocus(boolean centerFocus)
      Whether to look for the focus constantly when in focus mode and center it in the view or whether the view must be free. Use True to center the focus (default behaviour) and False to set it to a free view.
      Parameters:
      centerFocus - Whether to center the focus or not.
    • setCameraOrientationLock

      void setCameraOrientationLock(boolean lock)
      Locks or unlocks the orientation of the camera to the focus object's rotation.
      Parameters:
      lock - Whether to lock or unlock the camera orientation to the focus.
    • setCameraFree

      void setCameraFree()
      Sets the camera in free mode.
    • setCameraFov1

      void setCameraFov1()
      Sets the camera in FoV1 mode. The camera is positioned in Gaia's focal plane and observes what Gaia observes through its field of view 1.
    • setCameraFov2

      void setCameraFov2()
      Sets the camera in FoV2 mode. The camera is positioned in Gaia's focal plane and observes what Gaia observes through its field of view 2.
    • setCameraFov1and2

      void setCameraFov1and2()
      Sets the camera in Fov1 and 2 mode. The camera is positioned in Gaia's focal plane and observes what Gaia observes through its two fields of view.
    • setCameraPostion

      @Deprecated void setCameraPostion(double[] vec)
      Deprecated.
      Sets the camera position to the given coordinates, in Km, equatorial system.
      Parameters:
      vec - Vector of three components in internal coordinates and Km.
    • setCameraPosition

      void setCameraPosition(double[] vec)
      Sets the camera position to the given coordinates, in Km, equatorial system.
      Parameters:
      vec - Vector of three components in internal coordinates and Km.
    • setCameraPosition

      void setCameraPosition(double x, double y, double z)
      Sets the camera position to the given coordinates, in Km, equatorial system.
      Parameters:
      x - The x component.
      y - The y component.
      z - The z component.
    • getCameraPosition

      double[] getCameraPosition()
      Gets the current camera position, in km.
      Returns:
      The camera position coordinates in the internal reference system, in km.
    • setCameraDirection

      void setCameraDirection(double[] dir)
      Sets the camera direction vector to the given vector, in equatorial cartesian coordinates. You can convert from spherical coordinates using equatorialCartesianToInternalCartesian(double[], double), galacticToInternalCartesian(double, double, double) and eclipticToInternalCartesian(double, double, double).
      Parameters:
      dir - The direction vector in equatorial cartesian coordinates.
    • getCameraDirection

      double[] getCameraDirection()
      Gets the current camera direction vector.
      Returns:
      The camera direction vector in the internal reference system.
    • setCameraUp

      void setCameraUp(double[] up)
      Sets the camera up vector to the given vector, equatorial system.
      Parameters:
      up - The up vector in equatorial coordinates.
    • getCameraUp

      double[] getCameraUp()
      Gets the current camera up vector.
      Returns:
      The camera up vector in the internal reference system.
    • setCameraPositionAndFocus

      void setCameraPositionAndFocus(String focus, String other, double rotation, double viewAngle)
      Sets the focus and instantly moves the camera to a point in the line defined by focus-other and rotated rotation degrees around focus using the camera up vector as a rotation axis.
      Parameters:
      focus - The name of the focus object.
      other - The name of the other object, to the fine a line from this to foucs. Usually a light source.
      rotation - The rotation angle, in degrees.
      viewAngle - The view angle which determines the distance, in degrees.
    • pointAtSkyCoordinate

      void pointAtSkyCoordinate(double ra, double dec)
      Sets the camera in free mode and points it to the given coordinates in equatorial system.
      Parameters:
      ra - Right ascension in degrees.
      dec - Declination in degrees.
    • setCameraSpeed

      void setCameraSpeed(float speed)
      Changes the speed multiplier of the camera and its acceleration.
      Parameters:
      speed - The new speed, from 0 to 100.
    • getCameraSpeed

      double getCameraSpeed()
      Gets the current physical speed of the camera in km/h.
      Returns:
      The current speed of the camera in km/h.
    • setCameraRotationSpeed

      void setCameraRotationSpeed(float speed)
      Changes the speed of the camera when it rotates around a focus.
      Parameters:
      speed - The new rotation speed in [0,100]
    • setRotationCameraSpeed

      @Deprecated void setRotationCameraSpeed(float speed)
      Changes the speed of the camera when it rotates around a focus.
      Parameters:
      speed - The new rotation speed in [0,100]
    • setCameraTurningSpeed

      void setCameraTurningSpeed(float speed)
      Changes the turning speed of the camera.
      Parameters:
      speed - The new turning speed, from 1 to 100.
    • setTurningCameraSpeed

      @Deprecated void setTurningCameraSpeed(float speed)
      Changes the turning speed of the camera.
      Parameters:
      speed - The new turning speed, from 1 to 100.
    • setCameraSpeedLimit

      void setCameraSpeedLimit(int index)
      Sets the speed limit of the camera given an index. The index corresponds to the following:
      • 0 - 100 Km/h
      • 1 - 0.5 c
      • 2 - 0.8 c
      • 3 - 0.9 c
      • 4 - 0.99 c
      • 5 - 0.99999 c
      • 6 - 1 c
      • 7 - 2 c
      • 8 - 10 c
      • 9 - 1e3 c
      • 10 - 1 AU/s
      • 11 - 10 AU/s
      • 12 - 1000 AU/s
      • 13 - 10000 AU/s
      • 14 - 1 pc/s
      • 15 - 2 pc/s
      • 16 - 10 pc/s
      • 17 - 1000 pc/s
      • 18 - unlimited
      Parameters:
      index - The index of the top speed.
    • setCameraTrackingObject

      void setCameraTrackingObject(String objectName)
      Sets the camera to track the object with the given name. In this mode, the position of the camera is still dependent on the focus object (if any), but its direction points to the tracking object.
      Parameters:
      objectName - The name of the new tracking object.
    • removeCameraTrackingObject

      void removeCameraTrackingObject()
      Removes the tracking object from the camera, if any.
    • cameraForward

      void cameraForward(double value)
      Adds a forward movement to the camera with the given value. If value is negative the movement is backwards.
      Parameters:
      value - The magnitude of the movement, between -1 and 1.
    • cameraRotate

      void cameraRotate(double deltaX, double deltaY)
      Adds a rotation movement to the camera around the current focus, or a pitch/yaw if in free mode.

      If the camera is not using the cinematic behaviour (setCinematicCamera(boolean), the rotation movement will not be permanent. Use the cinematic behaviour to have the camera continue to rotate around the focus.

      Parameters:
      deltaX - The x component, between 0 and 1. Positive is right and negative is left.
      deltaY - The y component, between 0 and 1. Positive is up and negative is down.
    • cameraRoll

      void cameraRoll(double roll)
      Adds a roll force to the camera.
      Parameters:
      roll - The intensity of the roll.
    • cameraTurn

      void cameraTurn(double deltaX, double deltaY)
      Adds a turn force to the camera (yaw and/or pitch). If the camera is in focus mode, it permanently deviates the line of sight from the focus until centered again. If the camera is not using the cinematic behaviour (setCinematicCamera(boolean), the turn will not be permanent. Use the cinematic behaviour to have the turn persist in time.
      Parameters:
      deltaX - The x component, between 0 and 1. Positive is right and negative is left.
      deltaY - The y component, between 0 and 1. Positive is up and negative is down.
    • cameraYaw

      void cameraYaw(double amount)
      Adds a yaw to the camera. Same as cameraTurn(double, double) with deltaY set to zero.
      Parameters:
      amount - The amount.
    • cameraPitch

      void cameraPitch(double amount)
      Adds a pitch to the camera. Same as cameraTurn(double, double) with deltaX set to zero.
      Parameters:
      amount - The amount.
    • cameraStop

      void cameraStop()
      Stops all camera motion.
    • cameraCenter

      void cameraCenter()
      Centers the camera to the focus, removing any deviation of the line of sight. Useful to center the focus object again after turning.
    • getClosestObjectToCamera

      IFocus getClosestObjectToCamera()
      Returns the closest object to the camera in this instant as a IFocus.
      Returns:
      The closest object to the camera.
    • setFov

      void setFov(float newFov)
      Changes the field of view of the camera.
      Parameters:
      newFov - The new field of view value in degrees, between Constants.MIN_FOV and Constants.MAX_FOV.
    • setCameraState

      void setCameraState(double[] pos, double[] dir, double[] up)
      Sets the camera state (position, direction and up vector).
      Parameters:
      pos - The position of the camera in internal units, not Km.
      dir - The direction of the camera.
      up - The up vector of the camera.
    • setCameraStateAndTime

      void setCameraStateAndTime(double[] pos, double[] dir, double[] up, long time)
      Sets the camera state (position, direction and up vector) plus the current time.
      Parameters:
      pos - The position of the camera in internal units, not Km.
      dir - The direction of the camera.
      up - The up vector of the camera.
      time - The new time of the camera as the number of milliseconds since the epoch (Jan 1, 1970).
    • setVisibility

      @Deprecated void setVisibility(String key, boolean visible)
      Deprecated.
    • setComponentTypeVisibility

      void setComponentTypeVisibility(String key, boolean visible)
      Sets the component described by the given name visible or invisible.
      Parameters:
      key - The key of the component: "element.stars", "element.planets", "element.moons", etc. See ComponentTypes.ComponentType.
      visible - The visible value.
    • getComponentTypeVisibility

      boolean getComponentTypeVisibility(String key)
      Gets the visibility of the component type described by the key. Examples of keys are "element.stars", "element.planets" or "element.moons". See ComponentTypes.ComponentType.
      Parameters:
      key - The key of the component type to query.
      Returns:
      The visibility of the component type.
    • setObjectVisibility

      boolean setObjectVisibility(String name, boolean visible)
      Sets the visibility of a particular object. Use this method to hide individual objects. Changes to the individual object visibility are not persisted on restart.
      Parameters:
      name - The name of the object. Must be an instance of IVisibilitySwitch.
      visible - The visible status to set. Set to false in order to hide the object. True to make it visible.
      Returns:
      True if the visibility was set successfully, false if there were errors.
    • getObjectVisibility

      boolean getObjectVisibility(String name)
      Gets the visibility of a particular object.
      Parameters:
      name - The name of the object. Must be an instance of IVisibilitySwitch.
      Returns:
      The visibility status of the object, if it exists.
    • setLabelSizeFactor

      void setLabelSizeFactor(float factor)
      Sets the label size factor. The label size will be multiplied by this.
      Parameters:
      factor - Factor in Constants.MIN_LABEL_SIZE and Constants.MAX_LABEL_SIZE.
    • setForceDisplayLabel

      void setForceDisplayLabel(String name, boolean forceLabel)
      Forces the label to display for the given object, bypassing the solid angle requirements that are usually in place and determine label visibility. This setting does not override the visibility of the object itself, or of the label visibility component element. Changes to the force display label flag are not persisted on restart.
      Parameters:
      name - The object name.
      forceLabel - Whether to force the label to render for this object or not.
    • setLabelColor

      void setLabelColor(String name, double[] color)
      Sets the label color of the object identified by the given name. The label color must be an array of RGBA values in [0,1].
      Parameters:
      name - The object name.
      color - The label color as an array of RGBA (red, green, blue, alpha) values in [0,1].
    • getForceDisplayLabel

      boolean getForceDisplayLabel(String name)
      Gets the value of the force display label flag for the object identified with the given name.
      Parameters:
      name - The name of the object.
      Returns:
      The value of the force display label flag of the object, if it exists.
    • setLineWidthFactor

      void setLineWidthFactor(float factor)
      Sets the line width factor. The line width will be multiplied by this.
      Parameters:
      factor - Factor in Constants.MIN_LINE_WIDTH and Constants.MAX_LINE_WIDTH.
    • setProperMotionsNumberFactor

      void setProperMotionsNumberFactor(float factor)
      Sets the number factor of proper motion vectors that are visible. In [1,100].
      Parameters:
      factor - Factor in [1,100].
    • setProperMotionsLengthFactor

      void setProperMotionsLengthFactor(float factor)
      Sets the length of the proper motion vectors, in [500,30000].
      Parameters:
      factor - Factor in [500,30000].
    • setProperMotionsColorMode

      void setProperMotionsColorMode(int mode)
      Sets the color mode of proper motion vectors.
      Parameters:
      mode - The color mode:
      • 0 - direction: the normalised cartesian velocity components XYZ are mapped to the color channels RGB.
      • 1 - magnitude (speed): the magnitude of the velocity vector is mapped using a rainbow scheme (blue-green-yellow-red) with the color map limit at 100 Km/s.
      • 2 - has radial velocity: blue for stars with radial velocity, red for stars without.
      • 3 - redshift from Sun: blue stars have negative radial velocity (from the Sun), red stars have positive radial velocity (from the Sun). Blue is mapped to -100 Km/s, red is mapped to 100 Km/s.
      • 4 - redshift from camera: blue stars have negative radial velocity (from the camera), red stars have positive radial velocity (from the camera). Blue is mapped to -100 Km/s, red is mapped to 100 Km/s.
      • 5 - single color: same color for all velocity vectors.
    • setProperMotionsArrowheads

      void setProperMotionsArrowheads(boolean arrowheadsEnabled)
      Sets whether to show arrowheads or not for the velocity vectors.
      Parameters:
      arrowheadsEnabled - Whether to show the velocity vectors with arrowheads.
    • setProperMotionsMaxNumber

      void setProperMotionsMaxNumber(long maxNumber)
      Sets the maximum number of proper motion vectors to add per star group.
      Parameters:
      maxNumber - The maximum number of proper motion vectors per star group.
    • getProperMotionsMaxNumber

      long getProperMotionsMaxNumber()
      Returns the current maximum number of velocity vectors per star group.
      Returns:
      Max number of velocity vectors per star group.
    • setCrosshairVisibility

      void setCrosshairVisibility(boolean visible)
      Sets the visibility of all cross-hairs.
      Parameters:
      visible - The visibility state, which applies to all cross-hairs.
    • setFocusCrosshairVisibility

      void setFocusCrosshairVisibility(boolean visible)
      Sets the visibility of the focus object crosshair.
      Parameters:
      visible - The visibility state.
    • setClosestCrosshairVisibility

      void setClosestCrosshairVisibility(boolean visible)
      Sets the visibility of the closest object crosshair.
      Parameters:
      visible - The visibility state.
    • setHomeCrosshairVisibility

      void setHomeCrosshairVisibility(boolean visible)
      Sets the visibility of the home object crosshair.
      Parameters:
      visible - The visibility state.
    • setMinimapVisibility

      void setMinimapVisibility(boolean visible)
      Shows or hides the minimap.
      Parameters:
      visible - The visibility state.
    • setAmbientLight

      void setAmbientLight(float value)
      Sets the ambient light to a certain value.
      Parameters:
      value - The value of the ambient light in [0,1].
    • setSimulationTime

      void setSimulationTime(int year, int month, int day, int hour, int min, int sec, int millisec)
      Sets the time of the application, in UTC.
      Parameters:
      year - The year to represent.
      month - The month-of-year to represent, from 1 (January) to 12 (December).
      day - The day-of-month to represent, from 1 to 31.
      hour - The hour-of-day to represent, from 0 to 23.
      min - The minute-of-hour to represent, from 0 to 59.
      sec - The second-of-minute to represent, from 0 to 59.
      millisec - The millisecond-of-second, from 0 to 999.
    • setSimulationTime

      void setSimulationTime(long time)
      Sets the time of the application. The long value represents specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
      Parameters:
      time - Number of milliseconds since the epoch (Jan 1, 1970).
    • getSimulationTime

      long getSimulationTime()
      Returns the current simulation time as the number of milliseconds since Jan 1, 1970 GMT.
      Returns:
      Number of milliseconds since the epoch (Jan 1, 1970).
    • getSimulationTimeArr

      int[] getSimulationTimeArr()
      Returns the current UTC simulation time in an array.
      Returns:
      The current simulation time in an array with the given indices.
      • 0 - The year.
      • 1 - The month, from 1 (January) to 12 (December).
      • 2 - The day-of-month, from 1 to 31.
      • 3 - The hour-of-day, from 0 to 23.
      • 4 - The minute-of-hour, from 0 to 59.
      • 5 - The second-of-minute, from 0 to 59.
      • 6 - The millisecond-of-second, from 0 to 999.
    • startSimulationTime

      void startSimulationTime()
      Starts the simulation.
    • stopSimulationTime

      void stopSimulationTime()
      Stops the simulation time.
    • isSimulationTimeOn

      boolean isSimulationTimeOn()
      Queries whether the time is on or not.
      Returns:
      True if the time is on, false otherwise.
    • setSimulationPace

      @Deprecated void setSimulationPace(double pace)
      Deprecated.
      Deprecated, use setTimeWarp(double) instead.
    • setTimeWarp

      void setTimeWarp(double pace)
      Sets the simulation time warp factor.
      Parameters:
      pace - The warp as a factor of real physical time pace. 2.0 sets the time to be twice as fast as real time.
    • setTargetTime

      void setTargetTime(long ms)
      Sets a time bookmark in the global clock that, when reached, the clock automatically stops.
      Parameters:
      ms - The time as the number of milliseconds since the epoch (Jan 1, 1970).
    • setTargetTime

      void setTargetTime(int year, int month, int day, int hour, int min, int sec, int milliSec)
      Sets a time bookmark in the global clock that, when reached, the clock automatically stops.
      Parameters:
      year - The year to represent.
      month - The month-of-year to represent, from 1 (January) to 12 (December).
      day - The day-of-month to represent, from 1 to 31.
      hour - The hour-of-day to represent, from 0 to 23.
      min - The minute-of-hour to represent, from 0 to 59.
      sec - The second-of-minute to represent, from 0 to 59.
      milliSec - The millisecond-of-second, from 0 to 999.
    • unsetTargetTime

      void unsetTargetTime()
      Unsets the target time bookmark from the global clock, if any.
    • getStarBrightness

      float getStarBrightness()
      Gets the star brightness value.
      Returns:
      The brightness value, between 0 and 100.
    • setStarBrightness

      void setStarBrightness(float brightness)
      Sets the star brightness value.
      Parameters:
      brightness - The brightness value, between 0 and 100.
    • setStarBrightnessPower

      void setStarBrightnessPower(float power)
      Sets the star brightness power profile value. This allows for adjusting the shape of the curve: brightness = brightness^power. Default value is 0.6.
      Parameters:
      power - The power value.
    • getStarSize

      float getStarSize()
      Gets the current star size value in pixels.
      Returns:
      The size value, in pixels.
    • setStarSize

      void setStarSize(float size)
      Sets the size of the rasterized stars, in pixels.
      Parameters:
      size - The size value in pixels, between Constants.MIN_STAR_POINT_SIZE and Constants.MAX_STAR_POINT_SIZE.
    • getStarMinOpacity

      float getStarMinOpacity()
      Gets the minimum star opacity.
      Returns:
      The minimum opacity value.
    • setStarMinOpacity

      void setStarMinOpacity(float opacity)
      Sets the minimum star opacity.
      Parameters:
      opacity - The minimum opacity value, between Constants.MIN_STAR_MIN_OPACITY and Constants.MAX_STAR_MIN_OPACITY.
    • setStarTextureIndex

      void setStarTextureIndex(int index)
      Sets the star texture index, in [1, 4]

      1 - horizontal spike 2 - god rays 3 - horizontal and vertical spikes 4 - simple radial profile

      Parameters:
      index - The new star texture index
    • setStarGroupNearestNumber

      void setStarGroupNearestNumber(int n)
      Sets the number of nearest stars to be processed for each star group. This will limit the number of stars that are rendered with billboards, labels and velocity vectors.
      Parameters:
      n - The new number of nearest stars
    • setStarGroupBillboard

      void setStarGroupBillboard(boolean flag)
      Enable or disable the rendering of close stars as billboards.
      Parameters:
      flag - The state flag
    • setOrbitSolidAngleThreshold

      void setOrbitSolidAngleThreshold(float angleDeg)
      Sets the solid angle below which orbits fade and disappear.
      Parameters:
      angleDeg - The threshold angle in degrees
    • setProjectionYaw

      void setProjectionYaw(float yaw)
      Sets the projection yaw angle (if this is a slave instance), in degrees. The yaw angle turns the camera to the right. This function is intended for multi-projector setups, to configure slaves without restarting Gaia Sky.
      Parameters:
      yaw - The yaw angle in degrees.
    • setProjectionPitch

      void setProjectionPitch(float pitch)
      Sets the projection pitch angle (if this is a slave instance), in degrees. The pitch angle turns the camera up. This function is intended for multi-projector setups, to configure slaves without restarting Gaia Sky.
      Parameters:
      pitch - The pitch angle in degrees.
    • setProjectionRoll

      void setProjectionRoll(float roll)
      Sets the projection roll angle (if this is a slave instance), in degrees. The roll angle rolls the camera clockwise. This function is intended for multi-projector setups, to configure slaves without restarting Gaia Sky.
      Parameters:
      roll - The roll angle in degrees.
    • setProjectionFov

      void setProjectionFov(float fov)
      Same as setFov(float), but bypassing the restriction of an active projection in the slave (slaves that have an active projection do not accept fov modification events).
      Parameters:
      fov - The field of view angle.
    • setLimitFps

      void setLimitFps(double limitFps)
      Limits the frame rate of Gaia Sky.
      Parameters:
      limitFps - The new maximum frame rate as a double-precision floating point number. Set zero or negative to unlimited.
    • setLimitFps

      void setLimitFps(int limitFps)
      Limits the frame rate of Gaia Sky.
      Parameters:
      limitFps - The new maximum frame rate as an integer number. Set zero or negative to unlimited.
    • configureScreenshots

      void configureScreenshots(int width, int height, String directory, String namePrefix)
      Configures the screenshot system, setting the resolution of the images, the output directory and the image name prefix.
      Parameters:
      width - Width of images.
      height - Height of images.
      directory - The output directory path.
      namePrefix - The file name prefix.
    • setScreenshotsMode

      void setScreenshotsMode(String screenshotMode)
      Sets the screenshot mode. Possible values are 'simple' and 'advanced'. The simple mode is faster and just outputs the last frame rendered to the Gaia Sky window, with the same resolution and containing the UI elements. The advanced mode redraws the last frame using the resolution configured using configureScreenshots(int, int, String, String) and it does not draw the UI.
      Parameters:
      screenshotMode - The screenshot mode. 'simple' or 'advanced'.
    • saveScreenshot

      void saveScreenshot()
      Takes a screenshot of the current frame and saves it to the configured location (see configureScreenshots(int, int, String, String)).
    • takeScreenshot

      void takeScreenshot()
    • configureRenderOutput

      @Deprecated void configureRenderOutput(int width, int height, int fps, String directory, String namePrefix)
      Configures the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix.
      Parameters:
      width - Width of images.
      height - Height of images.
      fps - Target frames per second (number of images per second).
      directory - The output directory path.
      namePrefix - The file name prefix.
    • configureFrameOutput

      void configureFrameOutput(int width, int height, int fps, String directory, String namePrefix)
      Configures the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix. This function sets the frame output mode to 'advanced'.
      Parameters:
      width - Width of images.
      height - Height of images.
      fps - Target frames per second (number of images per second).
      directory - The output directory path.
      namePrefix - The file name prefix.
    • configureFrameOutput

      void configureFrameOutput(int width, int height, double fps, String directory, String namePrefix)
      Configures the frame output system, setting the resolution of the images, the target frames per second, the output directory and the image name prefix. This function sets the frame output mode to 'advanced'.
      Parameters:
      width - Width of images.
      height - Height of images.
      fps - Target frames per second (number of images per second).
      directory - The output directory path.
      namePrefix - The file name prefix.
    • setFrameOutputMode

      void setFrameOutputMode(String screenshotMode)
      Sets the frame output mode. Possible values are 'simple' and 'advanced'. The simple mode is faster and just outputs the last frame rendered to the Gaia Sky window, with the same resolution and containing the UI elements. The advanced mode redraws the last frame using the resolution configured using configureFrameOutput(int, int, int, String, String) and it does not draw the UI.
      Parameters:
      screenshotMode - The screenshot mode. 'simple' or 'advanced'.
    • isRenderOutputActive

      @Deprecated boolean isRenderOutputActive()
      Deprecated.
      Is the frame output system on?
      Returns:
      True if the frame output is active.
    • isFrameOutputActive

      boolean isFrameOutputActive()
      Is the frame output system on?
      Returns:
      True if the render output is active.
    • getRenderOutputFps

      @Deprecated double getRenderOutputFps()
      Deprecated.
      Use getFrameOutputFps() instead.
      Gets the current FPS setting in the frame output system.
      Returns:
      The FPS setting.
    • getFrameOutputFps

      double getFrameOutputFps()
      Gets the current FPS setting in the frame output system.
      Returns:
      The FPS setting.
    • setFrameOutput

      void setFrameOutput(boolean active)
      Activates or deactivates the image output system. If called with true, the system starts outputting images right away.
      Parameters:
      active - Whether to activate or deactivate the frame output system.
    • getObject

      SceneGraphNode getObject(String name)
      Gets an object from the scene graph by name or id (HIP, TYC, Gaia SourceId).
      Parameters:
      name - The name or id (HIP, TYC, Gaia SourceId) of the object.
      Returns:
      The object as a SceneGraphNode, or null if it does not exist.
    • getObject

      SceneGraphNode getObject(String name, double timeOutSeconds)
      Gets an object by name or id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.
      Parameters:
      name - The name or id (HIP, TYC, Gaia SourceId) of the object.
      timeOutSeconds - The timeout in seconds to wait until returning. If negative, it waits indefinitely.
      Returns:
      The object if it exists, or null if it does not and block is false, or if block is true and the timeout has passed.
    • setObjectSizeScaling

      void setObjectSizeScaling(String name, double scalingFactor)
      Sets the given size scaling factor to the object identified by name. This method will only work with model objects such as planets, asteroids, satellites, etc. It will not work with orbits, stars or any other types.

      Also, use this with caution, as scaling the size of objects can have unintended side effects, and remember to set the scaling back to 1.0 at the end of your script.

      Parameters:
      name - The name or id of the object.
      scalingFactor - The scaling factor to scale the size of that object.
    • setOrbitCoordinatesScaling

      void setOrbitCoordinatesScaling(String name, double scalingFactor)
      Sets the given orbit coordinates scaling factor to the AbstractOrbitCoordinates identified by name. See AbstractOrbitCoordinates and its subclasses.

      Also, use this with caution, as scaling coordinates may have unintended side effects, and remember to set the scaling back to 1.0 at the end of your script.

      Parameters:
      name - The name of the coordinates object (OrbitLintCoordinates, EclipticCoordinates, SaturnVSOP87, UranusVSOP87, EarthVSOP87, MercuryVSOP87, ..., PlutoCoordinates, GaiaCoordinates, MoonAACoordinates).
      scalingFactor - The scaling factor.
    • refreshAllOrbits

      void refreshAllOrbits()
      Forces all orbits to refresh immediately.
    • getObjectRadius

      double getObjectRadius(String name)
      Gets the size of the object identified by name, in Km, by name or id (HIP, TYC, sourceId).
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
      Returns:
      The radius of the object in Km. If the object identifed by name or id (HIP, TYC, sourceId). does not exist, it returns a negative value.
    • goToObject

      void goToObject(String name)
      Runs a seamless trip to the object with the name focusName until the object view angle is 20 degrees.
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
    • goToObject

      void goToObject(String name, double viewAngle)
      Runs a seamless trip to the object with the name focusName until the object view angle viewAngle is met. If angle is negative, the default angle is 20 degrees.
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
      viewAngle - The target view angle of the object, in degrees. The angle gets larger and larger as we approach the object.
    • goToObject

      void goToObject(String name, double viewAngle, float waitTimeSeconds)
      Runs a seamless trip to the object with the name focusName until the object view angle viewAngle is met. If angle is negative, the default angle is 20 degrees. If waitTimeSeconds is positive, it indicates the number of seconds to wait (block the function) for the camera to face the focus before starting the forward movement. This very much depends on the turn velocity of the camera. See setTurningCameraSpeed(float).
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
      viewAngle - The target view angle of the object, in degrees. The angle gets larger and larger as we approach the object.
      waitTimeSeconds - The seconds to wait for the camera direction vector and the vector from the camera position to the target object to be aligned.
    • goToObjectInstant

      void goToObjectInstant(String name)
      Sets the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.
      Parameters:
      name - The name of the new focus object.
    • landOnObject

      void landOnObject(String name)
      Lands on the object with the given name, if it is an instance of Planet. The land location is determined by the line of sight from the current position of the camera to the object.
      Parameters:
      name - The proper name of the object.
    • landAtObjectLocation

      void landAtObjectLocation(String name, String locationName)
      Lands on the object with the given name, if it is an instance of Planet, at the location with the given name, if it exists.
      Parameters:
      name - The proper name of the object.
      locationName - The name of the location to land on
    • landAtObjectLocation

      void landAtObjectLocation(String name, double longitude, double latitude)
      Lands on the object with the given name, if it is an instance of Planet, at the location specified in by [latitude, longitude], in degrees.
      Parameters:
      name - The proper name of the object.
      longitude - The location longitude, in degrees.
      latitude - The location latitude, in degrees.
    • getDistanceTo

      double getDistanceTo(String name)
      Returns the distance to the surface of the object identified with the given name. If the object is an abstract node or does not exist, it returns a negative distance.
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
      Returns:
      The distance to the object in km if it exists, a negative value otherwise.
    • getStarParameters

      double[] getStarParameters(String starId)
      Returns the star parameters given its identifier or name, if the star exists and it is loaded.
      Parameters:
      starId - The star identifier or name.
      Returns:
      An array with (ra [deg], dec [deg], parallax [mas], pmra [mas/yr], pmdec [mas/yr], radvel [km/s], appmag [mag], red [0,1], green [0,1], blue [0,1]) if the star exists and is loaded, null otherwise.
    • getObjectPosition

      double[] getObjectPosition(String name)
      Gets the current position of the object identified by name in the internal coordinate system and internal units. If the object does not exist, it returns null
      Parameters:
      name - The name or id (HIP, TYC, sourceId) of the object.
      Returns:
      A 3-vector with the object's position in the internal reference system.
    • addPolyline

      void addPolyline(String name, double[] points, double[] color)
      Adds a new polyline with the given name, points and color. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive of GL_LINE_STRIP is used.
      Parameters:
      name - The name to identify the polyline, to possibly remove it later.
      points - The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].
      color - The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
    • addPolyline

      void addPolyline(String name, double[] points, double[] color, double lineWidth)
      Adds a new polyline with the given name, points, color and line width. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive type of GL_LINE_STRIP is used.
      Parameters:
      name - The name to identify the polyline, to possibly remove it later.
      points - The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].
      color - The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
      lineWidth - The line width. Usually a value between 1 (default) and 10.
    • addPolyline

      void addPolyline(String name, double[] points, double[] color, double lineWidth, boolean arrowCaps)
      Adds a new polyline with the given name, points, color and line width. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive type of GL_LINE_STRIP is used. This version enables the addition of arrow caps. In the case arrow caps are enabled, the line will be rendered in CPU mode (no VBO), making it slightly slower, especially for lines with many points. The arrow cap is added at the first point in the series.
      Parameters:
      name - The name to identify the polyline, to possibly remove it later.
      points - The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].
      color - The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
      lineWidth - The line width. Usually a value between 1 (default) and 10.
      arrowCaps - Whether to represent arrow caps. If enabled, the line is rendered in CPU mode, which is slower.
    • addPolyline

      void addPolyline(String name, double[] points, double[] color, double lineWidth, int primitive)
      Adds a new polyline with the given name, points, color, line width and primitive. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it.
      Parameters:
      name - The name to identify the polyline, to possibly remove it later.
      points - The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].
      color - The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
      lineWidth - The line width. Usually a value between 1 (default) and 10.
      primitive - The GL primitive: GL_LINES=1, GL_LINE_LOOP=2, GL_LINE_STRIP=3
    • addPolyline

      void addPolyline(String name, double[] points, double[] color, double lineWidth, int primitive, boolean arrowCaps)
      Adds a new polyline with the given name, points, color, line width, primitive and arrow caps. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. This version enables the addition of arrow caps. In the case arrow caps are enabled, the line will be rendered in CPU mode (no VBO), making it slightly slower, especially for lines with many points. The arrow cap is added at the first point in the series.
      Parameters:
      name - The name to identify the polyline, to possibly remove it later.
      points - The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].
      color - The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
      lineWidth - The line width. Usually a value between 1 (default) and 10.
      primitive - The GL primitive: GL_LINES=1, GL_LINE_LOOP=2, GL_LINE_STRIP=3
      arrowCaps - Whether to represent arrow caps. If enabled, the line is rendered in CPU mode, which is slower.
    • removeModelObject

      void removeModelObject(String name)

      Removes the model object identified by the given name from the internal scene graph model of Gaia Sky, if it exists. If the object has children, they are removed recursively. Be careful with this function, as it can have unexpected side effects depending on what objects are removed. For example,

      gs.removeModelObject("Earth")

      removes the Earth, the Moon, Gaia and any dependent object from Gaia Sky.

      Parameters:
      name - The name of the object to remove.
    • setGuiScrollPosition

      void setGuiScrollPosition(float pixelY)
      Sets the vertical scroll position in the GUI.
      Parameters:
      pixelY - The pixel to set the scroll position to.
    • enableGui

      void enableGui()
      Enables the GUI rendering. This makes the user interface to be rendered and updated again if it was previously disabled. Otherwise, it has no effect.
    • disableGui

      void disableGui()
      Disables the GUI rendering. This causes the user interface to no longer be rendered or updated.
    • maximizeInterfaceWindow

      void maximizeInterfaceWindow()
      Maximizes the interface window.
    • minimizeInterfaceWindow

      void minimizeInterfaceWindow()
      Minimizes the interface window.
    • setGuiPosition

      void setGuiPosition(float x, float y)
      Moves the interface window to a new position.
      Parameters:
      x - The new x coordinate of the new top-left corner of the window, in [0,1] from left to right.
      y - The new y coordinate of the new top-left corner of the window, in [0,1] from bottom to top.
    • waitForInput

      void waitForInput()
      Blocks the execution until any kind of input (keyboard, mouse, etc.) is received.
    • waitForEnter

      void waitForEnter()
      Blocks the execution until the Enter key is pressed.
    • waitForInput

      void waitForInput(int code)
      Blocks the execution until the given key or button is pressed.
      Parameters:
      code - The key or button code. Please see Input.
    • getScreenWidth

      int getScreenWidth()
      Returns the screen width in pixels.
      Returns:
      The screen width in pixels.
    • getScreenHeight

      int getScreenHeight()
      Returns the screen height in pixels.
      Returns:
      The screen height in pixels.
    • getPositionAndSizeGui

      float[] getPositionAndSizeGui(String name)
      Returns the size and position of the GUI element that goes by the given name or null if such element does not exist. Warning> This will only work in asynchronous mode.
      Parameters:
      name - The name of the gui element.
      Returns:
      A vector of floats with the position (0, 1) of the bottom left corner in pixels from the bottom-left of the screen and the size (2, 3) in pixels of the element.
    • getVersionNumber

      String getVersionNumber()
      Returns the version number string.
      Returns:
      The version number string.
    • waitFocus

      boolean waitFocus(String name, long timeoutMs)
      Blocks the script until the focus is the object indicated by the name. There is an optional time out.
      Parameters:
      name - The name of the focus to wait for.
      timeoutMs - Timeout in ms to wait. Set negative to disable timeout.
      Returns:
      True if the timeout ran out. False otherwise.
    • setCameraRecorderFps

      void setCameraRecorderFps(double targetFps)
      Sets the target frame rate of the camera recorder. This will cap the frame rate of Gaia Sky to this value while the camera is recording. When playing the camera file back, you are responsible to set the right frame rate.
      Parameters:
      targetFps - The target frame rate for the camera recorder.
    • startRecordingCameraPath

      void startRecordingCameraPath()
      Starts recording the camera path to an auto-generated file in the default camera directory. This command has no effect if the camera is already being recorded.
    • startRecordingCameraPath

      void startRecordingCameraPath(String fileName)
      Starts recording a camera path with the given filename. The filename is without extension or path. The final path with the camera file, after invoking stopRecordingCameraPath(), is:

      getDefaultCameraDir() + "/" + filename + ".gsc"

      This command has no effect if the camera is already being recorded.
    • stopRecordingCameraPath

      void stopRecordingCameraPath()
      Stops the current camera recording. This command has no effect if the camera was not being recorded.
    • runCameraRecording

      void runCameraRecording(String file)
      Runs the camera recording file with the given path. Does not wait for the camera file to finish playing.
      Parameters:
      file - The path of the camera file. Path is relative to the application's root directory or absolute.
    • runCameraPath

      void runCameraPath(String file)
      Runs a .gsc camera path file and returns immediately. This function does not wait for the camera file to finish playing.
      Parameters:
      file - The path to the camera file. Path is relative to the application's root directory or absolute.
    • playCameraPath

      void playCameraPath(String file)
    • runCameraPath

      void runCameraPath(String file, boolean sync)
      Runs a .gsc camera path file and returns immediately. This function accepts a boolean indicating whether to wait for the camera path file to finish or not.
      Parameters:
      file - The path to the camera file. Path is relative to the application's root directory or absolute.
      sync - If true, the call is synchronous and waits for the camera file to finish. Otherwise, it returns immediately.
    • playCameraPath

      void playCameraPath(String file, boolean sync)
    • cameraTransition

      void cameraTransition(double[] camPos, double[] camDir, double[] camUp, double seconds)
      Creates a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} in the given number of seconds. This function waits for the transition to finish and then returns control to the script. This function will put the camera in free mode, so make sure to change it afterwards if you need to. Also, this only works with the natural camera.
      Parameters:
      camPos - The target camera position in the internal reference system.
      camDir - The target camera direction in the internal reference system.
      camUp - The target camera up in the internal reference system.
      seconds - The duration of the transition in seconds.
    • cameraTransitionKm

      void cameraTransitionKm(double[] camPos, double[] camDir, double[] camUp, double seconds)
      Same as cameraTransition(double[], double[], double[], double) but the camera position is given in Km.
      Parameters:
      camPos - The target camera position in Km.
      camDir - The target camera direction vector.
      camUp - The target camera up vector.
      seconds - The duration of the transition in seconds.
    • cameraTransition

      void cameraTransition(double[] camPos, double[] camDir, double[] camUp, double seconds, boolean sync)
      Creates a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} in the given number of seconds. Optionally, the transition may be run synchronously or asynchronously to the current script. This function will put the camera in free mode, so make sure to change it afterwards if you need to. Also, this only works with the natural camera.
      Parameters:
      camPos - The target camera position in the internal reference system.
      camDir - The target camera direction in the internal reference system.
      camUp - The target camera up in the internal reference system.
      seconds - The duration of the transition in seconds.
      sync - If true, the call waits for the transition to finish before returning, otherwise it returns immediately
    • sleep

      void sleep(float seconds)
      Sleeps for the given number of seconds in the application time (FPS), so if we are capturing frames and the frame rate is set to 30 FPS, the command sleep(1) will put the script to sleep for 30 frames.
      Parameters:
      seconds - The number of seconds to wait.
    • sleepFrames

      void sleepFrames(long frames)
      Sleeps for a number of frames. The frame monitor is notified at the beginning of each frame, before the update-render cycle. When frames is 1, this method returns just before the processing of the next frame starts.
      Parameters:
      frames - The number of frames to wait.
    • expandGuiComponent

      void expandGuiComponent(String name)
      Expands the component with the given name.
      Parameters:
      name - The name, as in `CameraComponent` or `ObjectsComponent`
    • collapseGuiComponent

      void collapseGuiComponent(String name)
      Collapses the component with the given name.
      Parameters:
      name - The name, as in `CameraComponent` or `ObjectsComponent`
    • galacticToInternalCartesian

      double[] galacticToInternalCartesian(double l, double b, double r)
      Converts galactic coordinates to the internal cartesian coordinate system.
      Parameters:
      l - The galactic longitude in degrees.
      b - The galactic latitude in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • eclipticToInternalCartesian

      double[] eclipticToInternalCartesian(double l, double b, double r)
      Converts ecliptic coordinates to the internal cartesian coordinate system.
      Parameters:
      l - The ecliptic longitude in degrees.
      b - The ecliptic latitude in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • equatorialToInternalCartesian

      double[] equatorialToInternalCartesian(double ra, double dec, double r)
      Converts equatorial coordinates to the internal cartesian coordinate system.
      Parameters:
      ra - The right ascension in degrees.
      dec - The declination in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • internalCartesianToEquatorial

      double[] internalCartesianToEquatorial(double x, double y, double z)
      Converts internal cartesian coordinates to equatorial [ra, dec, distance] coordinates.
      Parameters:
      x - The x component, in any distance units.
      y - The y component, in any distance units.
      z - The z component, in any distance units.
      Returns:
      An array of doubles containing [ra, dec, distance] with ra and dec in degrees and distance in the same distance units as the input position.
    • equatorialCartesianToInternalCartesian

      double[] equatorialCartesianToInternalCartesian(double[] eq, double kmFactor)
      Converts regular cartesian coordinates, where XY is the equatorial plane, with X pointing to the vernal equinox (ra=0) and Y points to ra=90, and Z pointing to the celestial north pole (dec=90) to internal cartesian coordinates with internal units.
      Parameters:
      eq - Equatorial cartesian coordinates (X->[ra=0,dec=0], Y->[ra=90,dec=0], Z->[ra=0,dec=90])
      kmFactor - Factor used to bring the input coordinate units to Kilometers, so that eq * factor = Km
      Returns:
      Internal coordinates ready to be fed in other scripting functions
    • equatorialToGalactic

      double[] equatorialToGalactic(double[] eq)
      Converts equatorial cartesian coordinates (in the internal reference system) to galactic cartesian coordinates.
      Parameters:
      eq - Vector with [x, y, z] equatorial cartesian coordinates
      Returns:
      Vector with [x, y, z] galactic cartesian coordinates
    • equatorialToEcliptic

      double[] equatorialToEcliptic(double[] eqInternal)
      Converts equatorial cartesian coordinates (in the internal reference system) to ecliptic cartesian coordinates.
      Parameters:
      eqInternal - Vector with [x, y, z] equatorial cartesian coordinates
      Returns:
      Vector with [x, y, z] ecliptic cartesian coordinates
    • galacticToEquatorial

      double[] galacticToEquatorial(double[] galInternal)
      Converts galactic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
      Parameters:
      galInternal - Vector with [x, y, z] galactic cartesian coordinates
      Returns:
      Vector with [x, y, z] equatorial cartesian coordinates
    • eclipticToEquatorial

      double[] eclipticToEquatorial(double[] eclInternal)
      Converts ecliptic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
      Parameters:
      eclInternal - Vector with [x, y, z] ecliptic cartesian coordinates
      Returns:
      Vector with [x, y, z] equatorial cartesian coordinates
    • setBrightnessLevel

      void setBrightnessLevel(double level)
      Sets the brightness level of the render system.
      Parameters:
      level - The brightness level as a double precision floating point number in [-1,1]. The neutral value is 0.0.
    • setContrastLevel

      void setContrastLevel(double level)
      Sets the contrast level of the render system.
      Parameters:
      level - The contrast level as a double precision floating point number in [0,2]. The neutral value is 1.0.
    • setHueLevel

      void setHueLevel(double level)
      Sets the hue level of the render system.
      Parameters:
      level - The hue level as a double precision floating point number in [0,2]. The neutral value is 1.0.
    • setSaturationLevel

      void setSaturationLevel(double level)
      Sets the saturation level of the render system.
      Parameters:
      level - The saturation level as a double precision floating point number in [0,2]. The neutral value is 1.0.
    • setGammaCorrectionLevel

      void setGammaCorrectionLevel(double level)
      Sets the gamma correction level.
      Parameters:
      level - The gamma correction level in [0,3] as a floating point number. The neutral value is 1.2.
    • setHDRToneMappingType

      void setHDRToneMappingType(String type)
      Sets the high dynamic range tone mapping algorithm type. The types can be:
      • "auto" - performs an automatic HDR tone mapping based on the current luminosity of the scene
      • "exposure" - performs an exposure-based HDR tone mapping. The exposure value must be set with setExposureToneMappingLevel(double)
      • "aces" - performs the ACES tone mapping
      • "uncharted" - performs the tone mapping implemented in Uncharted
      • "filmic" - performs a filmic tone mapping
      • "none" - no HDR tone mapping
      Parameters:
      type - The HDR tone mapping type. One of ["auto"|"exposure"|"aces"|"uncharted"|"filmic"|"none"].
    • setExposureToneMappingLevel

      void setExposureToneMappingLevel(double level)
      Sets the exposure level.
      Parameters:
      level - The exposure level in [0,n]. Set to 0 to disable exposure tone mapping.
    • setPlanetariumMode

      void setPlanetariumMode(boolean state)
      Enables and disables the planetarium mode.
      Parameters:
      state - The boolean sate. True to activate, false to deactivate.
    • setCubemapMode

      void setCubemapMode(boolean state, String projection)
      Enables and disables the cubemap mode.
      Parameters:
      state - The boolean sate. True to activate, false to deactivate.
    • setPanoramaMode

      void setPanoramaMode(boolean state)
      Enables and disables the panorama mode.
      Parameters:
      state - The boolean staet. True to activate, false to deactivate.
    • setCubemapResolution

      void setCubemapResolution(int resolution)
      Sets the resolution (width and height are the same) of each side of the frame buffers used to capture each of the 6 directions that go into the cubemap to construct the equirectangular image for the 360 mode. This should roughly be 1/3 of the output resolution at which the 360 mode are to be captured (or screen resolution).
      Parameters:
      resolution - The resolution of each of the sides of the cubemap for the 360 mode.
    • setCubemapProjection

      void setCubemapProjection(String projection)
      Sets the cubemap projection to use. Accepted values are "EQUIRECTANGULAR", "CYLINDRICAL" and "HAMMER". See CubemapProjections for possible values.
      Parameters:
      projection - The projection, in ["EQUIRECTANGULAR"|"CYLINDRICAL"|"HAMMER"].
    • setStereoscopicMode

      void setStereoscopicMode(boolean state)
      Enables and disables the stereoscopic mode.
      Parameters:
      state - The boolean sate. True to activate, false to deactivate.
    • setStereoscopicProfile

      void setStereoscopicProfile(int index)
      Changes the stereoscopic profile.
      Parameters:
      index - The index of the new profile:
      • 0 - VR_HEADSET
      • 1 - HD_3DTV
      • 2 - CROSSEYE
      • 3 - PARALLEL_VIEW
      • 4 - ANAGLYPHIC (red-cyan)
    • getCurrentFrameNumber

      long getCurrentFrameNumber()
      Gets the current frame number. Useful for timing actions in scripts.
      Returns:
      The current frame number.
    • setLensFlare

      void setLensFlare(boolean state)
      Enables or deisables the lens flare effect.
      Parameters:
      state - Activate (true) or deactivate (false).
    • setMotionBlur

      void setMotionBlur(boolean state)
      Enables or disables the motion blur effect.
      Parameters:
      state - Activate (true) or deactivate (false).
    • setStarGlow

      void setStarGlow(boolean state)
      Enables or disables the star glow effect.
      Parameters:
      state - Activate (true) or deactivate (false).
    • setBloom

      void setBloom(float value)
      Sets the strength value for the bloom effect.
      Parameters:
      value - Bloom strength between 0 and 100. Set to 0 to deactivate the bloom.
    • setSmoothLodTransitions

      void setSmoothLodTransitions(boolean value)
      Sets the value of smooth lod transitions, allowing or disallowing octant fade-ins of as they come into view.
      Parameters:
      value - Activate (true) or deactivate (false).
    • resetImageSequenceNumber

      void resetImageSequenceNumber()
      Resets to zero the image sequence number used to generate the file names of the frame output images.
    • getDefaultFramesDir

      String getDefaultFramesDir()
      Gets the absolute path of the default directory where the still frames are saved.
      Returns:
      Absolute path of directory where still frames are saved.
    • getDefaultScreenshotsDir

      String getDefaultScreenshotsDir()
      Gets the absolute path of the default directory where the screenshots are saved.
      Returns:
      Absolute path of directory where screenshots are saved.
    • getDefaultCameraDir

      String getDefaultCameraDir()
      Gets the absolute path of the default directory where the camera files are saved.
      Returns:
      Absolute path of directory where camera files are saved.
    • getDefaultMusicDir

      String getDefaultMusicDir()
      Gets the absolute path to the location of the music files
      Returns:
      Absolute path to the location of the music files
    • getDefaultMappingsDir

      String getDefaultMappingsDir()
      Gets the absolute path to the location of the inputListener mappings.
      Returns:
      Absolute path to the location of the inputListener mappings.
    • getDataDir

      String getDataDir()
      Gets the absolute path of the local data directory, configured in your config.yaml file.
      Returns:
      Absolute path to the location of the data files.
    • getConfigDir

      String getConfigDir()
      Gets the absolute path to the location of the configuration directory
      Returns:
      Absolute path of config directory.
    • getLocalDataDir

      String getLocalDataDir()
      Returns the default data directory. That is ~/.gaiasky/ in Windows and macOS, and ~/.local/share/gaiasky in Linux.
      Returns:
      Absolute path of data directory.
    • postRunnable

      void postRunnable(Runnable runnable)
      Posts a Runnable to the main loop thread. The runnable runs only once. This will execute the runnable right after the current update-render cycle has finished.
      Parameters:
      runnable - The runnable to run.
    • parkRunnable

      void parkRunnable(String id, Runnable runnable)
      Parks a Runnable to the main loop thread, and keeps it running every frame until it finishes or it is unparked by unparkRunnable(String). Be careful with this function, as it probably needs a cleanup before the script is finished. Otherwise, all parked runnables will keep running until Gaia Sky is restarted, so make sure to remove them with unparkRunnable(String) if needed.
      Parameters:
      id - The string id to identify the runnable.
      runnable - The runnable to park.
    • removeRunnable

      void removeRunnable(String id)
      Removes the runnable with the given id, if any.
      Parameters:
      id - The id of the runnable to remove.
    • unparkRunnable

      @Deprecated void unparkRunnable(String id)
      Deprecated.
      Removes the runnable with the given id, if any.
      Parameters:
      id - The id of the runnable to remove.
    • loadDataset

      boolean loadDataset(String dsName, String path)
      Loads a VOTable, FITS or CSV dataset file with the given name. In this version, the loading happens synchronously, so the catalog is available to Gaia Sky immediately after this call returns. The actual loading process is carried out making educated guesses about semantics using UCDs and column names. Please check the official documentation for a complete reference on what can and what can't be loaded.
      Parameters:
      dsName - The name of the dataset, used to identify the subsequent operations on the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      Returns:
      False if the dataset could not be loaded, true otherwise.
    • loadDataset

      boolean loadDataset(String dsName, String path, boolean sync)
      Loads a VOTable, FITS or CSV dataset file with the given name. The call can be made synchronous or asynchronous.
      If sync is true, the call acts exactly like loadDataset(String, String).
      If sync is false, the loading happens in a new thread and the call returns immediately. In this case, you can use hasDataset(String) to check whether the dataset is already loaded and available. The actual loading process is carried out making educated guesses about semantics using UCDs and column names. Please check the official documentation for a complete reference on what can and what can't be loaded.
      Parameters:
      dsName - The name of the dataset, used to identify the subsequent operations on the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadDataset

      boolean loadDataset(String dsName, String path, CatalogInfo.CatalogInfoSource type, DatasetOptions options, boolean sync)
      Loads a VOTable, FITS or CSV dataset file with the given name. The call can be made synchronous or asynchronous.
      If sync is true, the call acts exactly like loadDataset(String, String, boolean).
      If sync is false, the loading happens in a new thread and the call returns immediately. In this case, you can use hasDataset(String) to check whether the dataset is already loaded and available. The actual loading process is carried out making educated guesses about semantics using UCDs and column names. Please check the official documentation for a complete reference on what can and what can't be loaded. This version includes the catalog info type.
      Parameters:
      dsName - The name of the dataset, used to identify the subsequent operations on the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      type - The CatalogInfo.CatalogInfoSource object to use as the dataset type.
      options - The DatasetOptions object holding the options for this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarDataset

      boolean loadStarDataset(String dsName, String path, boolean sync)
      Loads a star dataset from a VOTable file (.vot). The dataset does not have a label. The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarDataset

      boolean loadStarDataset(String dsName, String path, double magnitudeScale, boolean sync)
      Loads a star dataset from a VOTable file (.vot). The dataset does not have a label. The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      magnitudeScale - Scaling additive factor to apply to the star magnitudes, as in appmag = appmag - magnitudeScale.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarDataset

      boolean loadStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, boolean sync)
      Loads a star dataset from a VOTable file (.vot). The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      magnitudeScale - Scaling additive factor to apply to the star magnitudes, as in appmag = appmag - magnitudeScale.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarDataset

      boolean loadStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a star dataset from a VOTable file (.vot). The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      magnitudeScale - Scaling additive factor to apply to the star magnitudes, as in appmag = appmag - magnitudeScale.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadParticleDataset

      boolean loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, String ct, boolean sync)
      Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot). The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      profileDecay - The profile decay of the particles as in 1 - distCentre^decay.
      particleColor - The base color of the particles, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      colorNoise - In [0,1], the noise to apply to the color so that each particle gets a slightly different tone. Set to 0 so that all particles get the same color.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      particleSize - The size of the particles in pixels.
      ct - The name of the component type to use like "Stars", "Galaxies", etc. (see ComponentTypes.ComponentType).
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadParticleDataset

      boolean loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot). The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      profileDecay - The profile decay of the particles as in 1 - distCentre^decay.
      particleColor - The base color of the particles, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      colorNoise - In [0,1], the noise to apply to the color so that each particle gets a slightly different tone. Set to 0 so that all particles get the same color.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      particleSize - The size of the particles in pixels.
      ct - The name of the component type to use like "Stars", "Galaxies", etc. (see ComponentTypes.ComponentType).
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadParticleDataset

      boolean loadParticleDataset(String dsName, String path, double profileDecay, double[] particleColor, double colorNoise, double[] labelColor, double particleSize, double[] particleSizeLimits, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a particle dataset (only positions and extra attributes) from a VOTable file (.vot). The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      profileDecay - The profile decay of the particles as in 1 - distCentre^decay.
      particleColor - The base color of the particles, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      colorNoise - In [0,1], the noise to apply to the color so that each particle gets a slightly different tone. Set to 0 so that all particles get the same color.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      particleSize - The size of the particles in pixels.
      particleSizeLimits - The minimum and maximum size of the particles in pixels.
      ct - The name of the component type to use like "Stars", "Galaxies", etc. (see ComponentTypes.ComponentType).
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarClusterDataset

      boolean loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a star cluster dataset from a CSV file. The file needs the columns with the following names: name, ra, dec, dist, pmra, pmdec, radius, radvel. Uses the same color for clusters and labels. The call can be made synchronous or asynchronous. If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      particleColor - The base color of the particles and labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarClusterDataset

      boolean loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a star cluster dataset from a CSV file. The file needs the columns with the following names: name, ra, dec, dist, pmra, pmdec, radius, radvel. The call can be made synchronous or asynchronous. If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      particleColor - The base color of the particles, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarClusterDataset

      boolean loadStarClusterDataset(String dsName, String path, double[] particleColor, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a star cluster dataset from a CSV file. The file needs the columns with the following names: name, ra, dec, dist, pmra, pmdec, radius, radvel. Uses the same color for clusters and labels. The call can be made synchronous or asynchronous. If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      particleColor - The base color of the particles and labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      ct - The name of the component type to use (see ComponentTypes.ComponentType).
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadStarClusterDataset

      boolean loadStarClusterDataset(String dsName, String path, double[] particleColor, double[] labelColor, String ct, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a star cluster dataset from a CSV file. The file needs the columns with the following names: name, ra, dec, dist, pmra, pmdec, radius, radvel. The call can be made synchronous or asynchronous. If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      particleColor - The base color of the particles and labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      ct - The name of the component type to use (see ComponentTypes.ComponentType).
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • loadVariableStarDataset

      boolean loadVariableStarDataset(String dsName, String path, double magnitudeScale, double[] labelColor, double[] fadeIn, double[] fadeOut, boolean sync)
      Loads a variable star dataset from a VOTable file (.vot). The variable star table must have the following columns representing the light curve:
      • g_transit_time: list of times as Julian days since J2010 for each of the magnitudes
      • g_transit_mag: list of magnitudes corresponding to the times in g_transit_times
      • pf: the period in days
      The call can be made synchronous or asynchronous.
      If sync is true, the call waits until the dataset is loaded and then returns. If sync is false, the loading happens in a new thread and the call returns immediately. It includes some parameters to apply to the new star group.
      Parameters:
      dsName - The name of the dataset.
      path - Absolute path (or relative to the working path of Gaia Sky) to the .vot file to load.
      magnitudeScale - Scaling additive factor to apply to the magnitudes in the light curve, as in appmag = appmag - magnitudeScale.
      labelColor - The color of the labels, as an array of RGBA (red, green, blue, alpha) values in [0,1].
      fadeIn - Two values which represent the fade in mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      fadeOut - Two values which represent the fade out mapping distances (in parsecs, as distance from camera to the Sun) of this dataset.
      sync - Whether the load must happen synchronously or asynchronously.
      Returns:
      False if the dataset could not be loaded (sync mode). True if it could not be loaded (sync mode), or sync is false.
    • removeDataset

      boolean removeDataset(String dsName)
      Removes the dataset identified by the given name, if it exists.
      Parameters:
      dsName - The name of the dataset to remove.
      Returns:
      False if the dataset could not be found.
    • hideDataset

      boolean hideDataset(String dsName)
      Hides the dataset identified by the given name, if it exists and is not hidden.
      Parameters:
      dsName - The name of the dataset to hide.
      Returns:
      False if the dataset could not be found.
    • listDatasets

      List<String> listDatasets()
      Returns the names of all datasets currently loaded.
      Returns:
      A list with all the names of the loaded datasets.
    • hasDataset

      boolean hasDataset(String dsName)
      Checks whether the dataset identified by the given name is loaded
      Parameters:
      dsName - The name of the dataset to query.
      Returns:
      True if the dataset is loaded, false otherwise.
    • showDataset

      boolean showDataset(String dsName)
      Shows (un-hides) the dataset identified by the given name, if it exists and is hidden
      Parameters:
      dsName - The name of the dataset to show.
      Returns:
      False if the dataset could not be found.
    • highlightDataset

      boolean highlightDataset(String dsName, int colorIndex, boolean highlight)
      Enables or disables the dataset highlight, using a plain color given by the color index:
      • 0 - blue
      • 1 - red
      • 2 - yellow
      • 3 - green
      • 4 - pink
      • 5 - orange
      • 6 - purple
      • 7 - brown
      • 8 - magenta
      Parameters:
      dsName - The dataset name.
      colorIndex - Color index in [0,8].
      highlight - Whether to highlight or not.
      Returns:
      False if the dataset could not be found.
    • highlightDataset

      boolean highlightDataset(String dsName, boolean highlight)
      Enables or disables the dataset highlight using a plain color chosen by the system.
      Parameters:
      dsName - The dataset name.
      highlight - State.
      Returns:
      False if the dataset could not be found.
    • highlightDataset

      boolean highlightDataset(String dsName, float r, float g, float b, float a, boolean highlight)
      Enables or disables the dataset highlight, using a given plain color.
      Parameters:
      dsName - The dataset name.
      r - Red component.
      highlight - State.
      Returns:
      False if the dataset could not be found.
    • highlightDataset

      boolean highlightDataset(String dsName, String attributeName, String colorMap, double minMap, double maxMap, boolean highlight)
      Enables or disables the dataset highlight, using the given color map on the given attribute with the given maximum and minimum mapping values.
      Parameters:
      dsName - The dataset name.
      attributeName - The attribute name. You can use basic attributes (please mind the case!):
      • RA
      • DEC
      • Distance
      • GalLatitude
      • GalLongitude
      • EclLatitude
      • EclLongitude
      Or star-only attributes (if your dataset contains stars, mind the case!):
      • Mualpha
      • Mudelta
      • Radvel
      • Absmag
      • Appmag
      Or even extra attributes (if you loaded the dataset yourself), matching by column name.
      colorMap - The color map to use, in ["reds"|"greens"|"blues"|"rainbow18"|"rainbow"|"seismic"|"carnation"|"hotmeal"|"cool"].
      minMap - The minimum mapping value.
      maxMap - The maximum mapping value.
      highlight - State.
      Returns:
      False if the dataset could not be found.
    • setDatasetHighlightSizeFactor

      boolean setDatasetHighlightSizeFactor(String dsName, float sizeFactor)
      Sets the size increase factor of this dataset when highlighted.
      Parameters:
      dsName - The dataset name.
      sizeFactor - The size factor to apply to the particles when highlighted, must be in [Constants.MIN_DATASET_SIZE_FACTOR, Constants.MAX_DATASET_SIZE_FACTOR].
      Returns:
      False if the dataset could not be found.
    • setDatasetHighlightAllVisible

      boolean setDatasetHighlightAllVisible(String dsName, boolean allVisible)
      Sets the 'all visible' property of datasets when highlighted. If set to true, all stars in the dataset have an increased minimum opacity when highlighted, so that they are all visible. Otherwise, stars retain their minimum opacity and base brightness.
      Parameters:
      dsName - The dataset name.
      allVisible - Whether all stars in the dataset should be visible when highlighted or not.
      Returns:
      False if the dataset could not be found.
    • setDatasetPointSizeMultiplier

      void setDatasetPointSizeMultiplier(String dsName, double multiplier)
      Sets the dataset point size multiplier.
      Parameters:
      dsName - The dataset name.
      multiplier - The multiplier, as a positive floating point number.
    • addShapeAroundObject

      void addShapeAroundObject(String shapeName, String shape, String primitive, double size, String objectName, float r, float g, float b, float a, boolean showLabel, boolean trackObject)
      Creates a shape object of the given type with the given size around the object with the given name.
      Parameters:
      shapeName - The name of the shape object.
      shape - The shape type, one of
      • sphere
      • icosphere
      • octahedronsphere
      • ring
      • cylinder
      • cone
      primitive - The primitive to use, one of
      • lines
      • triangles
      . Use 'lines' to create a wireframe shape, use 'triangles' for a solid shape.
      size - The size of the object in kilometers.
      objectName - The name of the object to use as the position.
      r - The red component of the color in [0,1].
      g - The green component of the color in [0,1].
      b - The blue component of the color in [0,1].
      a - The alpha component of the color in [0,1].
      showLabel - Whether to show a label with the name of the shape.
      trackObject - Whether to track the object if/when it moves.
    • setMaximumSimulationTime

      void setMaximumSimulationTime(long years)
      Sets the maximum simulation time allowed, in years. This sets the maximum time in the future (years) and in the past (-years). This setting is not saved to the configuration and resets to 5 Myr after restart.
      Parameters:
      years - The maximum year number to allow.
    • getMeterToInternalUnitConversion

      double getMeterToInternalUnitConversion()
      Returns the meter to internal unit conversion factor. Use this factor to multiply your coordinates in meters to get them in internal units.
      Returns:
      The factor M_TO_U.
    • getInternalUnitToMeterConversion

      double getInternalUnitToMeterConversion()
      Returns the internal unit to meter conversion factor. Use this factor to multiply your coordinates in internal units to get them in meters.
      Returns:
      The factor U_TO_M.
    • internalUnitsToMetres

      double internalUnitsToMetres(double internalUnits)
      Converts the value in internal units to metres.
      Parameters:
      internalUnits - The value in internal units.
      Returns:
      The value in metres.
    • internalUnitsToKilometres

      double internalUnitsToKilometres(double internalUnits)
      Converts the value in internal units to Kilometers.
      Parameters:
      internalUnits - The value in internal units.
      Returns:
      The value in Kilometers.
    • internalUnitsToKilometres

      double[] internalUnitsToKilometres(double[] internalUnits)
      Converts the array in internal units to Kilometers.
      Parameters:
      internalUnits - The array in internal units.
      Returns:
      The array in Kilometers.
    • metresToInternalUnits

      double metresToInternalUnits(double metres)
      Converts the metres to internal units.
      Parameters:
      metres - The value in metres.
      Returns:
      The value in internal units.
    • kilometresToInternalUnits

      double kilometresToInternalUnits(double kilometres)
      Converts the kilometres to internal units.
      Parameters:
      kilometres - The value in kilometers.
      Returns:
      The value in internal units.
    • getFrameNumber

      long getFrameNumber()
      Gets the current frame number. The number begins at 0 for the first frame produced when Gaia Sky is started and increases continuously.
      Returns:
      The current frame number.
    • rotate3

      double[] rotate3(double[] vector, double[] axis, double angle)
      Rotates a 3D vector around the given axis by the specified angle in degrees. Vectors are arrays with 3 components. If more components are there, they are ignored.
      Parameters:
      vector - Vector to rotate, with at least 3 components.
      axis - The axis, with at least 3 components.
      angle - Angle in degrees.
      Returns:
      The new vector, rotated.
    • rotate2

      double[] rotate2(double[] vector, double angle)
      Rotates a 2D vector by the specified angle in degrees, counter-clockwise assuming that the y axis points up.
      Parameters:
      vector - Vector to rotate, with at least 2 components.
      Returns:
      The new vector, rotated.
    • cross3

      double[] cross3(double[] vec1, double[] vec2)
      Computes the cross product between the two 3D vectors.
      Parameters:
      vec1 - First 3D vector.
      vec2 - Second 3D vector.
      Returns:
      Cross product 3D vector.
    • dot3

      double dot3(double[] vec1, double[] vec2)
      Computes the dot product between the two 3D vectors.
      Parameters:
      vec1 - First 3D vector.
      vec2 - Second 3D vector.
      Returns:
      The dot product scalar.
    • print

      void print(String message)
      Print text using the internal logging system.
      Parameters:
      message - The message.
    • log

      void log(String message)
      Print text using the internal logging system.
      Parameters:
      message - The message.
    • error

      void error(String message)
      Log an error using the internal logging system.
      Parameters:
      message - The error message.
    • quit

      void quit()
      Initiates the quit action to terminate the program.