Uses of Record Class
cit244.api.geom.Vec2

Packages that use Vec2
Package
Description
Main API for CIT AViz sketches, including drawing, input, timing, and controls.
Two-dimensional geometry and vector operations.
Images, sprite regions, sprite sheets, and frame-based animation.
  • Uses of Vec2 in cit244.api

    Methods in cit244.api that return Vec2
    Modifier and Type
    Method
    Description
    default Vec2
    Returns the mouse position in viewport coordinates.
    Methods in cit244.api with parameters of type Vec2
    Modifier and Type
    Method
    Description
    default void
    Graphics.at(Vec2 position, Runnable body)
    Runs a drawing block with its origin at the given position, restoring the previous state afterward.
    default void
    Graphics.circle(Vec2 center, double radius)
    Draws a circle centered at a vector at.
    default void
    Graphics.curveVertex(Vec2 position)
    Adds a smooth curve vertex at the given position.
    default void
    Graphics.line(Vec2 start, Vec2 end)
    Draws a line between two positions.
    default void
    Graphics.point(Vec2 position)
    Draws a point at a vector position.
    default void
    Graphics.rect(Vec2 position, double width, double height)
    Draws a rectangle at the given top-left position.
    default void
    Graphics.rect(Vec2 position, Vec2 size)
    Draws a rectangle using vectors for its position and dimensions.
    default void
    Graphics.rectCenter(Vec2 center, double width, double height)
    Draws a rectangle centered at the given position.
    default void
    Graphics.translate(Vec2 offset)
    Translates the coordinate system by a vector.
    default void
    Graphics.vertex(Vec2 position)
    Adds a vertex at the given position to the current shape.
  • Uses of Vec2 in cit244.api.geom

    Fields in cit244.api.geom declared as Vec2
    Modifier and Type
    Field
    Description
    static final Vec2
    Vec2.ZERO
    The zero vector, with both components equal to zero.
    Methods in cit244.api.geom that return Vec2
    Modifier and Type
    Method
    Description
    Vec2.add(Vec2 other)
    Adds another vector component-wise.
    static Vec2
    Vec2.lerp(Vec2 a, Vec2 b, double t)
    Blends between two vectors.
    Vec2.scaled(double factor)
    Multiplies both components by a scalar.
    Vec2.subtract(Vec2 other)
    Subtracts another vector component-wise.
    Vec2.translated(double dx, double dy)
    Returns this vector displaced by the given horizontal and vertical amounts.
    Methods in cit244.api.geom with parameters of type Vec2
    Modifier and Type
    Method
    Description
    Vec2.add(Vec2 other)
    Adds another vector component-wise.
    double
    Vec2.distanceTo(Vec2 other)
    Returns the Euclidean distance to another position.
    static Vec2
    Vec2.lerp(Vec2 a, Vec2 b, double t)
    Blends between two vectors.
    Vec2.subtract(Vec2 other)
    Subtracts another vector component-wise.
  • Uses of Vec2 in cit244.api.image

    Methods in cit244.api.image with parameters of type Vec2
    Modifier and Type
    Method
    Description
    Sprite.at(Vec2 position)
    Creates drawing instructions at the given screen position.
    SpriteDraw.at(Vec2 position)
    Returns drawing instructions at the given position.
    SpriteDraw.translate(Vec2 offset)
    Moves the anchor by a displacement in screen coordinates.