src/boids_simpkg/util

Types

Triangle = object
  pos*: Vector2
  vel*: Vector2

Procs

proc drawRectangleLines(pos: Vector2; size: Vector2; color: Color) {....raises: [],
    tags: [], forbids: [].}
func fromRad(_: typedesc[Vector2]; radians: float): Vector2
func heading(t: Triangle): float {....raises: [], tags: [], forbids: [].}
func headingTowards(pos: Vector2; target: Vector2): float {....raises: [],
    tags: [], forbids: [].}
func ints(v: Vector2): (int, int) {....raises: [], tags: [], forbids: [].}
func `tuple`(v: Vector2): (float, float) {....raises: [], tags: [], forbids: [].}
Convert a Vector2 to a tuple. This is very useful for unpacking values: let (x, y) = v.tuple
func withAlpha(c: Color; alpha: uint8): Color {....raises: [], tags: [],
    forbids: [].}
func withX(v: Vector2; x: float): Vector2 {....raises: [], tags: [], forbids: [].}
func withY(v: Vector2; y: float): Vector2 {....raises: [], tags: [], forbids: [].}