Module vector2

Types

Vector2* {.
byref
.} = object x*: float32 y*: float32
  Source Edit

Procs

proc vec2*(x, y: float32): Vector2 {.
inline
.}
  Source Edit
proc `$`*(self: Vector2): string {.
inline
.}
  Source Edit
proc normalized*(self: Vector2): Vector2 {.
importc: "godot_vector2_normalized"
.}
  Source Edit
proc length*(self: Vector2): float32 {.
importc: "godot_vector2_length"
.}
  Source Edit
proc angle*(self: Vector2): float32 {.
importc: "godot_vector2_angle"
.}
  Source Edit
proc lengthSquared*(self: Vector2): float32 {.
importc: "godot_vector2_length_squared"
.}
  Source Edit
proc isNormalized*(self: Vector2): bool {.
importc: "godot_vector2_is_normalized"
.}
  Source Edit
proc distanceTo*(self, to: Vector2): float32 {.
importc: "godot_vector2_distance_to"
.}
  Source Edit
proc distanceSquaredTo*(self, to: Vector2): float32 {.
importc: "godot_vector2_distance_squared_to"
.}
  Source Edit
proc angleTo*(self, to: Vector2): float32 {.
importc: "godot_vector2_angle_to"
.}
  Source Edit
proc angleToPoint*(self, to: Vector2): float32 {.
importc: "godot_vector2_angle_to_point"
.}
  Source Edit
proc lerp*(self, b: Vector2; t: float32): Vector2 {.
importc: "godot_vector2_linear_interpolate"
.}
  Source Edit
proc cubicInterpolate*(self, b, pre_a, post_b: Vector2; t: float32): Vector2 {.
importc: "godot_vector2_cubic_interpolate"
.}
  Source Edit
proc rotated*(self: Vector2; phi: float32): Vector2 {.
importc: "godot_vector2_rotated"
.}
  Source Edit
proc tangent*(self: Vector2): Vector2 {.
importc: "godot_vector2_tangent"
.}
  Source Edit
proc floor*(self: Vector2): Vector2 {.
importc: "godot_vector2_floor"
.}
  Source Edit
proc snapped*(self: Vector2; by: Vector2): Vector2 {.
importc: "godot_vector2_snapped"
.}
  Source Edit
proc aspect*(self: Vector2): float32 {.
importc: "godot_vector2_aspect"
.}
  Source Edit
proc dot*(a, b: Vector2): float32 {.
importc: "godot_vector2_dot"
.}
  Source Edit
proc slide*(self, n: Vector2): Vector2 {.
importc: "godot_vector2_slide"
.}
  Source Edit
proc bounce*(self, n: Vector2): Vector2 {.
importc: "godot_vector2_bounce"
.}
  Source Edit
proc reflect*(self, n: Vector2): Vector2 {.
importc: "godot_vector2_reflect"
.}
  Source Edit
proc abs*(self: Vector2): Vector2 {.
importc: "godot_vector2_abs"
.}
  Source Edit
proc clamped*(self: Vector2; length: float32): Vector2 {.
importc: "godot_vector2_clamped"
.}
  Source Edit
proc `+`*(a, b: Vector2): Vector2 {.
importc: "godot_vector2_operator_add"
.}
  Source Edit
proc `+=`*(a: var Vector2; b: Vector2) {.
inline
.}
  Source Edit
proc `-`*(a, b: Vector2): Vector2 {.
importc: "godot_vector2_operator_substract"
.}
  Source Edit
proc `-=`*(a: var Vector2; b: Vector2) {.
inline
.}
  Source Edit
proc `*`*(a, b: Vector2): Vector2 {.
importc: "godot_vector2_operator_multiply_vector"
.}
  Source Edit
proc `*=`*(a: var Vector2; b: Vector2) {.
inline
.}
  Source Edit
proc `*`*(self: Vector2; scalar: float32): Vector2 {.
importc: "godot_vector2_operator_multiply_scalar"
.}
  Source Edit
proc `*=`*(self: var Vector2; scalar: float32) {.
inline
.}
  Source Edit
proc `/`*(a, b: Vector2): Vector2 {.
importc: "godot_vector2_operator_divide_vector"
.}
  Source Edit
proc `/=`*(a: var Vector2; b: Vector2) {.
inline
.}
  Source Edit
proc `/`*(self: Vector2; scalar: float32): Vector2 {.
importc: "godot_vector2_operator_divide_scalar"
.}
  Source Edit
proc `/=`*(self: var Vector2; scalar: float32) {.
inline
.}
  Source Edit
proc `==`*(a, b: Vector2): bool {.
importc: "godot_vector2_operator_equal"
.}
  Source Edit
proc `<`*(a, b: Vector2): bool {.
importc: "godot_vector2_operator_less"
.}
  Source Edit
proc `-`*(self: Vector2): Vector2 {.
importc: "godot_vector2_operator_neg"
.}
  Source Edit
proc `x =`*(self: var Vector2; x: float32) {.
importc: "godot_vector2_set_x"
.}
  Source Edit
proc `y =`*(self: var Vector2; y: float32) {.
importc: "godot_vector2_set_y"
.}
  Source Edit
proc x*(self: Vector2): float32 {.
importc: "godot_vector2_get_x"
.}
  Source Edit
proc y*(self: Vector2): float32 {.
importc: "godot_vector2_get_y"
.}
  Source Edit