Interface Screen


public interface Screen
The plane a DocumentView exists on.

Screen coordinates exist in one of 3 spaces

World space coordinates
They denote the actual size and dimensions of a screen in a minecraft world.
Intermediate coordinates
Set with the screen-width and screen-height document options. They may not always be actual sizes of the screen.
Screen coordinates
0 to 1 coordinates relative to the width and height of the screen.
Screens store an internal Transformation that is applied to the screen. This may mean that (if scaling is involved) world and intermediate coordinates may differ in sizes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
    Default height of the screen: 2
    static final float
    Default width of the screen: 3
    static final float
    Maximum screen size: 10
    static final float
    Minimum screen size: 1
  • Method Summary

    Modifier and Type
    Method
    Description
    org.joml.Vector3f
    Gets the center point of the screen
    org.joml.Vector2f
    Gets the width and height of the screen
    float
    Gets the height of the screen
    org.joml.Vector3f
    Gets the lower left corner of the screen from the viewer's perspective
    org.joml.Vector3f
    Gets the lower right corner of the screen from the viewer's perspective
    org.joml.Vector3f
    Gets the upper left corner of the screen from the viewer's perspective
    org.joml.Vector3f
    Gets the upper right corner of the screen from the viewer's perspective
    float
    Gets the width of the screen
    float
    Get the actual height of the screen in the world space size
    float
    Get the actual width of the screen in world space size
    org.joml.Vector3f
    Gets the normal (direction) of the screen's plane
    void
    project(org.bukkit.util.Transformation transformation)
    Transform the specified transformation so that it is aligned, rotated and scaled to match the screen.
    void
    screenspaceToScreen(org.joml.Vector2f in, org.joml.Vector2f out)
    Maps screen coordinates in range [0..1] to [0..getDimensions()] space and stores the result in the out argument.
    void
    screenspaceToWorld(org.joml.Vector2f screenPoint, org.joml.Vector3f out)
    Maps screen coordinates in range [0..1] to world coordinates and stores the result in the out argument.
    void
    screenToScreenspace(org.joml.Vector2f in, org.joml.Vector2f out)
    Maps screen coordinates in range [0..getDimensions()] to [0..1] space and stores the result in the out argument.
    void
    screenToWorld(org.joml.Vector2f screenPoint, org.joml.Vector3f out)
    Maps screen coordinates in range [0..getDimensions()] to world coordinates and stores the result in the out argument.
  • Field Details

    • DEFAULT_WIDTH

      static final float DEFAULT_WIDTH
      Default width of the screen: 3
      See Also:
    • DEFAULT_HEIGHT

      static final float DEFAULT_HEIGHT
      Default height of the screen: 2
      See Also:
    • MIN_SCREEN_SIZE

      static final float MIN_SCREEN_SIZE
      Minimum screen size: 1
      See Also:
    • MAX_SCREEN_SIZE

      static final float MAX_SCREEN_SIZE
      Maximum screen size: 10
      See Also:
  • Method Details

    • getWidth

      float getWidth()
      Gets the width of the screen
      Returns:
      Screen width
    • getWorldWidth

      float getWorldWidth()
      Get the actual width of the screen in world space size
      Returns:
      Actual screen width
    • getHeight

      float getHeight()
      Gets the height of the screen
      Returns:
      Screen height
    • getWorldHeight

      float getWorldHeight()
      Get the actual height of the screen in the world space size
      Returns:
      Actual screen height
    • normal

      org.joml.Vector3f normal()
      Gets the normal (direction) of the screen's plane
      Returns:
      Screen normal
    • center

      org.joml.Vector3f center()
      Gets the center point of the screen
      Returns:
      Screen center
    • getDimensions

      org.joml.Vector2f getDimensions()
      Gets the width and height of the screen
      Returns:
      Screen dimensions, (width, height)
    • getLowerLeft

      org.joml.Vector3f getLowerLeft()
      Gets the lower left corner of the screen from the viewer's perspective
      Returns:
      Lower left corner
    • getLowerRight

      org.joml.Vector3f getLowerRight()
      Gets the lower right corner of the screen from the viewer's perspective
      Returns:
      Lower right corner
    • getUpperLeft

      org.joml.Vector3f getUpperLeft()
      Gets the upper left corner of the screen from the viewer's perspective
      Returns:
      Upper left corner
    • getUpperRight

      org.joml.Vector3f getUpperRight()
      Gets the upper right corner of the screen from the viewer's perspective
      Returns:
      Upper right corner
    • screenToWorld

      void screenToWorld(org.joml.Vector2f screenPoint, org.joml.Vector3f out)
      Maps screen coordinates in range [0..getDimensions()] to world coordinates and stores the result in the out argument.
      Parameters:
      screenPoint - Screen point, in space [0..getDimensions()]
      out - Result destination
    • screenToScreenspace

      void screenToScreenspace(org.joml.Vector2f in, org.joml.Vector2f out)
      Maps screen coordinates in range [0..getDimensions()] to [0..1] space and stores the result in the out argument.
      Parameters:
      in - Input in range [0..getDimensions()]
      out - Result output, in range [0..1]
    • screenspaceToScreen

      void screenspaceToScreen(org.joml.Vector2f in, org.joml.Vector2f out)
      Maps screen coordinates in range [0..1] to [0..getDimensions()] space and stores the result in the out argument.
      Parameters:
      in - Input in range [0..1]
      out - Result output, in range [0..getDimensions()]
    • screenspaceToWorld

      void screenspaceToWorld(org.joml.Vector2f screenPoint, org.joml.Vector3f out)
      Maps screen coordinates in range [0..1] to world coordinates and stores the result in the out argument.
      Parameters:
      screenPoint - Screen point, in space [0..1]
      out - Result destination
    • project

      void project(org.bukkit.util.Transformation transformation)
      Transform the specified transformation so that it is aligned, rotated and scaled to match the screen.
      Parameters:
      transformation - Input transformation