Class Transformation


  • public final class Transformation
    extends java.lang.Object
    Some functions for converting 2D vectors between World and Local space
    Author:
    sallyx (https://www.sallyx.org/sally/en/game-ai/)
    • Constructor Detail

      • Transformation

        public Transformation()
    • Method Detail

      • vec2DRotateAroundOrigin

        public static Vector2 vec2DRotateAroundOrigin​(Vector2 vector,
                                                      float angle)
      • vec2DRotateAroundOrigin

        public static Vector2 vec2DRotateAroundOrigin​(float x,
                                                      float y,
                                                      float angle)
      • createWhiskers

        public static java.util.List<Vector2> createWhiskers​(int numWhiskers,
                                                             float whiskerLength,
                                                             float fov,
                                                             Vector2 facing,
                                                             Vector2 origin)
      • wrapAround

        public static Vector2 wrapAround​(Vector2 position,
                                         int maxX,
                                         int maxY)