Class CameraCalculator

java.lang.Object
org.collebol.client.math.CameraCalculator

public class CameraCalculator extends Object
You can calculate camera data here.
Since:
1.0-dev
Author:
ColleBol - contact@collebol.org
  • Constructor Details

  • Method Details

    • getGameLocationFromPanelPosition

      public GameLocation getGameLocationFromPanelPosition(Vector2D position)
      This calculates method will calculate the current GameLocation on the given Vector2D cords. If the camera moves or zooms in or rotates, the GameLocation will change.
      Parameters:
      position - Panel position to calculate the current GameLocation on that Panel position.
      Returns:
      The GameLocation on the given Panel position.
    • getPanelPositionFromGameLocation

      public Vector2D getPanelPositionFromGameLocation(GameLocation gameLocation)
      This method calculates the Panel position on screen from a given GameLocation. It takes into account the camera's position, zoom, and rotation.
      Parameters:
      gameLocation - The GameLocation to convert to a Panel position.
      Returns:
      The corresponding Panel position as a Vector2D.