Migrate to NativeScript+GDNative
This commit is contained in:
parent
1e6646713f
commit
b41a37681f
22 changed files with 608 additions and 611 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
author = "Xored Software, Inc."
|
author = "Xored Software, Inc."
|
||||||
description = "Godot Engine bindings"
|
description = "Godot Engine bindings"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,28 @@ import hashes
|
||||||
import godotbase, poolarray, variant, strings
|
import godotbase, poolarray, variant, strings
|
||||||
|
|
||||||
proc initArray(dest: var Array) {.
|
proc initArray(dest: var Array) {.
|
||||||
importc: "godot_array_new", header: "godot_array.h".}
|
importc: "godot_array_new", header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pca: PoolColorArray) {.
|
proc initArray(dest: var Array; pca: PoolColorArray) {.
|
||||||
importc: "godot_array_new_pool_coloarray",
|
importc: "godot_array_new_pool_coloarray",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pv3a: PoolVector3Array) {.
|
proc initArray(dest: var Array; pv3a: PoolVector3Array) {.
|
||||||
importc: "godot_array_new_pool_vector3_array",
|
importc: "godot_array_new_pool_vector3_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pv2a: PoolVector2Array) {.
|
proc initArray(dest: var Array; pv2a: PoolVector2Array) {.
|
||||||
importc: "godot_array_new_pool_vector2_array",
|
importc: "godot_array_new_pool_vector2_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; psa: PoolStringArray) {.
|
proc initArray(dest: var Array; psa: PoolStringArray) {.
|
||||||
importc: "godot_array_new_pool_string_array",
|
importc: "godot_array_new_pool_string_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pra: PoolRealArray) {.
|
proc initArray(dest: var Array; pra: PoolRealArray) {.
|
||||||
importc: "godot_array_new_pool_real_array",
|
importc: "godot_array_new_pool_real_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pia: PoolIntArray) {.
|
proc initArray(dest: var Array; pia: PoolIntArray) {.
|
||||||
importc: "godot_array_new_pool_int_array",
|
importc: "godot_array_new_pool_int_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc initArray(dest: var Array; pba: PoolByteArray) {.
|
proc initArray(dest: var Array; pba: PoolByteArray) {.
|
||||||
importc: "godot_array_new_pool_byte_array",
|
importc: "godot_array_new_pool_byte_array",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
|
|
||||||
proc initArray*(): Array {.inline.} =
|
proc initArray*(): Array {.inline.} =
|
||||||
initArray(result)
|
initArray(result)
|
||||||
|
|
@ -54,79 +54,79 @@ proc initArray*(pba: PoolByteArray): Array {.inline.} =
|
||||||
proc `[]=`*(self: var Array; idx: cint;
|
proc `[]=`*(self: var Array; idx: cint;
|
||||||
value: Variant) {.
|
value: Variant) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_set", header: "godot_array.h".}
|
importc: "godot_array_set", header: "godot/array.h".}
|
||||||
proc `[]`*(self: Array; idx: cint): Variant {.
|
proc `[]`*(self: Array; idx: cint): Variant {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_get", header: "godot_array.h".}
|
importc: "godot_array_get", header: "godot/array.h".}
|
||||||
proc mget*(self: var Array; idx: cint): ptr Variant {.
|
proc mget*(self: var Array; idx: cint): ptr Variant {.
|
||||||
importc: "godot_array_operator_index", header: "godot_array.h".}
|
importc: "godot_array_operator_index", header: "godot/array.h".}
|
||||||
|
|
||||||
proc add*(self: var Array; value: Variant) {.
|
proc add*(self: var Array; value: Variant) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_append", header: "godot_array.h".}
|
importc: "godot_array_append", header: "godot/array.h".}
|
||||||
proc clear*(self: var Array) {.importc: "godot_array_clear",
|
proc clear*(self: var Array) {.importc: "godot_array_clear",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc count*(self: Array; value: Variant): cint {.
|
proc count*(self: Array; value: Variant): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_count", header: "godot_array.h".}
|
importc: "godot_array_count", header: "godot/array.h".}
|
||||||
proc isEmpty*(self: Array): bool {.
|
proc isEmpty*(self: Array): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_empty", header: "godot_array.h".}
|
importc: "godot_array_empty", header: "godot/array.h".}
|
||||||
proc erase*(self: var Array; value: Variant) {.
|
proc erase*(self: var Array; value: Variant) {.
|
||||||
importc: "godot_array_erase", header: "godot_array.h".}
|
importc: "godot_array_erase", header: "godot/array.h".}
|
||||||
proc first*(self: Array): Variant {.
|
proc first*(self: Array): Variant {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_front", header: "godot_array.h".}
|
importc: "godot_array_front", header: "godot/array.h".}
|
||||||
proc last*(self: Array): Variant {.
|
proc last*(self: Array): Variant {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_back", header: "godot_array.h".}
|
importc: "godot_array_back", header: "godot/array.h".}
|
||||||
proc find*(self: Array; what: Variant;
|
proc find*(self: Array; what: Variant;
|
||||||
f: cint): cint {.
|
f: cint): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_find", header: "godot_array.h".}
|
importc: "godot_array_find", header: "godot/array.h".}
|
||||||
proc findLast*(self: Array; what: Variant): cint {.
|
proc findLast*(self: Array; what: Variant): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_find_last", header: "godot_array.h".}
|
importc: "godot_array_find_last", header: "godot/array.h".}
|
||||||
proc contains*(self: Array; value: Variant): bool {.
|
proc contains*(self: Array; value: Variant): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_has", header: "godot_array.h".}
|
importc: "godot_array_has", header: "godot/array.h".}
|
||||||
|
|
||||||
proc godotHash*(self: Array): cint {.
|
proc godotHash*(self: Array): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_hash", header: "godot_array.h".}
|
importc: "godot_array_hash", header: "godot/array.h".}
|
||||||
proc hash*(self: Array): Hash {.inline.} =
|
proc hash*(self: Array): Hash {.inline.} =
|
||||||
hash(godotHash(self))
|
hash(godotHash(self))
|
||||||
|
|
||||||
proc insert*(self: var Array; pos: cint;
|
proc insert*(self: var Array; pos: cint;
|
||||||
value: Variant) {.
|
value: Variant) {.
|
||||||
importc: "godot_array_insert", header: "godot_array.h".}
|
importc: "godot_array_insert", header: "godot/array.h".}
|
||||||
proc reverse*(self: var Array) {.importc: "godot_array_invert",
|
proc reverse*(self: var Array) {.importc: "godot_array_invert",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc popLast*(self: var Array): Variant {.
|
proc popLast*(self: var Array): Variant {.
|
||||||
importc: "godot_array_pop_back", header: "godot_array.h".}
|
importc: "godot_array_pop_back", header: "godot/array.h".}
|
||||||
proc popFirst*(self: var Array): Variant {.
|
proc popFirst*(self: var Array): Variant {.
|
||||||
importc: "godot_array_pop_front", header: "godot_array.h".}
|
importc: "godot_array_pop_front", header: "godot/array.h".}
|
||||||
proc addLast*(self: var Array; value: Variant) {.
|
proc addLast*(self: var Array; value: Variant) {.
|
||||||
importc: "godot_array_push_back", header: "godot_array.h".}
|
importc: "godot_array_push_back", header: "godot/array.h".}
|
||||||
proc addFirst*(self: var Array; value: Variant) {.
|
proc addFirst*(self: var Array; value: Variant) {.
|
||||||
importc: "godot_array_push_front", header: "godot_array.h".}
|
importc: "godot_array_push_front", header: "godot/array.h".}
|
||||||
|
|
||||||
proc delete*(self: var Array; idx: cint) {.
|
proc delete*(self: var Array; idx: cint) {.
|
||||||
importc: "godot_array_remove", header: "godot_array.h".}
|
importc: "godot_array_remove", header: "godot/array.h".}
|
||||||
proc setLen*(self: var Array; size: cint) {.
|
proc setLen*(self: var Array; size: cint) {.
|
||||||
importc: "godot_array_resize", header: "godot_array.h".}
|
importc: "godot_array_resize", header: "godot/array.h".}
|
||||||
proc rfind*(self: Array; what: Variant;
|
proc rfind*(self: Array; what: Variant;
|
||||||
f: cint): cint {.
|
f: cint): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_rfind", header: "godot_array.h".}
|
importc: "godot_array_rfind", header: "godot/array.h".}
|
||||||
proc len*(self: Array): cint {.
|
proc len*(self: Array): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_array_size", header: "godot_array.h".}
|
importc: "godot_array_size", header: "godot/array.h".}
|
||||||
proc sort*(self: var Array) {.importc: "godot_array_sort",
|
proc sort*(self: var Array) {.importc: "godot_array_sort",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
proc sortCustom*(self: var Array; obj: var GodotObject;
|
proc sortCustom*(self: var Array; obj: var GodotObject;
|
||||||
funcName: GodotString) {.
|
funcName: GodotString) {.
|
||||||
importc: "godot_array_sort_custom", header: "godot_array.h".}
|
importc: "godot_array_sort_custom", header: "godot/array.h".}
|
||||||
|
|
||||||
iterator items*(arr: Array): Variant =
|
iterator items*(arr: Array): Variant =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,22 @@
|
||||||
import godotbase, vector3, quat, strings
|
import godotbase, vector3, quat, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Basis* {.importc: "godot_basis", header: "godot_basis.h", byref.} = object
|
Basis* {.importc: "godot_basis", header: "godot/basis.h", byref.} = object
|
||||||
|
|
||||||
proc initBasis(dest: var Basis) {.importc: "godot_basis_new",
|
proc initBasis(dest: var Basis) {.importc: "godot_basis_new",
|
||||||
header: "godot_basis.h".}
|
header: "godot/basis.h".}
|
||||||
proc initBasis(dest: var Basis;
|
proc initBasis(dest: var Basis;
|
||||||
xAxis: Vector3;
|
xAxis: Vector3;
|
||||||
yAxis: Vector3;
|
yAxis: Vector3;
|
||||||
zAxis: Vector3) {.
|
zAxis: Vector3) {.
|
||||||
importc: "godot_basis_new_with_rows", header: "godot_basis.h".}
|
importc: "godot_basis_new_with_rows", header: "godot/basis.h".}
|
||||||
proc initBasis(dest: var Basis;
|
proc initBasis(dest: var Basis;
|
||||||
euler: Quat) {.
|
euler: Quat) {.
|
||||||
importc: "godot_basis_new_with_euler_quat", header: "godot_basis.h".}
|
importc: "godot_basis_new_with_euler_quat", header: "godot/basis.h".}
|
||||||
proc initBasis(dest: var Basis; axis: Vector3; phi: float32) {.
|
proc initBasis(dest: var Basis; axis: Vector3; phi: float32) {.
|
||||||
importc: "godot_basis_new_with_axis_and_angle", header: "godot_basis.h".}
|
importc: "godot_basis_new_with_axis_and_angle", header: "godot/basis.h".}
|
||||||
proc initBasis(dest: var Basis; euler: Vector3) {.
|
proc initBasis(dest: var Basis; euler: Vector3) {.
|
||||||
importc: "godot_basis_new_with_euler", header: "godot_basis.h".}
|
importc: "godot_basis_new_with_euler", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc initBasis*(): Basis {.inline.} =
|
proc initBasis*(): Basis {.inline.} =
|
||||||
initBasis(result)
|
initBasis(result)
|
||||||
|
|
@ -37,104 +37,104 @@ proc initBasis*(euler: Vector3): Basis {.inline.} =
|
||||||
|
|
||||||
proc toGodotString*(self: Basis): GodotString {.
|
proc toGodotString*(self: Basis): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_as_string", header: "godot_basis.h".}
|
importc: "godot_basis_as_string", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc `$`*(self: Basis): string {.inline.} =
|
proc `$`*(self: Basis): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc inverse*(self: Basis): Basis {.
|
proc inverse*(self: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_inverse", header: "godot_basis.h".}
|
importc: "godot_basis_inverse", header: "godot/basis.h".}
|
||||||
proc transposed*(self: Basis): Basis {.
|
proc transposed*(self: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_transposed", header: "godot_basis.h".}
|
importc: "godot_basis_transposed", header: "godot/basis.h".}
|
||||||
proc orthonormalized*(self: Basis): Basis {.
|
proc orthonormalized*(self: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_orthonormalized", header: "godot_basis.h".}
|
importc: "godot_basis_orthonormalized", header: "godot/basis.h".}
|
||||||
proc determinant*(self: Basis): float32 {.
|
proc determinant*(self: Basis): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_determinant", header: "godot_basis.h".}
|
importc: "godot_basis_determinant", header: "godot/basis.h".}
|
||||||
proc rotated*(self: Basis; axis: Vector3;
|
proc rotated*(self: Basis; axis: Vector3;
|
||||||
phi: float32): Basis {.
|
phi: float32): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_rotated", header: "godot_basis.h".}
|
importc: "godot_basis_rotated", header: "godot/basis.h".}
|
||||||
proc scaled*(self: Basis; scale: Vector3): Basis {.
|
proc scaled*(self: Basis; scale: Vector3): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_scaled", header: "godot_basis.h".}
|
importc: "godot_basis_scaled", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc setScale*(self: var Basis; scale: Vector3) {.
|
proc setScale*(self: var Basis; scale: Vector3) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_set_scale", header: "godot_basis.h".}
|
importc: "godot_basis_set_scale", header: "godot/basis.h".}
|
||||||
proc setRotationEuler*(self: var Basis;
|
proc setRotationEuler*(self: var Basis;
|
||||||
euler: Vector3) {.
|
euler: Vector3) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_set_rotation_euler", header: "godot_basis.h".}
|
importc: "godot_basis_set_rotation_euler", header: "godot/basis.h".}
|
||||||
proc setRotationAxisAngle*(self: var Basis; axis: Vector3; angle: float32) {.
|
proc setRotationAxisAngle*(self: var Basis; axis: Vector3; angle: float32) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_set_rotation_axis_angle", header: "godot_basis.h".}
|
importc: "godot_basis_set_rotation_axis_angle", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc scale*(self: Basis): Vector3 {.
|
proc scale*(self: Basis): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_scale", header: "godot_basis.h".}
|
importc: "godot_basis_get_scale", header: "godot/basis.h".}
|
||||||
proc euler*(self: Basis): Vector3 {.
|
proc euler*(self: Basis): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_euler", header: "godot_basis.h".}
|
importc: "godot_basis_get_euler", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc tdotx*(self: Basis; x: Vector3): float32 {.
|
proc tdotx*(self: Basis; x: Vector3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_tdotx", header: "godot_basis.h".}
|
importc: "godot_basis_tdotx", header: "godot/basis.h".}
|
||||||
proc tdoty*(self: Basis; y: Vector3): float32 {.
|
proc tdoty*(self: Basis; y: Vector3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_tdoty", header: "godot_basis.h".}
|
importc: "godot_basis_tdoty", header: "godot/basis.h".}
|
||||||
proc tdotz*(self: Basis; z: Vector3): float32 {.
|
proc tdotz*(self: Basis; z: Vector3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_tdotz", header: "godot_basis.h".}
|
importc: "godot_basis_tdotz", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc xform*(self: Basis; v: Vector3): Vector3 {.
|
proc xform*(self: Basis; v: Vector3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_xform", header: "godot_basis.h".}
|
importc: "godot_basis_xform", header: "godot/basis.h".}
|
||||||
proc xformInv*(self: Basis; v: Vector3): Vector3 {.
|
proc xformInv*(self: Basis; v: Vector3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_xform_inv", header: "godot_basis.h".}
|
importc: "godot_basis_xform_inv", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc orthogonalIndex*(self: Basis): cint {.
|
proc orthogonalIndex*(self: Basis): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_orthogonal_index", header: "godot_basis.h".}
|
importc: "godot_basis_get_orthogonal_index", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc godot_basis_get_elements(self: Basis;
|
proc godot_basis_get_elements(self: Basis;
|
||||||
elements: var array[3, Vector3]) {.
|
elements: var array[3, Vector3]) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_elements", header: "godot_basis.h".}
|
importc: "godot_basis_get_elements", header: "godot/basis.h".}
|
||||||
|
|
||||||
proc elements*(self: Basis): array[3, Vector3] {.inline.} =
|
proc elements*(self: Basis): array[3, Vector3] {.inline.} =
|
||||||
godot_basis_get_elements(self, result)
|
godot_basis_get_elements(self, result)
|
||||||
|
|
||||||
proc `[]`*(self: Basis; axis: range[0..2]): Vector3 {.
|
proc `[]`*(self: Basis; axis: range[0..2]): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_axis", header: "godot_basis.h".}
|
importc: "godot_basis_get_axis", header: "godot/basis.h".}
|
||||||
proc `[]=`*(self: var Basis; axis: range[0..2];
|
proc `[]=`*(self: var Basis; axis: range[0..2];
|
||||||
value: Vector3) {.
|
value: Vector3) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_set_axis", header: "godot_basis.h".}
|
importc: "godot_basis_set_axis", header: "godot/basis.h".}
|
||||||
proc row*(self: Basis; row: cint): Vector3 {.
|
proc row*(self: Basis; row: cint): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_get_row", header: "godot_basis.h".}
|
importc: "godot_basis_get_row", header: "godot/basis.h".}
|
||||||
proc setRow*(self: var Basis; row: cint;
|
proc setRow*(self: var Basis; row: cint;
|
||||||
value: Vector3) {.
|
value: Vector3) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_set_row", header: "godot_basis.h".}
|
importc: "godot_basis_set_row", header: "godot/basis.h".}
|
||||||
proc `==`*(self: Basis; b: Basis): bool {.
|
proc `==`*(self: Basis; b: Basis): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_operator_equal", header: "godot_basis.h".}
|
importc: "godot_basis_operator_equal", header: "godot/basis.h".}
|
||||||
proc `+`*(self: Basis; b: Basis): Basis {.
|
proc `+`*(self: Basis; b: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_operator_add", header: "godot_basis.h".}
|
importc: "godot_basis_operator_add", header: "godot/basis.h".}
|
||||||
proc `-`*(self: Basis; b: Basis): Basis {.
|
proc `-`*(self: Basis; b: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_operator_substract", header: "godot_basis.h".}
|
importc: "godot_basis_operator_substract", header: "godot/basis.h".}
|
||||||
proc `*`*(self: Basis; b: Basis): Basis {.
|
proc `*`*(self: Basis; b: Basis): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_operator_multiply_vector", header: "godot_basis.h".}
|
importc: "godot_basis_operator_multiply_vector", header: "godot/basis.h".}
|
||||||
proc `*`*(self: Basis; b: float32): Basis {.
|
proc `*`*(self: Basis; b: float32): Basis {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_basis_operator_multiply_scalar", header: "godot_basis.h".}
|
importc: "godot_basis_operator_multiply_scalar", header: "godot/basis.h".}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
import godotbase, strings
|
import godotbase, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Color* {.importc: "godot_color", header: "godot_color.h", byref.} = object
|
Color* {.importc: "godot_color", header: "godot/color.h", byref.} = object
|
||||||
|
|
||||||
proc initColor(dest: var Color; r, g, b, a: float32) {.
|
proc initColor(dest: var Color; r, g, b, a: float32) {.
|
||||||
importc: "godot_color_new_rgba", header: "godot_color.h".}
|
importc: "godot_color_new_rgba", header: "godot/color.h".}
|
||||||
proc initColor(dest: var Color; r, g, b: float32) {.
|
proc initColor(dest: var Color; r, g, b: float32) {.
|
||||||
importc: "godot_color_new_rgb",
|
importc: "godot_color_new_rgb",
|
||||||
header: "godot_color.h".}
|
header: "godot/color.h".}
|
||||||
|
|
||||||
proc initColor*(r, g, b, a: float32): Color {.inline.} =
|
proc initColor*(r, g, b, a: float32): Color {.inline.} =
|
||||||
initColor(result, r, g, b, a)
|
initColor(result, r, g, b, a)
|
||||||
|
|
@ -18,41 +18,41 @@ proc initColor*(r, g, b: float32): Color {.inline.} =
|
||||||
initColor(result, r, g, b)
|
initColor(result, r, g, b)
|
||||||
|
|
||||||
proc r*(self: Color): float32 {.
|
proc r*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_r", header: "godot_color.h".}
|
importc: "godot_color_get_r", header: "godot/color.h".}
|
||||||
proc `r=`*(self: var Color; r: float32) {.
|
proc `r=`*(self: var Color; r: float32) {.
|
||||||
importc: "godot_color_set_r", header: "godot_color.h".}
|
importc: "godot_color_set_r", header: "godot/color.h".}
|
||||||
proc g*(self: Color): float32 {.
|
proc g*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_g", header: "godot_color.h".}
|
importc: "godot_color_get_g", header: "godot/color.h".}
|
||||||
proc `g=`*(self: var Color; g: float32) {.
|
proc `g=`*(self: var Color; g: float32) {.
|
||||||
importc: "godot_color_set_g", header: "godot_color.h".}
|
importc: "godot_color_set_g", header: "godot/color.h".}
|
||||||
proc b*(self: Color): float32 {.
|
proc b*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_b", header: "godot_color.h".}
|
importc: "godot_color_get_b", header: "godot/color.h".}
|
||||||
proc `b=`*(self: var Color; b: float32) {.
|
proc `b=`*(self: var Color; b: float32) {.
|
||||||
importc: "godot_color_set_b", header: "godot_color.h".}
|
importc: "godot_color_set_b", header: "godot/color.h".}
|
||||||
proc a*(self: Color): float32 {.
|
proc a*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_a", header: "godot_color.h".}
|
importc: "godot_color_get_a", header: "godot/color.h".}
|
||||||
proc `a=`*(self: var Color; a: float32) {.
|
proc `a=`*(self: var Color; a: float32) {.
|
||||||
importc: "godot_color_set_a", header: "godot_color.h".}
|
importc: "godot_color_set_a", header: "godot/color.h".}
|
||||||
|
|
||||||
proc h*(self: Color): float32 {.
|
proc h*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_h", header: "godot_color.h".}
|
importc: "godot_color_get_h", header: "godot/color.h".}
|
||||||
proc s*(self: Color): float32 {.
|
proc s*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_s", header: "godot_color.h".}
|
importc: "godot_color_get_s", header: "godot/color.h".}
|
||||||
proc v*(self: Color): float32 {.
|
proc v*(self: Color): float32 {.
|
||||||
importc: "godot_color_get_v", header: "godot_color.h".}
|
importc: "godot_color_get_v", header: "godot/color.h".}
|
||||||
|
|
||||||
proc toGodotString*(self: Color): GodotString {.
|
proc toGodotString*(self: Color): GodotString {.
|
||||||
importc: "godot_color_as_string", header: "godot_color.h".}
|
importc: "godot_color_as_string", header: "godot/color.h".}
|
||||||
proc `$`*(self: Color): string {.inline.} =
|
proc `$`*(self: Color): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc toHtml*(self: Color; with_alpha: bool): GodotString {.
|
proc toHtml*(self: Color; with_alpha: bool): GodotString {.
|
||||||
importc: "godot_color_to_html", header: "godot_color.h".}
|
importc: "godot_color_to_html", header: "godot/color.h".}
|
||||||
|
|
||||||
proc to32CInt(self: Color): cint {.
|
proc to32CInt(self: Color): cint {.
|
||||||
importc: "godot_color_to_32", header: "godot_color.h".}
|
importc: "godot_color_to_32", header: "godot/color.h".}
|
||||||
proc toARGB32CInt(self: Color): cint {.
|
proc toARGB32CInt(self: Color): cint {.
|
||||||
importc: "godot_color_to_ARGB32", header: "godot_color.h".}
|
importc: "godot_color_to_ARGB32", header: "godot/color.h".}
|
||||||
|
|
||||||
proc to32*(self: Color): uint32 {.inline.}=
|
proc to32*(self: Color): uint32 {.inline.}=
|
||||||
cast[uint32](to32CInt(self))
|
cast[uint32](to32CInt(self))
|
||||||
|
|
@ -60,17 +60,17 @@ proc toARGB32*(self: Color): uint32 {.inline.} =
|
||||||
cast[uint32](toARGB32CInt(self))
|
cast[uint32](toARGB32CInt(self))
|
||||||
|
|
||||||
proc gray*(self: Color): float32 {.
|
proc gray*(self: Color): float32 {.
|
||||||
importc: "godot_color_gray", header: "godot_color.h".}
|
importc: "godot_color_gray", header: "godot/color.h".}
|
||||||
proc inverted*(self: Color): Color {.
|
proc inverted*(self: Color): Color {.
|
||||||
importc: "godot_color_inverted", header: "godot_color.h".}
|
importc: "godot_color_inverted", header: "godot/color.h".}
|
||||||
proc contrasted*(self: Color): Color {.
|
proc contrasted*(self: Color): Color {.
|
||||||
importc: "godot_color_contrasted", header: "godot_color.h".}
|
importc: "godot_color_contrasted", header: "godot/color.h".}
|
||||||
proc lerp*(self: Color; b: Color; t: float32): Color {.
|
proc lerp*(self: Color; b: Color; t: float32): Color {.
|
||||||
importc: "godot_color_linear_interpolate", header: "godot_color.h".}
|
importc: "godot_color_linear_interpolate", header: "godot/color.h".}
|
||||||
proc blend*(self: Color; over: Color): Color {.
|
proc blend*(self: Color; over: Color): Color {.
|
||||||
importc: "godot_color_blend", header: "godot_color.h".}
|
importc: "godot_color_blend", header: "godot/color.h".}
|
||||||
|
|
||||||
proc `==`*(self, b: Color): bool {.
|
proc `==`*(self, b: Color): bool {.
|
||||||
importc: "godot_color_operator_equal", header: "godot_color.h".}
|
importc: "godot_color_operator_equal", header: "godot/color.h".}
|
||||||
proc `<`*(self, b: Color): bool {.
|
proc `<`*(self, b: Color): bool {.
|
||||||
importc: "godot_color_operator_less", header: "godot_color.h".}
|
importc: "godot_color_operator_less", header: "godot/color.h".}
|
||||||
|
|
|
||||||
|
|
@ -5,25 +5,25 @@ import godotbase, arrays, variant, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Dictionary* {.importc: "godot_dictionary",
|
Dictionary* {.importc: "godot_dictionary",
|
||||||
header: "godot_dictionary.h", byref.} = object
|
header: "godot/dictionary.h", byref.} = object
|
||||||
|
|
||||||
proc initVariant(dest: var Variant; dict: Dictionary) {.
|
proc initVariant(dest: var Variant; dict: Dictionary) {.
|
||||||
importc: "godot_variant_new_dictionary",
|
importc: "godot_variant_new_dictionary",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
|
|
||||||
proc variant*(dict: Dictionary): Variant {.inline.} =
|
proc variant*(dict: Dictionary): Variant {.inline.} =
|
||||||
initVariant(result, dict)
|
initVariant(result, dict)
|
||||||
|
|
||||||
proc asDictionary*(self: Variant): Dictionary {.
|
proc asDictionary*(self: Variant): Dictionary {.
|
||||||
importc: "godot_variant_as_dictionary", header: "godot_variant.h".}
|
importc: "godot_variant_as_dictionary", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc initDictionary(dest: var Dictionary;
|
proc initDictionary(dest: var Dictionary;
|
||||||
src: Dictionary) {.
|
src: Dictionary) {.
|
||||||
importc: "godot_dictionary_new_copy",
|
importc: "godot_dictionary_new_copy",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc deinit(self: var Dictionary) {.
|
proc deinit(self: var Dictionary) {.
|
||||||
importc: "godot_dictionary_destroy", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_destroy", header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc `=`(self: var Dictionary, other: Dictionary) {.inline.} =
|
proc `=`(self: var Dictionary, other: Dictionary) {.inline.} =
|
||||||
initDictionary(self, other)
|
initDictionary(self, other)
|
||||||
|
|
@ -32,36 +32,36 @@ proc `=destroy`(self: Dictionary) {.inline.} =
|
||||||
unsafeAddr(self)[].deinit()
|
unsafeAddr(self)[].deinit()
|
||||||
|
|
||||||
proc initDictionary(dest: var Dictionary) {.
|
proc initDictionary(dest: var Dictionary) {.
|
||||||
importc: "godot_dictionary_new", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_new", header: "godot/dictionary.h".}
|
||||||
proc initDictionary*(): Dictionary {.inline.} =
|
proc initDictionary*(): Dictionary {.inline.} =
|
||||||
initDictionary(result)
|
initDictionary(result)
|
||||||
|
|
||||||
proc len*(self: Dictionary): cint {.
|
proc len*(self: Dictionary): cint {.
|
||||||
importc: "godot_dictionary_size", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_size", header: "godot/dictionary.h".}
|
||||||
proc isEmpty*(self: Dictionary): bool {.
|
proc isEmpty*(self: Dictionary): bool {.
|
||||||
importc: "godot_dictionary_empty", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_empty", header: "godot/dictionary.h".}
|
||||||
proc clear*(self: var Dictionary) {.
|
proc clear*(self: var Dictionary) {.
|
||||||
importc: "godot_dictionary_clear", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_clear", header: "godot/dictionary.h".}
|
||||||
proc contains*(self: Dictionary; key: Variant): bool {.
|
proc contains*(self: Dictionary; key: Variant): bool {.
|
||||||
importc: "godot_dictionary_has",
|
importc: "godot_dictionary_has",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
proc contains*(self: Dictionary; keys: Array): bool {.
|
proc contains*(self: Dictionary; keys: Array): bool {.
|
||||||
importc: "godot_dictionary_has_all",
|
importc: "godot_dictionary_has_all",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
proc del*(self: var Dictionary; key: Variant) {.
|
proc del*(self: var Dictionary; key: Variant) {.
|
||||||
importc: "godot_dictionary_erase", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_erase", header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc godotHash*(self: Dictionary): cint {.
|
proc godotHash*(self: Dictionary): cint {.
|
||||||
importc: "godot_dictionary_hash", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_hash", header: "godot/dictionary.h".}
|
||||||
proc hash*(self: Dictionary): Hash {.inline.} =
|
proc hash*(self: Dictionary): Hash {.inline.} =
|
||||||
hash(godotHash(self))
|
hash(godotHash(self))
|
||||||
|
|
||||||
proc keys*(self: Dictionary): Array {.
|
proc keys*(self: Dictionary): Array {.
|
||||||
importc: "godot_dictionary_keys", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_keys", header: "godot/dictionary.h".}
|
||||||
proc values*(self: Dictionary): Array {.
|
proc values*(self: Dictionary): Array {.
|
||||||
importc: "godot_dictionary_values", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_values", header: "godot/dictionary.h".}
|
||||||
proc `[]`*(self: Dictionary; key: Variant): Variant {.
|
proc `[]`*(self: Dictionary; key: Variant): Variant {.
|
||||||
importc: "godot_dictionary_get", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_get", header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc `[]`*(self: Dictionary; keyStr: string): Variant =
|
proc `[]`*(self: Dictionary; keyStr: string): Variant =
|
||||||
let key = variant(keyStr)
|
let key = variant(keyStr)
|
||||||
|
|
@ -69,17 +69,17 @@ proc `[]`*(self: Dictionary; keyStr: string): Variant =
|
||||||
|
|
||||||
proc `[]=`*(self: var Dictionary; key, value: Variant) {.
|
proc `[]=`*(self: var Dictionary; key, value: Variant) {.
|
||||||
importc: "godot_dictionary_set",
|
importc: "godot_dictionary_set",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
proc mget*(self: var Dictionary; key: Variant): ptr Variant {.
|
proc mget*(self: var Dictionary; key: Variant): ptr Variant {.
|
||||||
importc: "godot_dictionary_operator_index",
|
importc: "godot_dictionary_operator_index",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc `==`*(self, other: Dictionary): bool {.
|
proc `==`*(self, other: Dictionary): bool {.
|
||||||
importc: "godot_dictionary_operator_equal",
|
importc: "godot_dictionary_operator_equal",
|
||||||
header: "godot_dictionary.h".}
|
header: "godot/dictionary.h".}
|
||||||
|
|
||||||
proc toJson*(self: Dictionary): GodotString {.
|
proc toJson*(self: Dictionary): GodotString {.
|
||||||
importc: "godot_dictionary_to_json", header: "godot_dictionary.h".}
|
importc: "godot_dictionary_to_json", header: "godot/dictionary.h".}
|
||||||
|
|
||||||
iterator keys*(dict: Dictionary): Variant =
|
iterator keys*(dict: Dictionary): Variant =
|
||||||
let keyArr = dict.keys()
|
let keyArr = dict.keys()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2017 Xored Software, Inc.
|
# Copyright (c) 2017 Xored Software, Inc.
|
||||||
|
|
||||||
type
|
type
|
||||||
Error* {.importc: "godot_error", header: "../godot.h",
|
Error* {.importc: "godot_error", header: "godot/gdnative.h",
|
||||||
size: sizeof(cint), pure.} = enum
|
size: sizeof(cint), pure.} = enum
|
||||||
OK,
|
OK,
|
||||||
Failed, ## Generic fail error
|
Failed, ## Generic fail error
|
||||||
|
|
@ -59,17 +59,17 @@ type
|
||||||
const MAX_ARG_COUNT* = 128
|
const MAX_ARG_COUNT* = 128
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotObject* {.importc: "godot_object", header: "../godot.h".} = object
|
GodotObject* {.importc: "godot_object", header: "godot/gdnative.h".} = object
|
||||||
Array* {.importc: "godot_array", header: "godot_array.h", byref.} = object
|
Array* {.importc: "godot_array", header: "godot/array.h", byref.} = object
|
||||||
Variant* {.importc: "godot_variant",
|
Variant* {.importc: "godot_variant",
|
||||||
header: "godot_variant.h", byref.} = object
|
header: "godot/variant.h", byref.} = object
|
||||||
|
|
||||||
proc initArray(dest: var Array, src: Array) {.
|
proc initArray(dest: var Array, src: Array) {.
|
||||||
importc: "godot_array_new_copy",
|
importc: "godot_array_new_copy",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
|
|
||||||
proc deinit(self: var Array) {.importc: "godot_array_destroy",
|
proc deinit(self: var Array) {.importc: "godot_array_destroy",
|
||||||
header: "godot_array.h".}
|
header: "godot/array.h".}
|
||||||
|
|
||||||
proc `=`(self: var Array, other: Array) {.inline.} =
|
proc `=`(self: var Array, other: Array) {.inline.} =
|
||||||
initArray(self, other)
|
initArray(self, other)
|
||||||
|
|
@ -78,10 +78,10 @@ proc `=destroy`(self: Array) {.inline.} =
|
||||||
unsafeAddr(self).deinit()
|
unsafeAddr(self).deinit()
|
||||||
|
|
||||||
proc initVariant(dest: var Variant; src: Variant) {.
|
proc initVariant(dest: var Variant; src: Variant) {.
|
||||||
importc: "godot_variant_new_copy", header: "godot_variant.h".}
|
importc: "godot_variant_new_copy", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc deinit*(self: var Variant) {.
|
proc deinit*(self: var Variant) {.
|
||||||
importc: "godot_variant_destroy", header: "godot_variant.h".}
|
importc: "godot_variant_destroy", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc `=`(self: var Variant, other: Variant) {.inline.} =
|
proc `=`(self: var Variant, other: Variant) {.inline.} =
|
||||||
initVariant(self, other)
|
initVariant(self, other)
|
||||||
|
|
@ -92,16 +92,16 @@ proc `=destroy`(self: Variant) {.inline.} =
|
||||||
# System Functions
|
# System Functions
|
||||||
|
|
||||||
proc godotAlloc*(bytes: cint): pointer {.
|
proc godotAlloc*(bytes: cint): pointer {.
|
||||||
importc: "godot_alloc", header: "../godot.h".}
|
importc: "godot_alloc", header: "godot/gdnative.h".}
|
||||||
## Allocates the specified number of bytes.
|
## Allocates the specified number of bytes.
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
## is in use in debug mode.
|
## is in use in debug mode.
|
||||||
proc godotRealloc*(p: pointer; bytes: cint): pointer {.
|
proc godotRealloc*(p: pointer; bytes: cint): pointer {.
|
||||||
importc: "godot_realloc", header: "../godot.h".}
|
importc: "godot_realloc", header: "godot/gdnative.h".}
|
||||||
## Reallocates the pointer for the specified number of bytes.
|
## Reallocates the pointer for the specified number of bytes.
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
## is in use in debug mode.
|
## is in use in debug mode.
|
||||||
proc godotFree*(p: pointer) {.importc: "godot_free", header: "../godot.h".}
|
proc godotFree*(p: pointer) {.importc: "godot_free", header: "godot/gdnative.h".}
|
||||||
## Frees the memory pointed to by the pointer.
|
## Frees the memory pointed to by the pointer.
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
## is in use in debug mode.
|
## is in use in debug mode.
|
||||||
|
|
|
||||||
|
|
@ -13,36 +13,37 @@ export godotbase, strings, vector2, rect2, vector3, transform2d, plane, quat,
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotMethodBind* {.importc: "godot_method_bind",
|
GodotMethodBind* {.importc: "godot_method_bind",
|
||||||
header: "../godot.h".} = object
|
header: "godot/gdnative.h".} = object
|
||||||
|
|
||||||
proc getMethod*(className: cstring; methodName: cstring): ptr GodotMethodBind {.
|
proc getMethod*(className: cstring; methodName: cstring): ptr GodotMethodBind {.
|
||||||
importc: "godot_method_bind_get_method", header: "../godot.h".}
|
importc: "godot_method_bind_get_method", header: "godot/gdnative.h".}
|
||||||
proc ptrCall*(methodBind: ptr GodotMethodBind;
|
proc ptrCall*(methodBind: ptr GodotMethodBind;
|
||||||
instance: ptr GodotObject;
|
instance: ptr GodotObject;
|
||||||
args: ptr array[MAX_ARG_COUNT, pointer];
|
args: ptr array[MAX_ARG_COUNT, pointer];
|
||||||
ret: pointer) {.
|
ret: pointer) {.
|
||||||
importc: "godot_method_bind_ptrcall", header: "../godot.h".}
|
importc: "godot_method_bind_ptrcall", header: "godot/gdnative.h".}
|
||||||
proc call*(methodBind: ptr GodotMethodBind;
|
proc call*(methodBind: ptr GodotMethodBind;
|
||||||
instance: ptr GodotObject;
|
instance: ptr GodotObject;
|
||||||
args: ptr array[MAX_ARG_COUNT, Variant]; argCount: cint;
|
args: ptr array[MAX_ARG_COUNT, Variant]; argCount: cint;
|
||||||
callError: var VariantCallError): Variant {.
|
callError: var VariantCallError): Variant {.
|
||||||
importc: "godot_method_bind_call", header: "../godot.h".}
|
importc: "godot_method_bind_call", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
# Script API
|
# Script API
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotNativeInitOptions* {.importc: "godot_native_init_options",
|
GodotNativeInitOptions* {.importc: "godot_gdnative_init_options",
|
||||||
header: "../godot.h".} = object
|
header: "godot/gdnative.h".} = object
|
||||||
inEditor* {.importc: "in_editor".}: bool
|
inEditor* {.importc: "in_editor".}: bool
|
||||||
coreApiHash* {.importc: "core_api_hash".}: uint64
|
coreApiHash* {.importc: "core_api_hash".}: uint64
|
||||||
editorApiHash* {.importc: "editor_api_hash".}: uint64
|
editorApiHash* {.importc: "editor_api_hash".}: uint64
|
||||||
noApiHash* {.importc: "no_api_hash".}: uint64
|
noApiHash* {.importc: "no_api_hash".}: uint64
|
||||||
|
|
||||||
GodotNativeTerminateOptions* {.importc: "godot_native_terminate_options",
|
GodotNativeTerminateOptions* {.importc: "godot_gdnative_terminate_options",
|
||||||
header: "../godot.h".} = object
|
header: "godot/gdnative.h".} = object
|
||||||
inEditor* {.importc: "in_editor".}: bool
|
inEditor* {.importc: "in_editor".}: bool
|
||||||
|
|
||||||
GodotMethodRPCMode* {.importc: "godot_method_rpc_mode", header: "../godot.h",
|
GodotMethodRPCMode* {.importc: "godot_method_rpc_mode",
|
||||||
|
header: "godot_nativescript.h",
|
||||||
size: sizeof(cint), pure.} = enum
|
size: sizeof(cint), pure.} = enum
|
||||||
Disabled,
|
Disabled,
|
||||||
Remote,
|
Remote,
|
||||||
|
|
@ -51,10 +52,11 @@ type
|
||||||
Slave
|
Slave
|
||||||
|
|
||||||
GodotMethodAttributes* {.importc: "godot_method_attributes",
|
GodotMethodAttributes* {.importc: "godot_method_attributes",
|
||||||
header: "../godot.h".} = object
|
header: "godot_nativescript.h".} = object
|
||||||
rpcMode* {.importc: "rpc_type".}: GodotMethodRPCMode
|
rpcMode* {.importc: "rpc_type".}: GodotMethodRPCMode
|
||||||
|
|
||||||
GodotPropertyHint* {.importc: "godot_property_hint", header: "../godot.h",
|
GodotPropertyHint* {.importc: "godot_property_hint",
|
||||||
|
header: "godot_nativescript.h",
|
||||||
size: sizeof(cint), pure.} = enum
|
size: sizeof(cint), pure.} = enum
|
||||||
None, ## no hint provided.
|
None, ## no hint provided.
|
||||||
Range, ## hint_text = "min,max,step,slider; // slider is optional"
|
Range, ## hint_text = "min,max,step,slider; // slider is optional"
|
||||||
|
|
@ -125,7 +127,7 @@ const
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotPropertyUsageFlags* {.importc: "godot_property_usage_flags",
|
GodotPropertyUsageFlags* {.importc: "godot_property_usage_flags",
|
||||||
header: "../godot.h", size: sizeof(cint),
|
header: "godot_nativescript.h", size: sizeof(cint),
|
||||||
pure.} = enum
|
pure.} = enum
|
||||||
Storage = GODOT_PROPERTY_USAGE_STORAGE_VALUE
|
Storage = GODOT_PROPERTY_USAGE_STORAGE_VALUE
|
||||||
Editor = GODOT_PROPERTY_USAGE_EDITOR_VALUE
|
Editor = GODOT_PROPERTY_USAGE_EDITOR_VALUE
|
||||||
|
|
@ -155,7 +157,7 @@ type
|
||||||
UpdateAllIfModified = GODOT_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED_VALUE
|
UpdateAllIfModified = GODOT_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED_VALUE
|
||||||
|
|
||||||
GodotPropertyAttributes* {.importc: "godot_property_attributes",
|
GodotPropertyAttributes* {.importc: "godot_property_attributes",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
rsetType* {.importc: "rset_type".}: GodotMethodRPCMode
|
rsetType* {.importc: "rset_type".}: GodotMethodRPCMode
|
||||||
typ* {.importc: "type".}: cint
|
typ* {.importc: "type".}: cint
|
||||||
hint* {.importc: "hint".}: GodotPropertyHint
|
hint* {.importc: "hint".}: GodotPropertyHint
|
||||||
|
|
@ -164,7 +166,7 @@ type
|
||||||
defaultValue* {.importc: "default_value".}: Variant
|
defaultValue* {.importc: "default_value".}: Variant
|
||||||
|
|
||||||
GodotInstanceCreateFunc* {.importc: "godot_instance_create_func",
|
GodotInstanceCreateFunc* {.importc: "godot_instance_create_func",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
createFunc* {.importc: "create_func".}:
|
createFunc* {.importc: "create_func".}:
|
||||||
proc (obj: ptr GodotObject; methodData: pointer): pointer {.noconv.}
|
proc (obj: ptr GodotObject; methodData: pointer): pointer {.noconv.}
|
||||||
## returns user data
|
## returns user data
|
||||||
|
|
@ -172,24 +174,26 @@ type
|
||||||
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
||||||
|
|
||||||
GodotInstanceDestroyFunc* {.importc: "godot_instance_destroy_func",
|
GodotInstanceDestroyFunc* {.importc: "godot_instance_destroy_func",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
destroyFunc* {.importc: "destroy_func".}:
|
destroyFunc* {.importc: "destroy_func".}:
|
||||||
proc (obj: ptr GodotObject; methodData: pointer;
|
proc (obj: ptr GodotObject; methodData: pointer;
|
||||||
userData: pointer) {.noconv.}
|
userData: pointer) {.noconv.}
|
||||||
methodData* {.importc: "method_data".}: pointer
|
methodData* {.importc: "method_data".}: pointer
|
||||||
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
||||||
|
|
||||||
proc godotScriptRegisterClass*(name, base: cstring;
|
proc godotScriptRegisterClass*(libHandle: pointer; name, base: cstring;
|
||||||
create_func: GodotInstanceCreateFunc;
|
create_func: GodotInstanceCreateFunc;
|
||||||
destroy_func: GodotInstanceDestroyFunc) {.
|
destroy_func: GodotInstanceDestroyFunc) {.
|
||||||
importc: "godot_script_register_class", header: "../godot.h".}
|
importc: "godot_nativescript_register_class",
|
||||||
proc godotScriptRegisterToolClass*(name, base: cstring;
|
header: "godot_nativescript.h".}
|
||||||
|
proc godotScriptRegisterToolClass*(libHandle: pointer; name, base: cstring;
|
||||||
createFunc: GodotInstanceCreateFunc;
|
createFunc: GodotInstanceCreateFunc;
|
||||||
destroyFunc: GodotInstanceDestroyFunc) {.
|
destroyFunc: GodotInstanceDestroyFunc) {.
|
||||||
importc: "godot_script_register_tool_class", header: "../godot.h".}
|
importc: "godot_nativescript_register_tool_class",
|
||||||
|
header: "godot_nativescript.h".}
|
||||||
type
|
type
|
||||||
GodotInstanceMethod* {.importc: "godot_instance_method",
|
GodotInstanceMethod* {.importc: "godot_instance_method",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
meth* {.importc: "method".}:
|
meth* {.importc: "method".}:
|
||||||
proc (obj: ptr GodotObject; methodData: pointer;
|
proc (obj: ptr GodotObject; methodData: pointer;
|
||||||
userData: pointer; numArgs: cint;
|
userData: pointer; numArgs: cint;
|
||||||
|
|
@ -197,13 +201,15 @@ type
|
||||||
methodData* {.importc: "method_data".}: pointer
|
methodData* {.importc: "method_data".}: pointer
|
||||||
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
||||||
|
|
||||||
proc godotScriptRegisterMethod*(name: cstring; function_name: cstring;
|
proc godotScriptRegisterMethod*(libHandle: pointer;
|
||||||
|
name: cstring; function_name: cstring;
|
||||||
attr: GodotMethodAttributes;
|
attr: GodotMethodAttributes;
|
||||||
meth: GodotInstanceMethod) {.
|
meth: GodotInstanceMethod) {.
|
||||||
importc: "godot_script_register_method", header: "../godot.h".}
|
importc: "godot_nativescript_register_method",
|
||||||
|
header: "godot_nativescript.h".}
|
||||||
type
|
type
|
||||||
GodotPropertySetFunc* {.importc: "godot_property_set_func",
|
GodotPropertySetFunc* {.importc: "godot_property_set_func",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
setFunc* {.importc: "set_func".}: proc (obj: ptr GodotObject;
|
setFunc* {.importc: "set_func".}: proc (obj: ptr GodotObject;
|
||||||
methodData: pointer;
|
methodData: pointer;
|
||||||
userData: pointer;
|
userData: pointer;
|
||||||
|
|
@ -212,22 +218,24 @@ type
|
||||||
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
||||||
|
|
||||||
GodotPropertyGetFunc* {.importc: "godot_property_get_func",
|
GodotPropertyGetFunc* {.importc: "godot_property_get_func",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
getFunc* {.importc: "get_func".}:
|
getFunc* {.importc: "get_func".}:
|
||||||
proc (obj: ptr GodotObject; methodData: pointer;
|
proc (obj: ptr GodotObject; methodData: pointer;
|
||||||
userData: pointer): Variant {.noconv.}
|
userData: pointer): Variant {.noconv.}
|
||||||
methodData* {.importc: "method_data".}: pointer
|
methodData* {.importc: "method_data".}: pointer
|
||||||
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
freeFunc* {.importc: "free_func".}: proc (a2: pointer) {.noconv.}
|
||||||
|
|
||||||
proc godotScriptRegisterProperty*(name: cstring; path: cstring;
|
proc godotScriptRegisterProperty*(libHandle: pointer;
|
||||||
|
name: cstring; path: cstring;
|
||||||
attr: var GodotPropertyAttributes;
|
attr: var GodotPropertyAttributes;
|
||||||
setFunc: GodotPropertySetFunc;
|
setFunc: GodotPropertySetFunc;
|
||||||
getFunc: GodotPropertyGetFunc) {.
|
getFunc: GodotPropertyGetFunc) {.
|
||||||
importc: "godot_script_register_property", header: "../godot.h".}
|
importc: "godot_nativescript_register_property",
|
||||||
|
header: "godot_nativescript.h".}
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotSignalArgument* {.importc: "godot_signal_argument",
|
GodotSignalArgument* {.importc: "godot_signal_argument",
|
||||||
header: "../godot.h", bycopy.} = object
|
header: "godot_nativescript.h", bycopy.} = object
|
||||||
name* {.importc: "name".}: GodotString
|
name* {.importc: "name".}: GodotString
|
||||||
typ* {.importc: "type".}: cint
|
typ* {.importc: "type".}: cint
|
||||||
hint* {.importc: "hint".}: GodotPropertyHint
|
hint* {.importc: "hint".}: GodotPropertyHint
|
||||||
|
|
@ -235,45 +243,43 @@ type
|
||||||
usage* {.importc: "usage".}: GodotPropertyUsageFlags
|
usage* {.importc: "usage".}: GodotPropertyUsageFlags
|
||||||
defaultValue* {.importc: "default_value".}: Variant
|
defaultValue* {.importc: "default_value".}: Variant
|
||||||
|
|
||||||
GodotSignal* {.importc: "godot_signal", header: "../godot.h".} = object
|
GodotSignal* {.importc: "godot_signal",
|
||||||
|
header: "godot_nativescript.h".} = object
|
||||||
name* {.importc: "name".}: GodotString
|
name* {.importc: "name".}: GodotString
|
||||||
numArgs* {.importc: "num_args".}: cint
|
numArgs* {.importc: "num_args".}: cint
|
||||||
args* {.importc: "args".}: ptr GodotSignalArgument
|
args* {.importc: "args".}: ptr GodotSignalArgument
|
||||||
numDefaultArgs* {.importc: "num_default_args".}: cint
|
numDefaultArgs* {.importc: "num_default_args".}: cint
|
||||||
defaultArgs* {.importc: "default_args".}: ptr Variant
|
defaultArgs* {.importc: "default_args".}: ptr Variant
|
||||||
|
|
||||||
proc godotScriptRegisterSignal*(name: cstring; signal: GodotSignal) {.
|
proc godotScriptRegisterSignal*(libHandle: pointer; name: cstring;
|
||||||
importc: "godot_script_register_signal", header: "../godot.h".}
|
signal: GodotSignal) {.
|
||||||
|
importc: "godot_nativescript_register_signal",
|
||||||
|
header: "godot_nativescript.h".}
|
||||||
|
|
||||||
proc getUserdata*(instance: ptr GodotObject): pointer {.
|
proc getUserdata*(instance: ptr GodotObject): pointer {.
|
||||||
importc: "godot_native_get_userdata", header: "../godot.h".}
|
importc: "godot_nativescript_get_userdata", header: "godot_nativescript.h".}
|
||||||
|
|
||||||
type
|
|
||||||
GodotClassConstructor* = proc (): ptr GodotObject {.gcsafe, noconv.}
|
|
||||||
|
|
||||||
proc getClassConstructor*(className: cstring): GodotClassConstructor {.
|
|
||||||
importc: "godot_get_class_constructor", header: "../godot.h".}
|
|
||||||
proc getGlobalConstants*(): Dictionary {.
|
|
||||||
importc: "godot_get_global_constants", header: "../godot.h".}
|
|
||||||
proc godotNew*(p_classname: cstring): ptr GodotObject {.
|
proc godotNew*(p_classname: cstring): ptr GodotObject {.
|
||||||
importc: "godot_new", header: "../godot.h".}
|
importc: "godot_nativescript_new", header: "godot_nativescript.h".}
|
||||||
|
|
||||||
proc godotStackBottom*(): pointer {.
|
proc godotStackBottom*(): pointer {.
|
||||||
importc: "godot_get_stack_bottom", header: "../godot.h".}
|
importc: "godot_get_stack_bottom", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
proc deinit*(o: ptr GodotObject) {.
|
proc deinit*(o: ptr GodotObject) {.
|
||||||
importc: "godot_object_destroy", header: "../godot.h".}
|
importc: "godot_object_destroy", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
# print using Godot's error handler list
|
# print using Godot's error handler list
|
||||||
|
|
||||||
proc godotPrintError(description: cstring; function: cstring; file: cstring;
|
proc godotPrintError(description: cstring; function: cstring; file: cstring;
|
||||||
line: cint) {.
|
line: cint) {.
|
||||||
importc: "godot_print_error", header: "../godot.h".}
|
importc: "godot_print_error", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
proc godotPrintWarning(description: cstring; function: cstring;
|
proc godotPrintWarning(description: cstring; function: cstring;
|
||||||
file: cstring; line: cint) {.
|
file: cstring; line: cint) {.
|
||||||
importc: "godot_print_warning", header: "../godot.h".}
|
importc: "godot_print_warning", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
proc godotPrint(message: GodotString) {.
|
proc godotPrint(message: GodotString) {.
|
||||||
importc: "godot_print", header: "../godot.h".}
|
importc: "godot_print", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
proc print*(message: string) {.inline.} =
|
proc print*(message: string) {.inline.} =
|
||||||
let s = message.toGodotString()
|
let s = message.toGodotString()
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,15 @@ import godotbase, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
NodePath* {.importc: "godot_node_path",
|
NodePath* {.importc: "godot_node_path",
|
||||||
header: "godot_node_path.h", byref.} = object
|
header: "godot/node_path.h", byref.} = object
|
||||||
|
|
||||||
proc initNodePath(dest: var NodePath; s: GodotString) {.
|
proc initNodePath(dest: var NodePath; s: GodotString) {.
|
||||||
importc: "godot_node_path_new", header: "godot_node_path.h".}
|
importc: "godot_node_path_new", header: "godot/node_path.h".}
|
||||||
proc initNodePath(dest: var NodePath;
|
proc initNodePath(dest: var NodePath;
|
||||||
src: NodePath) {.
|
src: NodePath) {.
|
||||||
importc: "godot_node_path_new_copy", header: "godot_node_path.h".}
|
importc: "godot_node_path_new_copy", header: "godot/node_path.h".}
|
||||||
proc deinit(self: var NodePath) {.
|
proc deinit(self: var NodePath) {.
|
||||||
importc: "godot_node_path_destroy", header: "godot_node_path.h".}
|
importc: "godot_node_path_destroy", header: "godot/node_path.h".}
|
||||||
|
|
||||||
proc initNodePath*(s: string): NodePath {.inline.} =
|
proc initNodePath*(s: string): NodePath {.inline.} =
|
||||||
initNodePath(result, s.toGodotString())
|
initNodePath(result, s.toGodotString())
|
||||||
|
|
@ -24,32 +24,32 @@ proc `=`(self: var NodePath, other: NodePath) {.inline.} =
|
||||||
initNodePath(self, other)
|
initNodePath(self, other)
|
||||||
|
|
||||||
proc toGodotString*(self: NodePath): GodotString {.
|
proc toGodotString*(self: NodePath): GodotString {.
|
||||||
importc: "godot_node_path_as_string", header: "godot_node_path.h".}
|
importc: "godot_node_path_as_string", header: "godot/node_path.h".}
|
||||||
proc `$`*(self: NodePath): string {.inline.} =
|
proc `$`*(self: NodePath): string {.inline.} =
|
||||||
let s = self.toGodotString()
|
let s = self.toGodotString()
|
||||||
result = $s
|
result = $s
|
||||||
|
|
||||||
proc isAbsolute*(self: NodePath): bool {.
|
proc isAbsolute*(self: NodePath): bool {.
|
||||||
importc: "godot_node_path_is_absolute", header: "godot_node_path.h".}
|
importc: "godot_node_path_is_absolute", header: "godot/node_path.h".}
|
||||||
proc nameCount*(self: NodePath): cint {.
|
proc nameCount*(self: NodePath): cint {.
|
||||||
importc: "godot_node_path_get_name_count",
|
importc: "godot_node_path_get_name_count",
|
||||||
header: "godot_node_path.h".}
|
header: "godot/node_path.h".}
|
||||||
proc getName*(self: NodePath; idx: cint): GodotString {.
|
proc getName*(self: NodePath; idx: cint): GodotString {.
|
||||||
importc: "godot_node_path_get_name", header: "godot_node_path.h".}
|
importc: "godot_node_path_get_name", header: "godot/node_path.h".}
|
||||||
proc subnameCount*(self: NodePath): cint {.
|
proc subnameCount*(self: NodePath): cint {.
|
||||||
importc: "godot_node_path_get_subname_count",
|
importc: "godot_node_path_get_subname_count",
|
||||||
header: "godot_node_path.h".}
|
header: "godot/node_path.h".}
|
||||||
proc getSubname*(self: NodePath; idx: cint): GodotString {.
|
proc getSubname*(self: NodePath; idx: cint): GodotString {.
|
||||||
importc: "godot_node_path_get_subname",
|
importc: "godot_node_path_get_subname",
|
||||||
header: "godot_node_path.h".}
|
header: "godot/node_path.h".}
|
||||||
proc property*(self: NodePath): GodotString {.
|
proc property*(self: NodePath): GodotString {.
|
||||||
importc: "godot_node_path_get_property", header: "godot_node_path.h".}
|
importc: "godot_node_path_get_property", header: "godot/node_path.h".}
|
||||||
proc isEmpty*(self: NodePath): bool {.
|
proc isEmpty*(self: NodePath): bool {.
|
||||||
importc: "godot_node_path_is_empty", header: "godot_node_path.h".}
|
importc: "godot_node_path_is_empty", header: "godot/node_path.h".}
|
||||||
|
|
||||||
proc `==`*(a, b: NodePath): bool {.
|
proc `==`*(a, b: NodePath): bool {.
|
||||||
importc: "godot_node_path_operator_equal",
|
importc: "godot_node_path_operator_equal",
|
||||||
header: "godot_node_path.h".}
|
header: "godot/node_path.h".}
|
||||||
|
|
||||||
converter fromString*(s: string): NodePath =
|
converter fromString*(s: string): NodePath =
|
||||||
initNodePath(result, s.toGodotString())
|
initNodePath(result, s.toGodotString())
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@
|
||||||
import godotbase, vector3, strings
|
import godotbase, vector3, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Plane* {.importc: "godot_plane", header: "godot_plane.h", byref.} = object
|
Plane* {.importc: "godot_plane", header: "godot/plane.h", byref.} = object
|
||||||
|
|
||||||
proc initPlane(dest: var Plane; a, b, c, d: float32) {.
|
proc initPlane(dest: var Plane; a, b, c, d: float32) {.
|
||||||
importc: "godot_plane_new_with_reals", header: "godot_plane.h".}
|
importc: "godot_plane_new_with_reals", header: "godot/plane.h".}
|
||||||
proc initPlane(dest: var Plane; v1, v2, v3: Vector3) {.
|
proc initPlane(dest: var Plane; v1, v2, v3: Vector3) {.
|
||||||
importc: "godot_plane_new_with_vectors",
|
importc: "godot_plane_new_with_vectors",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
proc initPlane(dest: var Plane; normal: Vector3; d: float32) {.
|
proc initPlane(dest: var Plane; normal: Vector3; d: float32) {.
|
||||||
importc: "godot_plane_new_with_normal",
|
importc: "godot_plane_new_with_normal",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
|
|
||||||
proc initPlane*(a, b, c, d: float32): Plane =
|
proc initPlane*(a, b, c, d: float32): Plane =
|
||||||
initPlane(result, a, b, c, d)
|
initPlane(result, a, b, c, d)
|
||||||
|
|
@ -25,60 +25,60 @@ proc initPlane*(normal: Vector3; d: float32): Plane =
|
||||||
|
|
||||||
proc toGodotString*(self: Plane): GodotString {.
|
proc toGodotString*(self: Plane): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_as_string", header: "godot_plane.h".}
|
importc: "godot_plane_as_string", header: "godot/plane.h".}
|
||||||
proc `$`*(self: Plane): string {.inline.} =
|
proc `$`*(self: Plane): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc normalized*(self: Plane): Plane {.
|
proc normalized*(self: Plane): Plane {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_normalized", header: "godot_plane.h".}
|
importc: "godot_plane_normalized", header: "godot/plane.h".}
|
||||||
proc center*(self: Plane): Vector3 {.
|
proc center*(self: Plane): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_center", header: "godot_plane.h".}
|
importc: "godot_plane_center", header: "godot/plane.h".}
|
||||||
proc getAnyPoint*(self: Plane): Vector3 {.
|
proc getAnyPoint*(self: Plane): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_get_any_point", header: "godot_plane.h".}
|
importc: "godot_plane_get_any_point", header: "godot/plane.h".}
|
||||||
proc isPointOver*(self: Plane; point: Vector3): bool {.
|
proc isPointOver*(self: Plane; point: Vector3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_is_point_over",
|
importc: "godot_plane_is_point_over",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
proc distanceTo*(self: Plane; point: Vector3): float32 {.
|
proc distanceTo*(self: Plane; point: Vector3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_distance_to", header: "godot_plane.h".}
|
importc: "godot_plane_distance_to", header: "godot/plane.h".}
|
||||||
proc contains*(self: Plane; point: Vector3;
|
proc contains*(self: Plane; point: Vector3;
|
||||||
epsilon: float32): bool {.
|
epsilon: float32): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_has_point", header: "godot_plane.h".}
|
importc: "godot_plane_has_point", header: "godot/plane.h".}
|
||||||
proc project*(self: Plane; point: Vector3): Vector3 {.
|
proc project*(self: Plane; point: Vector3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_project", header: "godot_plane.h".}
|
importc: "godot_plane_project", header: "godot/plane.h".}
|
||||||
proc intersect3*(self: Plane; dest: var Vector3;
|
proc intersect3*(self: Plane; dest: var Vector3;
|
||||||
b, c: Plane): bool {.
|
b, c: Plane): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_intersect_3",
|
importc: "godot_plane_intersect_3",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
proc intersectsRay*(self: Plane; dest: var Vector3;
|
proc intersectsRay*(self: Plane; dest: var Vector3;
|
||||||
v, dir: Vector3): bool {.
|
v, dir: Vector3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_intersects_ray",
|
importc: "godot_plane_intersects_ray",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
proc intersectsSegment*(self: Plane; dest: var Vector3;
|
proc intersectsSegment*(self: Plane; dest: var Vector3;
|
||||||
segmentBegin, segmentEnd: Vector3): bool {.
|
segmentBegin, segmentEnd: Vector3): bool {.
|
||||||
noSideEffect, importc: "godot_plane_intersects_segment",
|
noSideEffect, importc: "godot_plane_intersects_segment",
|
||||||
header: "godot_plane.h".}
|
header: "godot/plane.h".}
|
||||||
proc `-`*(self: Plane): Plane {.
|
proc `-`*(self: Plane): Plane {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_operator_neg", header: "godot_plane.h".}
|
importc: "godot_plane_operator_neg", header: "godot/plane.h".}
|
||||||
proc `==`*(a, b: Plane): bool {.
|
proc `==`*(a, b: Plane): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_operator_equal", header: "godot_plane.h".}
|
importc: "godot_plane_operator_equal", header: "godot/plane.h".}
|
||||||
proc normal*(self: Plane): Vector3 {.
|
proc normal*(self: Plane): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_get_normal", header: "godot_plane.h".}
|
importc: "godot_plane_get_normal", header: "godot/plane.h".}
|
||||||
proc `normal=`*(self: var Plane; normal: Vector3) {.
|
proc `normal=`*(self: var Plane; normal: Vector3) {.
|
||||||
importc: "godot_plane_set_normal", header: "godot_plane.h".}
|
importc: "godot_plane_set_normal", header: "godot/plane.h".}
|
||||||
proc d*(self: Plane): float32 {.
|
proc d*(self: Plane): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_plane_get_d", header: "godot_plane.h".}
|
importc: "godot_plane_get_d", header: "godot/plane.h".}
|
||||||
proc `d=`*(self: var Plane; d: float32) {.
|
proc `d=`*(self: var Plane; d: float32) {.
|
||||||
importc: "godot_plane_set_d", header: "godot_plane.h".}
|
importc: "godot_plane_set_d", header: "godot/plane.h".}
|
||||||
|
|
@ -4,34 +4,34 @@ import godotbase, color, vector2, vector3, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
PoolByteArray* {.importc: "godot_pool_byte_array",
|
PoolByteArray* {.importc: "godot_pool_byte_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolIntArray* {.importc: "godot_pool_int_array",
|
PoolIntArray* {.importc: "godot_pool_int_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolRealArray* {.importc: "godot_pool_real_array",
|
PoolRealArray* {.importc: "godot_pool_real_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolStringArray* {.importc: "godot_pool_string_array",
|
PoolStringArray* {.importc: "godot_pool_string_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolVector2Array* {.importc: "godot_pool_vector2_array",
|
PoolVector2Array* {.importc: "godot_pool_vector2_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolVector3Array* {.importc: "godot_pool_vector3_array",
|
PoolVector3Array* {.importc: "godot_pool_vector3_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
PoolColorArray* {.importc: "godot_pool_color_array",
|
PoolColorArray* {.importc: "godot_pool_color_array",
|
||||||
header: "godot_pool_arrays.h", byref.} = object
|
header: "godot/pool_arrays.h", byref.} = object
|
||||||
|
|
||||||
# byte
|
# byte
|
||||||
|
|
||||||
proc initPoolByteArray(dest: var PoolByteArray) {.
|
proc initPoolByteArray(dest: var PoolByteArray) {.
|
||||||
importc: "godot_pool_byte_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolByteArray(dest: var PoolByteArray;
|
proc initPoolByteArray(dest: var PoolByteArray;
|
||||||
src: PoolByteArray) {.
|
src: PoolByteArray) {.
|
||||||
importc: "godot_pool_byte_array_new_copy",
|
importc: "godot_pool_byte_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolByteArray(dest: var PoolByteArray; arr: Array) {.
|
proc initPoolByteArray(dest: var PoolByteArray; arr: Array) {.
|
||||||
importc: "godot_pool_byte_array_new_with_array",
|
importc: "godot_pool_byte_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolByteArray) {.
|
proc deinit(self: var PoolByteArray) {.
|
||||||
importc: "godot_pool_byte_array_destroy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_destroy", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolByteArray*(): PoolByteArray {.inline.} =
|
proc initPoolByteArray*(): PoolByteArray {.inline.} =
|
||||||
initPoolByteArray(result)
|
initPoolByteArray(result)
|
||||||
|
|
@ -47,33 +47,33 @@ proc `=destroy`(self: PoolByteArray) {.inline.} =
|
||||||
|
|
||||||
proc add*(self: var PoolByteArray;
|
proc add*(self: var PoolByteArray;
|
||||||
data: uint8) {.
|
data: uint8) {.
|
||||||
importc: "godot_pool_byte_array_append", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_append", header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolByteArray, data: uint8) {.
|
proc addFirst*(self: var PoolByteArray, data: uint8) {.
|
||||||
importc: "godot_pool_byte_array_push_back", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_push_back", header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolByteArray;
|
proc add*(self: var PoolByteArray;
|
||||||
arr: PoolByteArray) {.
|
arr: PoolByteArray) {.
|
||||||
importc: "godot_pool_byte_array_append_array",
|
importc: "godot_pool_byte_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolByteArray; idx: cint;
|
proc insert*(self: var PoolByteArray; idx: cint;
|
||||||
data: uint8): Error {.
|
data: uint8): Error {.
|
||||||
importc: "godot_pool_byte_array_insert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_insert", header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolByteArray; idx: cint) {.
|
proc delete*(self: var PoolByteArray; idx: cint) {.
|
||||||
importc: "godot_pool_byte_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_remove", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc reverse*(self: var PoolByteArray) {.
|
proc reverse*(self: var PoolByteArray) {.
|
||||||
importc: "godot_pool_byte_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_invert", header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolByteArray; size: cint) {.
|
proc setLen*(self: var PoolByteArray; size: cint) {.
|
||||||
importc: "godot_pool_byte_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_resize", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc `[]=`*(self: var PoolByteArray; idx: cint; data: uint8) {.
|
proc `[]=`*(self: var PoolByteArray; idx: cint; data: uint8) {.
|
||||||
importc: "godot_pool_byte_array_set", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_set", header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolByteArray; idx: cint): uint8 {.
|
proc `[]`*(self: PoolByteArray; idx: cint): uint8 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_byte_array_get",
|
importc: "godot_pool_byte_array_get",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolByteArray): cint {.
|
proc len*(self: PoolByteArray): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_byte_array_size", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_byte_array_size", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolByteArray): byte =
|
iterator items*(arr: PoolByteArray): byte =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -84,16 +84,16 @@ iterator pairs*(arr: PoolByteArray): tuple[key: cint, val: byte] =
|
||||||
yield (i, arr[i])
|
yield (i, arr[i])
|
||||||
|
|
||||||
proc initPoolIntArray(dest: var PoolIntArray) {.
|
proc initPoolIntArray(dest: var PoolIntArray) {.
|
||||||
importc: "godot_pool_int_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolIntArray(dest: var PoolIntArray;
|
proc initPoolIntArray(dest: var PoolIntArray;
|
||||||
src: PoolIntArray) {.
|
src: PoolIntArray) {.
|
||||||
importc: "godot_pool_int_array_new_copy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_new_copy", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolIntArray(dest: var PoolIntArray;
|
proc initPoolIntArray(dest: var PoolIntArray;
|
||||||
arr: Array) {.
|
arr: Array) {.
|
||||||
importc: "godot_pool_int_array_new_with_array",
|
importc: "godot_pool_int_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc deinit(self: var PoolIntArray) {.
|
proc deinit(self: var PoolIntArray) {.
|
||||||
importc: "godot_pool_int_array_destroy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_destroy", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolIntArray*(): PoolIntArray {.inline.} =
|
proc initPoolIntArray*(): PoolIntArray {.inline.} =
|
||||||
initPoolIntArray(result)
|
initPoolIntArray(result)
|
||||||
|
|
@ -108,32 +108,32 @@ proc `=destroy`(self: PoolIntArray) {.inline.} =
|
||||||
unsafeAddr(self).deinit()
|
unsafeAddr(self).deinit()
|
||||||
|
|
||||||
proc add*(self: var PoolIntArray; data: cint) {.
|
proc add*(self: var PoolIntArray; data: cint) {.
|
||||||
importc: "godot_pool_int_array_append", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_append", header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolIntArray; data: cint) {.
|
proc addFirst*(self: var PoolIntArray; data: cint) {.
|
||||||
importc: "godot_pool_int_array_push_back", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_push_back", header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolIntArray; arr: PoolIntArray) {.
|
proc add*(self: var PoolIntArray; arr: PoolIntArray) {.
|
||||||
importc: "godot_pool_int_array_append_array",
|
importc: "godot_pool_int_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolIntArray; idx: cint;
|
proc insert*(self: var PoolIntArray; idx: cint;
|
||||||
data: cint): Error {.
|
data: cint): Error {.
|
||||||
importc: "godot_pool_int_array_insert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_insert", header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolIntArray; idx: cint) {.
|
proc delete*(self: var PoolIntArray; idx: cint) {.
|
||||||
importc: "godot_pool_int_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolIntArray) {.
|
proc reverse*(self: var PoolIntArray) {.
|
||||||
importc: "godot_pool_int_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_invert", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc setLen*(self: var PoolIntArray; size: cint) {.
|
proc setLen*(self: var PoolIntArray; size: cint) {.
|
||||||
importc: "godot_pool_int_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolIntArray; idx: cint; data: cint) {.
|
proc `[]=`*(self: var PoolIntArray; idx: cint; data: cint) {.
|
||||||
importc: "godot_pool_int_array_set", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_int_array_set", header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolIntArray; idx: cint): cint {.
|
proc `[]`*(self: PoolIntArray; idx: cint): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_int_array_get",
|
importc: "godot_pool_int_array_get",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolIntArray): cint {.
|
proc len*(self: PoolIntArray): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_int_array_size",
|
importc: "godot_pool_int_array_size",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolIntArray): cint =
|
iterator items*(arr: PoolIntArray): cint =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -146,17 +146,17 @@ iterator pairs*(arr: PoolIntArray): tuple[key: cint, val: cint] =
|
||||||
# Real
|
# Real
|
||||||
|
|
||||||
proc initPoolRealArray(dest: var PoolRealArray) {.
|
proc initPoolRealArray(dest: var PoolRealArray) {.
|
||||||
importc: "godot_pool_real_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolRealArray(dest: var PoolRealArray;
|
proc initPoolRealArray(dest: var PoolRealArray;
|
||||||
src: PoolRealArray) {.
|
src: PoolRealArray) {.
|
||||||
importc: "godot_pool_real_array_new_copy",
|
importc: "godot_pool_real_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolRealArray(dest: var PoolRealArray; arr: Array) {.
|
proc initPoolRealArray(dest: var PoolRealArray; arr: Array) {.
|
||||||
importc: "godot_pool_real_array_new_with_array",
|
importc: "godot_pool_real_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolRealArray) {.
|
proc deinit(self: var PoolRealArray) {.
|
||||||
importc: "godot_pool_real_array_destroy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_destroy", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolRealArray*(): PoolRealArray {.inline.} =
|
proc initPoolRealArray*(): PoolRealArray {.inline.} =
|
||||||
initPoolRealArray(result)
|
initPoolRealArray(result)
|
||||||
|
|
@ -172,30 +172,30 @@ proc `=destroy`(self: PoolRealArray) {.inline.} =
|
||||||
|
|
||||||
proc add*(self: var PoolRealArray; data: float32) {.
|
proc add*(self: var PoolRealArray; data: float32) {.
|
||||||
importc: "godot_pool_real_array_append",
|
importc: "godot_pool_real_array_append",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolRealArray; data: float32) {.
|
proc addFirst*(self: var PoolRealArray; data: float32) {.
|
||||||
importc: "godot_pool_real_array_push_back", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_push_back", header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolRealArray; arr: PoolRealArray) {.
|
proc add*(self: var PoolRealArray; arr: PoolRealArray) {.
|
||||||
importc: "godot_pool_real_array_append_array",
|
importc: "godot_pool_real_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolRealArray;
|
proc insert*(self: var PoolRealArray;
|
||||||
idx: cint; data: float32): Error {.
|
idx: cint; data: float32): Error {.
|
||||||
importc: "godot_pool_real_array_insert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_insert", header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolRealArray; idx: cint) {.
|
proc delete*(self: var PoolRealArray; idx: cint) {.
|
||||||
importc: "godot_pool_real_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolRealArray) {.
|
proc reverse*(self: var PoolRealArray) {.
|
||||||
importc: "godot_pool_real_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_invert", header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolRealArray; size: cint) {.
|
proc setLen*(self: var PoolRealArray; size: cint) {.
|
||||||
importc: "godot_pool_real_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolRealArray; idx: cint; data: float32) {.
|
proc `[]=`*(self: var PoolRealArray; idx: cint; data: float32) {.
|
||||||
importc: "godot_pool_real_array_set", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_set", header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolRealArray; idx: cint): float32 {.
|
proc `[]`*(self: PoolRealArray; idx: cint): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_real_array_get",
|
importc: "godot_pool_real_array_get",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolRealArray): cint {.
|
proc len*(self: PoolRealArray): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_real_array_size", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_real_array_size", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolRealArray): float32 =
|
iterator items*(arr: PoolRealArray): float32 =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -208,18 +208,18 @@ iterator pairs*(arr: PoolRealArray): tuple[key: cint, val: float32] =
|
||||||
# String
|
# String
|
||||||
|
|
||||||
proc initPoolStringArray(dest: var PoolStringArray) {.
|
proc initPoolStringArray(dest: var PoolStringArray) {.
|
||||||
importc: "godot_pool_string_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_string_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolStringArray(dest: var PoolStringArray;
|
proc initPoolStringArray(dest: var PoolStringArray;
|
||||||
src: PoolStringArray) {.
|
src: PoolStringArray) {.
|
||||||
importc: "godot_pool_string_array_new_copy",
|
importc: "godot_pool_string_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolStringArray(dest: var PoolStringArray; arr: Array) {.
|
proc initPoolStringArray(dest: var PoolStringArray; arr: Array) {.
|
||||||
importc: "godot_pool_string_array_new_with_array",
|
importc: "godot_pool_string_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolStringArray) {.
|
proc deinit(self: var PoolStringArray) {.
|
||||||
importc: "godot_pool_string_array_destroy",
|
importc: "godot_pool_string_array_destroy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolStringArray*(): PoolStringArray {.inline.} =
|
proc initPoolStringArray*(): PoolStringArray {.inline.} =
|
||||||
initPoolStringArray(result)
|
initPoolStringArray(result)
|
||||||
|
|
@ -235,35 +235,35 @@ proc `=destroy`(self: PoolStringArray) {.inline.} =
|
||||||
|
|
||||||
proc add*(self: var PoolStringArray; data: GodotString) {.
|
proc add*(self: var PoolStringArray; data: GodotString) {.
|
||||||
importc: "godot_pool_string_array_append",
|
importc: "godot_pool_string_array_append",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolStringArray; data: GodotString) {.
|
proc addFirst*(self: var PoolStringArray; data: GodotString) {.
|
||||||
importc: "godot_pool_string_array_push_back",
|
importc: "godot_pool_string_array_push_back",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolStringArray; arr: PoolStringArray) {.
|
proc add*(self: var PoolStringArray; arr: PoolStringArray) {.
|
||||||
importc: "godot_pool_string_array_append_array",
|
importc: "godot_pool_string_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolStringArray;
|
proc insert*(self: var PoolStringArray;
|
||||||
idx: cint; data: GodotString): Error {.
|
idx: cint; data: GodotString): Error {.
|
||||||
importc: "godot_pool_string_array_insert",
|
importc: "godot_pool_string_array_insert",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolStringArray; idx: cint) {.
|
proc delete*(self: var PoolStringArray; idx: cint) {.
|
||||||
importc: "godot_pool_string_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_string_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolStringArray) {.
|
proc reverse*(self: var PoolStringArray) {.
|
||||||
importc: "godot_pool_string_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_string_array_invert", header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolStringArray; size: cint) {.
|
proc setLen*(self: var PoolStringArray; size: cint) {.
|
||||||
importc: "godot_pool_string_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_string_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolStringArray; idx: cint;
|
proc `[]=`*(self: var PoolStringArray; idx: cint;
|
||||||
data: GodotString) {.
|
data: GodotString) {.
|
||||||
importc: "godot_pool_string_array_set",
|
importc: "godot_pool_string_array_set",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolStringArray; idx: cint): GodotString {.
|
proc `[]`*(self: PoolStringArray; idx: cint): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_string_array_get",
|
importc: "godot_pool_string_array_get",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolStringArray): cint {.
|
proc len*(self: PoolStringArray): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_string_array_size",
|
importc: "godot_pool_string_array_size",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolStringArray): GodotString =
|
iterator items*(arr: PoolStringArray): GodotString =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -276,17 +276,17 @@ iterator pairs*(arr: PoolStringArray): tuple[key: cint, val: GodotString] =
|
||||||
# Vector2
|
# Vector2
|
||||||
|
|
||||||
proc initPoolVector2Array(dest: var PoolVector2Array) {.
|
proc initPoolVector2Array(dest: var PoolVector2Array) {.
|
||||||
importc: "godot_pool_vector2_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolVector2Array(dest: var PoolVector2Array;
|
proc initPoolVector2Array(dest: var PoolVector2Array;
|
||||||
src: PoolVector2Array) {.
|
src: PoolVector2Array) {.
|
||||||
importc: "godot_pool_vector2_array_new_copy",
|
importc: "godot_pool_vector2_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolVector2Array(dest: var PoolVector2Array; arr: Array) {.
|
proc initPoolVector2Array(dest: var PoolVector2Array; arr: Array) {.
|
||||||
importc: "godot_pool_vector2_array_new_with_array",
|
importc: "godot_pool_vector2_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolVector2Array) {.
|
proc deinit(self: var PoolVector2Array) {.
|
||||||
importc: "godot_pool_vector2_array_destroy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_destroy", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolVector2Array*(): PoolVector2Array {.inline.} =
|
proc initPoolVector2Array*(): PoolVector2Array {.inline.} =
|
||||||
initPoolVector2Array(result)
|
initPoolVector2Array(result)
|
||||||
|
|
@ -302,34 +302,34 @@ proc `=destroy`(self: PoolVector2Array) {.inline.} =
|
||||||
|
|
||||||
proc add*(self: var PoolVector2Array; data: Vector2) {.
|
proc add*(self: var PoolVector2Array; data: Vector2) {.
|
||||||
importc: "godot_pool_vector2_array_append",
|
importc: "godot_pool_vector2_array_append",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolVector2Array; data: Vector2) {.
|
proc addFirst*(self: var PoolVector2Array; data: Vector2) {.
|
||||||
importc: "godot_pool_vector2_array_push_back",
|
importc: "godot_pool_vector2_array_push_back",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolVector2Array;
|
proc add*(self: var PoolVector2Array;
|
||||||
arr: PoolVector2Array) {.
|
arr: PoolVector2Array) {.
|
||||||
importc: "godot_pool_vector2_array_append_array",
|
importc: "godot_pool_vector2_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolVector2Array;
|
proc insert*(self: var PoolVector2Array;
|
||||||
idx: cint; data: Vector2): Error {.
|
idx: cint; data: Vector2): Error {.
|
||||||
importc: "godot_pool_vector2_array_insert",
|
importc: "godot_pool_vector2_array_insert",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolVector2Array; idx: cint) {.
|
proc delete*(self: var PoolVector2Array; idx: cint) {.
|
||||||
importc: "godot_pool_vector2_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolVector2Array) {.
|
proc reverse*(self: var PoolVector2Array) {.
|
||||||
importc: "godot_pool_vector2_array_invert",
|
importc: "godot_pool_vector2_array_invert",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolVector2Array; size: cint) {.
|
proc setLen*(self: var PoolVector2Array; size: cint) {.
|
||||||
importc: "godot_pool_vector2_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolVector2Array; idx: cint;
|
proc `[]=`*(self: var PoolVector2Array; idx: cint;
|
||||||
data: ptr Vector2) {.
|
data: ptr Vector2) {.
|
||||||
importc: "godot_pool_vector2_array_set", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_set", header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolVector2Array; idx: cint): Vector2 {.
|
proc `[]`*(self: PoolVector2Array; idx: cint): Vector2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_vector2_array_get", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_get", header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolVector2Array): cint {.
|
proc len*(self: PoolVector2Array): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_vector2_array_size", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector2_array_size", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolVector2Array): Vector2 =
|
iterator items*(arr: PoolVector2Array): Vector2 =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -342,18 +342,18 @@ iterator pairs*(arr: PoolVector2Array): tuple[key: cint, val: Vector2] =
|
||||||
# Vector3
|
# Vector3
|
||||||
|
|
||||||
proc initPoolVector3Array*(dest: var PoolVector3Array) {.
|
proc initPoolVector3Array*(dest: var PoolVector3Array) {.
|
||||||
importc: "godot_pool_vector3_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector3_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolVector3Array*(dest: var PoolVector3Array;
|
proc initPoolVector3Array*(dest: var PoolVector3Array;
|
||||||
src: PoolVector3Array) {.
|
src: PoolVector3Array) {.
|
||||||
importc: "godot_pool_vector3_array_new_copy",
|
importc: "godot_pool_vector3_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolVector3Array*(dest: var PoolVector3Array; arr: Array) {.
|
proc initPoolVector3Array*(dest: var PoolVector3Array; arr: Array) {.
|
||||||
importc: "godot_pool_vector3_array_new_with_array",
|
importc: "godot_pool_vector3_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolVector3Array) {.
|
proc deinit(self: var PoolVector3Array) {.
|
||||||
importc: "godot_pool_vector3_array_destroy",
|
importc: "godot_pool_vector3_array_destroy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolVector3Array*(): PoolVector3Array {.inline.} =
|
proc initPoolVector3Array*(): PoolVector3Array {.inline.} =
|
||||||
initPoolVector3Array(result)
|
initPoolVector3Array(result)
|
||||||
|
|
@ -370,38 +370,38 @@ proc `=destroy`(self: PoolVector3Array) {.inline.} =
|
||||||
proc add*(self: var PoolVector3Array;
|
proc add*(self: var PoolVector3Array;
|
||||||
data: Vector3) {.
|
data: Vector3) {.
|
||||||
importc: "godot_pool_vector3_array_append",
|
importc: "godot_pool_vector3_array_append",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolVector3Array;
|
proc addFirst*(self: var PoolVector3Array;
|
||||||
data: Vector3) {.
|
data: Vector3) {.
|
||||||
importc: "godot_pool_vector3_array_push_back",
|
importc: "godot_pool_vector3_array_push_back",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolVector3Array;
|
proc add*(self: var PoolVector3Array;
|
||||||
arr: PoolVector3Array) {.
|
arr: PoolVector3Array) {.
|
||||||
importc: "godot_pool_vector3_array_append_array",
|
importc: "godot_pool_vector3_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolVector3Array;
|
proc insert*(self: var PoolVector3Array;
|
||||||
idx: cint; data: Vector3): Error {.
|
idx: cint; data: Vector3): Error {.
|
||||||
importc: "godot_pool_vector3_array_insert",
|
importc: "godot_pool_vector3_array_insert",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolVector3Array; idx: cint) {.
|
proc delete*(self: var PoolVector3Array; idx: cint) {.
|
||||||
importc: "godot_pool_vector3_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector3_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolVector3Array) {.
|
proc reverse*(self: var PoolVector3Array) {.
|
||||||
importc: "godot_pool_vector3_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector3_array_invert", header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolVector3Array; size: cint) {.
|
proc setLen*(self: var PoolVector3Array; size: cint) {.
|
||||||
importc: "godot_pool_vector3_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_vector3_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolVector3Array;
|
proc `[]=`*(self: var PoolVector3Array;
|
||||||
idx: cint; data: Vector3) {.
|
idx: cint; data: Vector3) {.
|
||||||
importc: "godot_pool_vector3_array_set",
|
importc: "godot_pool_vector3_array_set",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolVector3Array;
|
proc `[]`*(self: PoolVector3Array;
|
||||||
idx: cint): Vector3 {.
|
idx: cint): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_vector3_array_get",
|
importc: "godot_pool_vector3_array_get",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolVector3Array): cint {.
|
proc len*(self: PoolVector3Array): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_vector3_array_size",
|
importc: "godot_pool_vector3_array_size",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolVector3Array): Vector3 =
|
iterator items*(arr: PoolVector3Array): Vector3 =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
@ -414,17 +414,17 @@ iterator pairs*(arr: PoolVector3Array): tuple[key: cint, val: Vector3] =
|
||||||
# Color
|
# Color
|
||||||
|
|
||||||
proc initPoolColorArray(dest: var PoolColorArray) {.
|
proc initPoolColorArray(dest: var PoolColorArray) {.
|
||||||
importc: "godot_pool_color_array_new", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_new", header: "godot/pool_arrays.h".}
|
||||||
proc initPoolColorArray(dest: var PoolColorArray;
|
proc initPoolColorArray(dest: var PoolColorArray;
|
||||||
src: PoolColorArray) {.
|
src: PoolColorArray) {.
|
||||||
importc: "godot_pool_color_array_new_copy",
|
importc: "godot_pool_color_array_new_copy",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc initPoolColorArray(dest: var PoolColorArray; arr: Array) {.
|
proc initPoolColorArray(dest: var PoolColorArray; arr: Array) {.
|
||||||
importc: "godot_pool_color_array_new_with_array",
|
importc: "godot_pool_color_array_new_with_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc deinit(self: var PoolColorArray) {.
|
proc deinit(self: var PoolColorArray) {.
|
||||||
importc: "godot_pool_color_array_destroy", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_destroy", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
proc initPoolColorArray*(): PoolColorArray {.inline.} =
|
proc initPoolColorArray*(): PoolColorArray {.inline.} =
|
||||||
initPoolColorArray(result)
|
initPoolColorArray(result)
|
||||||
|
|
@ -440,32 +440,32 @@ proc `=destroy`(self: PoolColorArray) {.inline.} =
|
||||||
|
|
||||||
proc add*(self: var PoolColorArray; data: Color) {.
|
proc add*(self: var PoolColorArray; data: Color) {.
|
||||||
importc: "godot_pool_color_array_append",
|
importc: "godot_pool_color_array_append",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc addFirst*(self: var PoolColorArray; data: Color) {.
|
proc addFirst*(self: var PoolColorArray; data: Color) {.
|
||||||
importc: "godot_pool_color_array_push_back",
|
importc: "godot_pool_color_array_push_back",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc add*(self: var PoolColorArray; arr: PoolColorArray) {.
|
proc add*(self: var PoolColorArray; arr: PoolColorArray) {.
|
||||||
importc: "godot_pool_color_array_append_array",
|
importc: "godot_pool_color_array_append_array",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc insert*(self: var PoolColorArray;
|
proc insert*(self: var PoolColorArray;
|
||||||
idx: cint; data: Color): Error {.
|
idx: cint; data: Color): Error {.
|
||||||
importc: "godot_pool_color_array_insert",
|
importc: "godot_pool_color_array_insert",
|
||||||
header: "godot_pool_arrays.h".}
|
header: "godot/pool_arrays.h".}
|
||||||
proc delete*(self: var PoolColorArray; idx: cint) {.
|
proc delete*(self: var PoolColorArray; idx: cint) {.
|
||||||
importc: "godot_pool_color_array_remove", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_remove", header: "godot/pool_arrays.h".}
|
||||||
proc reverse*(self: var PoolColorArray) {.
|
proc reverse*(self: var PoolColorArray) {.
|
||||||
importc: "godot_pool_color_array_invert", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_invert", header: "godot/pool_arrays.h".}
|
||||||
proc setLen*(self: var PoolColorArray; size: cint) {.
|
proc setLen*(self: var PoolColorArray; size: cint) {.
|
||||||
importc: "godot_pool_color_array_resize", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_resize", header: "godot/pool_arrays.h".}
|
||||||
proc `[]=`*(self: var PoolColorArray; idx: cint;
|
proc `[]=`*(self: var PoolColorArray; idx: cint;
|
||||||
data: Color) {.
|
data: Color) {.
|
||||||
importc: "godot_pool_color_array_set", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_set", header: "godot/pool_arrays.h".}
|
||||||
proc `[]`*(self: PoolColorArray; idx: cint): Color {.
|
proc `[]`*(self: PoolColorArray; idx: cint): Color {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_color_array_get", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_get", header: "godot/pool_arrays.h".}
|
||||||
proc len*(self: PoolColorArray): cint {.
|
proc len*(self: PoolColorArray): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_pool_color_array_size", header: "godot_pool_arrays.h".}
|
importc: "godot_pool_color_array_size", header: "godot/pool_arrays.h".}
|
||||||
|
|
||||||
iterator items*(arr: PoolColorArray): Color =
|
iterator items*(arr: PoolColorArray): Color =
|
||||||
for i in 0..<arr.len:
|
for i in 0..<arr.len:
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
import godotbase, vector3, strings
|
import godotbase, vector3, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Quat* {.importc: "godot_quat", header: "godot_quat.h", byref.} = object
|
Quat* {.importc: "godot_quat", header: "godot/quat.h", byref.} = object
|
||||||
|
|
||||||
proc initQuat(dest: var Quat; x, y, z, w: float32) {.
|
proc initQuat(dest: var Quat; x, y, z, w: float32) {.
|
||||||
importc: "godot_quat_new", header: "godot_quat.h".}
|
importc: "godot_quat_new", header: "godot/quat.h".}
|
||||||
proc initQuat(dest: var Quat; axis: Vector3; angle: float32) {.
|
proc initQuat(dest: var Quat; axis: Vector3; angle: float32) {.
|
||||||
importc: "godot_quat_new_with_axis_angle",
|
importc: "godot_quat_new_with_axis_angle",
|
||||||
header: "godot_quat.h".}
|
header: "godot/quat.h".}
|
||||||
|
|
||||||
proc initQuat*(x, y, z, w: float32): Quat {.inline.} =
|
proc initQuat*(x, y, z, w: float32): Quat {.inline.} =
|
||||||
initQuat(result, x, y, z, w)
|
initQuat(result, x, y, z, w)
|
||||||
|
|
@ -19,96 +19,96 @@ proc initQuat*(axis: Vector3; angle: float32): Quat {.inline.} =
|
||||||
|
|
||||||
proc x*(self: Quat): float32 {.
|
proc x*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_get_x", header: "godot_quat.h".}
|
importc: "godot_quat_get_x", header: "godot/quat.h".}
|
||||||
proc `x=`*(self: var Quat; val: float32) {.
|
proc `x=`*(self: var Quat; val: float32) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_set_x", header: "godot_quat.h".}
|
importc: "godot_quat_set_x", header: "godot/quat.h".}
|
||||||
proc y*(self: Quat): float32 {.
|
proc y*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_get_y", header: "godot_quat.h".}
|
importc: "godot_quat_get_y", header: "godot/quat.h".}
|
||||||
proc `y=`*(self: var Quat; val: float32) {.
|
proc `y=`*(self: var Quat; val: float32) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_set_y", header: "godot_quat.h".}
|
importc: "godot_quat_set_y", header: "godot/quat.h".}
|
||||||
proc z*(self: Quat): float32 {.
|
proc z*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_get_z", header: "godot_quat.h".}
|
importc: "godot_quat_get_z", header: "godot/quat.h".}
|
||||||
proc `z=`*(self: var Quat; val: float32) {.
|
proc `z=`*(self: var Quat; val: float32) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_set_z", header: "godot_quat.h".}
|
importc: "godot_quat_set_z", header: "godot/quat.h".}
|
||||||
proc w*(self: Quat): float32 {.
|
proc w*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_get_w", header: "godot_quat.h".}
|
importc: "godot_quat_get_w", header: "godot/quat.h".}
|
||||||
proc `w=`*(self: var Quat; val: float32) {.
|
proc `w=`*(self: var Quat; val: float32) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_set_w", header: "godot_quat.h".}
|
importc: "godot_quat_set_w", header: "godot/quat.h".}
|
||||||
|
|
||||||
proc toGodotString*(self: Quat): GodotString {.
|
proc toGodotString*(self: Quat): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_as_string", header: "godot_quat.h".}
|
importc: "godot_quat_as_string", header: "godot/quat.h".}
|
||||||
proc `$`*(self: Quat): string {.inline.} =
|
proc `$`*(self: Quat): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc length*(self: Quat): float32 {.
|
proc length*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_length", header: "godot_quat.h".}
|
importc: "godot_quat_length", header: "godot/quat.h".}
|
||||||
proc lengthSquared*(self: Quat): float32 {.
|
proc lengthSquared*(self: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_length_squared", header: "godot_quat.h".}
|
importc: "godot_quat_length_squared", header: "godot/quat.h".}
|
||||||
proc normalized*(self: Quat): Quat {.
|
proc normalized*(self: Quat): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_normalized", header: "godot_quat.h".}
|
importc: "godot_quat_normalized", header: "godot/quat.h".}
|
||||||
proc isNormalized*(self: Quat): bool {.
|
proc isNormalized*(self: Quat): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_is_normalized", header: "godot_quat.h".}
|
importc: "godot_quat_is_normalized", header: "godot/quat.h".}
|
||||||
proc inverse*(self: Quat): Quat {.
|
proc inverse*(self: Quat): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_inverse", header: "godot_quat.h".}
|
importc: "godot_quat_inverse", header: "godot/quat.h".}
|
||||||
proc dot*(a, b: Quat): float32 {.
|
proc dot*(a, b: Quat): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_dot", header: "godot_quat.h".}
|
importc: "godot_quat_dot", header: "godot/quat.h".}
|
||||||
proc xform*(self: Quat; v: Vector3): Vector3 {.
|
proc xform*(self: Quat; v: Vector3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_xform", header: "godot_quat.h".}
|
importc: "godot_quat_xform", header: "godot/quat.h".}
|
||||||
proc slerp*(self: Quat; b: Quat; t: float32): Quat {.
|
proc slerp*(self: Quat; b: Quat; t: float32): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_slerp", header: "godot_quat.h".}
|
importc: "godot_quat_slerp", header: "godot/quat.h".}
|
||||||
proc slerpni*(self: Quat; b: Quat; t: float32): Quat {.
|
proc slerpni*(self: Quat; b: Quat; t: float32): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_slerpni", header: "godot_quat.h".}
|
importc: "godot_quat_slerpni", header: "godot/quat.h".}
|
||||||
proc cubicSlerp*(self, b, pre_a, post_b: Quat;
|
proc cubicSlerp*(self, b, pre_a, post_b: Quat;
|
||||||
t: float32): Quat {.
|
t: float32): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_cubic_slerp",
|
importc: "godot_quat_cubic_slerp",
|
||||||
header: "godot_quat.h".}
|
header: "godot/quat.h".}
|
||||||
proc `*`*(a: Quat, b: float32): Quat {.
|
proc `*`*(a: Quat, b: float32): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_multiply",
|
importc: "godot_quat_operator_multiply",
|
||||||
header: "godot_quat.h".}
|
header: "godot/quat.h".}
|
||||||
proc `*=`*(a: var Quat, b: float32) {.inline.} =
|
proc `*=`*(a: var Quat, b: float32) {.inline.} =
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
||||||
proc `+`*(a, b: Quat): Quat {.
|
proc `+`*(a, b: Quat): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_add", header: "godot_quat.h".}
|
importc: "godot_quat_operator_add", header: "godot/quat.h".}
|
||||||
proc `+=`*(a: var Quat, b: Quat) {.inline.} =
|
proc `+=`*(a: var Quat, b: Quat) {.inline.} =
|
||||||
a = a + b
|
a = a + b
|
||||||
|
|
||||||
proc `-`*(a, b: Quat): Quat {.
|
proc `-`*(a, b: Quat): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_substract",
|
importc: "godot_quat_operator_substract",
|
||||||
header: "godot_quat.h".}
|
header: "godot/quat.h".}
|
||||||
proc `-=`* (a: var Quat, b: Quat) {.inline.} =
|
proc `-=`* (a: var Quat, b: Quat) {.inline.} =
|
||||||
a = a - b
|
a = a - b
|
||||||
|
|
||||||
proc `/`*(self: Quat; b: float32): Quat {.
|
proc `/`*(self: Quat; b: float32): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_divide", header: "godot_quat.h".}
|
importc: "godot_quat_operator_divide", header: "godot/quat.h".}
|
||||||
proc `/=`*(self: var Quat, b: float32) {.inline.} =
|
proc `/=`*(self: var Quat, b: float32) {.inline.} =
|
||||||
self = self / b
|
self = self / b
|
||||||
|
|
||||||
proc `==`*(a, b: Quat): bool {.
|
proc `==`*(a, b: Quat): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_equal", header: "godot_quat.h".}
|
importc: "godot_quat_operator_equal", header: "godot/quat.h".}
|
||||||
proc `-`*(self: Quat): Quat {.
|
proc `-`*(self: Quat): Quat {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_quat_operator_neg", header: "godot_quat.h".}
|
importc: "godot_quat_operator_neg", header: "godot/quat.h".}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
import godotbase, vector2, strings
|
import godotbase, vector2, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Rect2* {.importc: "godot_rect2", header: "godot_rect2.h", byref.} = object
|
Rect2* {.importc: "godot_rect2", header: "godot/rect2.h", byref.} = object
|
||||||
|
|
||||||
proc initRect2(dest: var Rect2; pos, size: Vector2) {.
|
proc initRect2(dest: var Rect2; pos, size: Vector2) {.
|
||||||
importc: "godot_rect2_new_with_position_and_size",
|
importc: "godot_rect2_new_with_position_and_size",
|
||||||
header: "godot_rect2.h".}
|
header: "godot/rect2.h".}
|
||||||
proc initRect2(dest: var Rect2; x, y, sizeX, sizeY: float32) {.
|
proc initRect2(dest: var Rect2; x, y, sizeX, sizeY: float32) {.
|
||||||
importc: "godot_rect2_new", header: "godot_rect2.h".}
|
importc: "godot_rect2_new", header: "godot/rect2.h".}
|
||||||
|
|
||||||
proc initRect2*(pos, size: Vector2): Rect2 {.inline.} =
|
proc initRect2*(pos, size: Vector2): Rect2 {.inline.} =
|
||||||
initRect2(result, pos, size)
|
initRect2(result, pos, size)
|
||||||
|
|
@ -19,50 +19,50 @@ proc initRect2*(x, y, sizeX, sizeY: float32): Rect2 {.inline.} =
|
||||||
|
|
||||||
proc toGodotString*(self: Rect2): GodotString {.
|
proc toGodotString*(self: Rect2): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_as_string", header: "godot_rect2.h".}
|
importc: "godot_rect2_as_string", header: "godot/rect2.h".}
|
||||||
proc `$`*(self: Rect2): string {.inline.} =
|
proc `$`*(self: Rect2): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc area*(self: Rect2): float32 {.
|
proc area*(self: Rect2): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_get_area", header: "godot_rect2.h".}
|
importc: "godot_rect2_get_area", header: "godot/rect2.h".}
|
||||||
proc intersects*(a, b: Rect2): bool {.
|
proc intersects*(a, b: Rect2): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_intersects", header: "godot_rect2.h".}
|
importc: "godot_rect2_intersects", header: "godot/rect2.h".}
|
||||||
proc encloses*(a, b: Rect2): bool {.
|
proc encloses*(a, b: Rect2): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_encloses", header: "godot_rect2.h".}
|
importc: "godot_rect2_encloses", header: "godot/rect2.h".}
|
||||||
proc hasNoArea*(self: Rect2): bool {.
|
proc hasNoArea*(self: Rect2): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_has_no_area", header: "godot_rect2.h".}
|
importc: "godot_rect2_has_no_area", header: "godot/rect2.h".}
|
||||||
proc clip*(a, b: Rect2): Rect2 {.
|
proc clip*(a, b: Rect2): Rect2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_clip", header: "godot_rect2.h".}
|
importc: "godot_rect2_clip", header: "godot/rect2.h".}
|
||||||
proc merge*(a, b: Rect2): Rect2 {.
|
proc merge*(a, b: Rect2): Rect2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_merge", header: "godot_rect2.h".}
|
importc: "godot_rect2_merge", header: "godot/rect2.h".}
|
||||||
proc contains*(self: Rect2; point: Vector2): bool {.
|
proc contains*(self: Rect2; point: Vector2): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_has_point", header: "godot_rect2.h".}
|
importc: "godot_rect2_has_point", header: "godot/rect2.h".}
|
||||||
proc grow*(self: Rect2; by: float32): Rect2 {.
|
proc grow*(self: Rect2; by: float32): Rect2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_grow", header: "godot_rect2.h".}
|
importc: "godot_rect2_grow", header: "godot/rect2.h".}
|
||||||
proc expand*(self: Rect2; to: Vector2): Rect2 {.
|
proc expand*(self: Rect2; to: Vector2): Rect2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_expand", header: "godot_rect2.h".}
|
importc: "godot_rect2_expand", header: "godot/rect2.h".}
|
||||||
proc `==`*(a, b: Rect2): bool {.
|
proc `==`*(a, b: Rect2): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_operator_equal",
|
importc: "godot_rect2_operator_equal",
|
||||||
header: "godot_rect2.h".}
|
header: "godot/rect2.h".}
|
||||||
proc position*(self: Rect2): Vector2 {.
|
proc position*(self: Rect2): Vector2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_get_position", header: "godot_rect2.h".}
|
importc: "godot_rect2_get_position", header: "godot/rect2.h".}
|
||||||
proc size*(self: Rect2): Vector2 {.
|
proc size*(self: Rect2): Vector2 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_get_size", header: "godot_rect2.h".}
|
importc: "godot_rect2_get_size", header: "godot/rect2.h".}
|
||||||
proc setPosition*(self: var Rect2; pos: Vector2) {.
|
proc setPosition*(self: var Rect2; pos: Vector2) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_set_position", header: "godot_rect2.h".}
|
importc: "godot_rect2_set_position", header: "godot/rect2.h".}
|
||||||
proc setSize*(self: var Rect2; size: Vector2) {.
|
proc setSize*(self: var Rect2; size: Vector2) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect2_set_size", header: "godot_rect2.h".}
|
importc: "godot_rect2_set_size", header: "godot/rect2.h".}
|
||||||
|
|
|
||||||
|
|
@ -3,98 +3,98 @@
|
||||||
import godotbase, plane, vector3, strings
|
import godotbase, plane, vector3, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Rect3* {.importc: "godot_rect3", header: "godot_rect3.h", byref.} = object
|
Rect3* {.importc: "godot_rect3", header: "godot/rect3.h", byref.} = object
|
||||||
|
|
||||||
proc initRect3(dest: var Rect3; pos, size: Vector3) {.
|
proc initRect3(dest: var Rect3; pos, size: Vector3) {.
|
||||||
importc: "godot_rect3_new", header: "godot_rect3.h".}
|
importc: "godot_rect3_new", header: "godot/rect3.h".}
|
||||||
|
|
||||||
proc initRect3*(pos, size: Vector3): Rect3 {.inline.} =
|
proc initRect3*(pos, size: Vector3): Rect3 {.inline.} =
|
||||||
initRect3(result, pos, size)
|
initRect3(result, pos, size)
|
||||||
|
|
||||||
proc position*(self: Rect3): Vector3 {.
|
proc position*(self: Rect3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_position", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_position", header: "godot/rect3.h".}
|
||||||
proc setPosition*(self: var Rect3; v: Vector3) {.
|
proc setPosition*(self: var Rect3; v: Vector3) {.
|
||||||
noSideEffect
|
noSideEffect
|
||||||
importc: "godot_rect3_set_position", header: "godot_rect3.h".}
|
importc: "godot_rect3_set_position", header: "godot/rect3.h".}
|
||||||
proc size*(self: Rect3): Vector3 {.
|
proc size*(self: Rect3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_size", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_size", header: "godot/rect3.h".}
|
||||||
proc setSize*(self: var Rect3; v: Vector3) {.
|
proc setSize*(self: var Rect3; v: Vector3) {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_set_size", header: "godot_rect3.h".}
|
importc: "godot_rect3_set_size", header: "godot/rect3.h".}
|
||||||
proc toGodotString*(self: Rect3): GodotString {.
|
proc toGodotString*(self: Rect3): GodotString {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_as_string", header: "godot_rect3.h".}
|
importc: "godot_rect3_as_string", header: "godot/rect3.h".}
|
||||||
proc `$`*(self: Rect3): string {.inline.} =
|
proc `$`*(self: Rect3): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
proc area*(self: Rect3): float32 {.
|
proc area*(self: Rect3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_area", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_area", header: "godot/rect3.h".}
|
||||||
proc hasNoArea*(self: Rect3): bool {.
|
proc hasNoArea*(self: Rect3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_has_no_area", header: "godot_rect3.h".}
|
importc: "godot_rect3_has_no_area", header: "godot/rect3.h".}
|
||||||
proc hasNoSurface*(self: Rect3): bool {.
|
proc hasNoSurface*(self: Rect3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_has_no_surface", header: "godot_rect3.h".}
|
importc: "godot_rect3_has_no_surface", header: "godot/rect3.h".}
|
||||||
proc intersects*(a, b: Rect3): bool {.
|
proc intersects*(a, b: Rect3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_intersects", header: "godot_rect3.h".}
|
importc: "godot_rect3_intersects", header: "godot/rect3.h".}
|
||||||
proc encloses*(self, other: Rect3): bool {.
|
proc encloses*(self, other: Rect3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_encloses", header: "godot_rect3.h".}
|
importc: "godot_rect3_encloses", header: "godot/rect3.h".}
|
||||||
proc merge*(self, other: Rect3): Rect3 {.
|
proc merge*(self, other: Rect3): Rect3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_merge", header: "godot_rect3.h".}
|
importc: "godot_rect3_merge", header: "godot/rect3.h".}
|
||||||
proc intersection*(self, other: Rect3): Rect3 {.
|
proc intersection*(self, other: Rect3): Rect3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_intersection", header: "godot_rect3.h".}
|
importc: "godot_rect3_intersection", header: "godot/rect3.h".}
|
||||||
proc intersectsPlane*(self: Rect3; plane: Plane): bool {.
|
proc intersectsPlane*(self: Rect3; plane: Plane): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_intersects_plane",
|
importc: "godot_rect3_intersects_plane",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc intersectsSegment*(self: Rect3; start, to: Vector3): bool {.
|
proc intersectsSegment*(self: Rect3; start, to: Vector3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_intersects_segment",
|
importc: "godot_rect3_intersects_segment",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc contains*(self: Rect3; point: Vector3): bool {.
|
proc contains*(self: Rect3; point: Vector3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_has_point", header: "godot_rect3.h".}
|
importc: "godot_rect3_has_point", header: "godot/rect3.h".}
|
||||||
proc getSupport*(self: Rect3; dir: Vector3): Vector3 {.
|
proc getSupport*(self: Rect3; dir: Vector3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_support", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_support", header: "godot/rect3.h".}
|
||||||
proc getLongestAxis*(self: Rect3): Vector3 {.
|
proc getLongestAxis*(self: Rect3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_longest_axis", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_longest_axis", header: "godot/rect3.h".}
|
||||||
proc getLongestAxisIndex*(self: Rect3): cint {.
|
proc getLongestAxisIndex*(self: Rect3): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_longest_axis_index",
|
importc: "godot_rect3_get_longest_axis_index",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc getLongestAxisSize*(self: Rect3): float32 {.
|
proc getLongestAxisSize*(self: Rect3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_longest_axis_size",
|
importc: "godot_rect3_get_longest_axis_size",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc getShortestAxis*(self: Rect3): Vector3 {.
|
proc getShortestAxis*(self: Rect3): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_shortest_axis", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_shortest_axis", header: "godot/rect3.h".}
|
||||||
proc getShortestAxisIndex*(self: Rect3): cint {.
|
proc getShortestAxisIndex*(self: Rect3): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_shortest_axis_index",
|
importc: "godot_rect3_get_shortest_axis_index",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc getShortestAxisSize*(self: Rect3): float32 {.
|
proc getShortestAxisSize*(self: Rect3): float32 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_shortest_axis_size",
|
importc: "godot_rect3_get_shortest_axis_size",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
proc expand*(self: Rect3; toPoint: Vector3): Rect3 {.
|
proc expand*(self: Rect3; toPoint: Vector3): Rect3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_expand", header: "godot_rect3.h".}
|
importc: "godot_rect3_expand", header: "godot/rect3.h".}
|
||||||
proc grow*(self: Rect3; by: float32): Rect3 {.
|
proc grow*(self: Rect3; by: float32): Rect3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_grow", header: "godot_rect3.h".}
|
importc: "godot_rect3_grow", header: "godot/rect3.h".}
|
||||||
proc getEndpoint*(self: Rect3; idx: cint): Vector3 {.
|
proc getEndpoint*(self: Rect3; idx: cint): Vector3 {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_get_endpoint", header: "godot_rect3.h".}
|
importc: "godot_rect3_get_endpoint", header: "godot/rect3.h".}
|
||||||
proc `==`*(a, b: Rect3): bool {.
|
proc `==`*(a, b: Rect3): bool {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rect3_operator_equal",
|
importc: "godot_rect3_operator_equal",
|
||||||
header: "godot_rect3.h".}
|
header: "godot/rect3.h".}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import godotbase
|
import godotbase
|
||||||
|
|
||||||
type
|
type
|
||||||
RID* {.importc: "godot_rid", header: "godot_rid.h", byref.} = object
|
RID* {.importc: "godot_rid", header: "godot/rid.h", byref.} = object
|
||||||
|
|
||||||
proc initRID(dest: var RID) {.
|
proc initRID(dest: var RID) {.
|
||||||
importc: "godot_rid_new",
|
importc: "godot_rid_new",
|
||||||
header: "godot_rid.h".}
|
header: "godot/rid.h".}
|
||||||
proc initRID(dest: var RID; obj: ptr GodotObject) {.
|
proc initRID(dest: var RID; obj: ptr GodotObject) {.
|
||||||
importc: "godot_rid_new_with_resource", header: "godot_rid.h".}
|
importc: "godot_rid_new_with_resource", header: "godot/rid.h".}
|
||||||
|
|
||||||
proc initRID*(): RID {.inline.} =
|
proc initRID*(): RID {.inline.} =
|
||||||
initRID(result)
|
initRID(result)
|
||||||
|
|
@ -17,12 +17,12 @@ proc initRID*(obj: ptr GodotObject): RID {.inline.} =
|
||||||
|
|
||||||
proc idCInt(self: RID): cint {.
|
proc idCInt(self: RID): cint {.
|
||||||
noSideEffect,
|
noSideEffect,
|
||||||
importc: "godot_rid_get_id", header: "godot_rid.h".}
|
importc: "godot_rid_get_id", header: "godot/rid.h".}
|
||||||
|
|
||||||
proc id*(self: RID): uint32 {.inline.} =
|
proc id*(self: RID): uint32 {.inline.} =
|
||||||
cast[uint32](self.idCInt())
|
cast[uint32](self.idCInt())
|
||||||
|
|
||||||
proc `==`*(a, b: RID): bool {.
|
proc `==`*(a, b: RID): bool {.
|
||||||
importc: "godot_rid_operator_equal", header: "godot_rid.h".}
|
importc: "godot_rid_operator_equal", header: "godot/rid.h".}
|
||||||
proc `<`*(a, b: RID): bool {.
|
proc `<`*(a, b: RID): bool {.
|
||||||
importc: "godot_rid_operator_less", header: "godot_rid.h".}
|
importc: "godot_rid_operator_less", header: "godot/rid.h".}
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,22 @@
|
||||||
import godotbase
|
import godotbase
|
||||||
|
|
||||||
type
|
type
|
||||||
GodotString* {.importc: "godot_string", header: "godot_string.h",
|
GodotString* {.importc: "godot_string", header: "godot/string.h",
|
||||||
byref.} = object
|
byref.} = object
|
||||||
|
|
||||||
proc initGodotString(dest: var GodotString) {.
|
proc initGodotString(dest: var GodotString) {.
|
||||||
importc: "godot_string_new", header: "godot_string.h".}
|
importc: "godot_string_new", header: "godot/string.h".}
|
||||||
proc initGodotString(dest: var GodotString; src: GodotString) {.
|
proc initGodotString(dest: var GodotString; src: GodotString) {.
|
||||||
importc: "godot_string_new_copy", header: "godot_string.h".}
|
importc: "godot_string_new_copy", header: "godot/string.h".}
|
||||||
proc initGodotString(dest: var GodotString; contents: cstring;
|
proc initGodotString(dest: var GodotString; contents: cstring;
|
||||||
size: cint) {.
|
size: cint) {.
|
||||||
importc: "godot_string_new_data", header: "godot_string.h".}
|
importc: "godot_string_new_data", header: "godot/string.h".}
|
||||||
## Initializes ``dest`` from UTF-8 ``contents``
|
## Initializes ``dest`` from UTF-8 ``contents``
|
||||||
proc getData(self: GodotString; dest: cstring;
|
proc getData(self: GodotString; dest: cstring;
|
||||||
size: var cint) {.
|
size: var cint) {.
|
||||||
noSideEffect
|
noSideEffect
|
||||||
importc: "godot_string_get_data",
|
importc: "godot_string_get_data",
|
||||||
header: "godot_string.h".}
|
header: "godot/string.h".}
|
||||||
## Converts ``self`` into UTF-8 encoding, putting the result into ``dest``.
|
## Converts ``self`` into UTF-8 encoding, putting the result into ``dest``.
|
||||||
|
|
||||||
proc len*(self: GodotString): cint {.inline.} =
|
proc len*(self: GodotString): cint {.inline.} =
|
||||||
|
|
@ -26,19 +26,19 @@ proc len*(self: GodotString): cint {.inline.} =
|
||||||
getData(self, nil, result)
|
getData(self, nil, result)
|
||||||
|
|
||||||
proc cstring*(self: GodotString): cstring {.
|
proc cstring*(self: GodotString): cstring {.
|
||||||
importc: "godot_string_c_str", header: "godot_string.h".}
|
importc: "godot_string_c_str", header: "godot/string.h".}
|
||||||
proc `==`*(self, b: GodotString): bool {.
|
proc `==`*(self, b: GodotString): bool {.
|
||||||
importc: "godot_string_operator_equal",
|
importc: "godot_string_operator_equal",
|
||||||
header: "godot_string.h".}
|
header: "godot/string.h".}
|
||||||
proc `<`*(self, b: GodotString): bool {.
|
proc `<`*(self, b: GodotString): bool {.
|
||||||
importc: "godot_string_operator_less",
|
importc: "godot_string_operator_less",
|
||||||
header: "godot_string.h".}
|
header: "godot/string.h".}
|
||||||
proc `&`*(self, b: GodotString): GodotString {.
|
proc `&`*(self, b: GodotString): GodotString {.
|
||||||
importc: "godot_string_operator_plus",
|
importc: "godot_string_operator_plus",
|
||||||
header: "godot_string.h".}
|
header: "godot/string.h".}
|
||||||
|
|
||||||
proc deinit*(self: var GodotString) {.importc: "godot_string_destroy",
|
proc deinit*(self: var GodotString) {.importc: "godot_string_destroy",
|
||||||
header: "godot_string.h".}
|
header: "godot/string.h".}
|
||||||
proc `=destroy`(self: GodotString) {.inline.} =
|
proc `=destroy`(self: GodotString) {.inline.} =
|
||||||
unsafeAddr(self).deinit()
|
unsafeAddr(self).deinit()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
# Copyright (c) 2017 Xored Software, Inc.
|
# Copyright (c) 2017 Xored Software, Inc.
|
||||||
|
|
||||||
type
|
type
|
||||||
Transform* {.importc: "godot_transform", header: "godot_transform.h",
|
Transform* {.importc: "godot_transform", header: "godot/transform.h",
|
||||||
byref.} = object
|
byref.} = object
|
||||||
|
|
||||||
import godotbase, basis, variant, vector3, strings, plane, rect3
|
import godotbase, basis, variant, vector3, strings, plane, rect3
|
||||||
|
|
||||||
proc initTransform(dest: var Transform) {.
|
proc initTransform(dest: var Transform) {.
|
||||||
importc: "godot_transform_new_identity", header: "godot_transform.h".}
|
importc: "godot_transform_new_identity", header: "godot/transform.h".}
|
||||||
## Initializes the ``dest`` as identity transform.
|
## Initializes the ``dest`` as identity transform.
|
||||||
proc initTransform(dest: var Transform;
|
proc initTransform(dest: var Transform;
|
||||||
xAxis, yAxis, zAxis, origin: Vector3) {.
|
xAxis, yAxis, zAxis, origin: Vector3) {.
|
||||||
importc: "godot_transform_new_with_axis_origin",
|
importc: "godot_transform_new_with_axis_origin",
|
||||||
header: "godot_transform.h".}
|
header: "godot/transform.h".}
|
||||||
proc initTransform(dest: var Transform; basis: Basis;
|
proc initTransform(dest: var Transform; basis: Basis;
|
||||||
origin: Vector3) {.
|
origin: Vector3) {.
|
||||||
importc: "godot_transform_new",
|
importc: "godot_transform_new",
|
||||||
header: "godot_transform.h".}
|
header: "godot/transform.h".}
|
||||||
|
|
||||||
proc initTransform*(): Transform {.inline.} =
|
proc initTransform*(): Transform {.inline.} =
|
||||||
initTransform(result)
|
initTransform(result)
|
||||||
|
|
@ -29,54 +29,54 @@ proc initTransform*(basis: Basis, origin: Vector3): Transform {.inline.} =
|
||||||
initTransform(result, basis, origin)
|
initTransform(result, basis, origin)
|
||||||
|
|
||||||
proc basis*(self: Transform): Basis {.
|
proc basis*(self: Transform): Basis {.
|
||||||
importc: "godot_transform_get_basis", header: "godot_transform.h".}
|
importc: "godot_transform_get_basis", header: "godot/transform.h".}
|
||||||
proc `basis=`*(self: var Transform; v: Basis) {.
|
proc `basis=`*(self: var Transform; v: Basis) {.
|
||||||
importc: "godot_transform_set_basis", header: "godot_transform.h".}
|
importc: "godot_transform_set_basis", header: "godot/transform.h".}
|
||||||
proc origin*(self: Transform): Vector3 {.
|
proc origin*(self: Transform): Vector3 {.
|
||||||
importc: "godot_transform_get_origin", header: "godot_transform.h".}
|
importc: "godot_transform_get_origin", header: "godot/transform.h".}
|
||||||
proc `origin=`*(self: var Transform; v: Vector3) {.
|
proc `origin=`*(self: var Transform; v: Vector3) {.
|
||||||
importc: "godot_transform_set_origin", header: "godot_transform.h".}
|
importc: "godot_transform_set_origin", header: "godot/transform.h".}
|
||||||
|
|
||||||
proc toGodotString*(self: Transform): GodotString {.
|
proc toGodotString*(self: Transform): GodotString {.
|
||||||
importc: "godot_transform_as_string", header: "godot_transform.h".}
|
importc: "godot_transform_as_string", header: "godot/transform.h".}
|
||||||
proc `$`*(self: Transform): string {.inline.} =
|
proc `$`*(self: Transform): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc inverse*(self: Transform): Transform {.
|
proc inverse*(self: Transform): Transform {.
|
||||||
importc: "godot_transform_inverse", header: "godot_transform.h".}
|
importc: "godot_transform_inverse", header: "godot/transform.h".}
|
||||||
proc affineInverse*(self: Transform): Transform {.
|
proc affineInverse*(self: Transform): Transform {.
|
||||||
importc: "godot_transform_affine_inverse",
|
importc: "godot_transform_affine_inverse",
|
||||||
header: "godot_transform.h".}
|
header: "godot/transform.h".}
|
||||||
proc orthonormalized*(self: Transform): Transform {.
|
proc orthonormalized*(self: Transform): Transform {.
|
||||||
importc: "godot_transform_orthonormalized",
|
importc: "godot_transform_orthonormalized",
|
||||||
header: "godot_transform.h".}
|
header: "godot/transform.h".}
|
||||||
proc rotated*(self: Transform; axis: Vector3;
|
proc rotated*(self: Transform; axis: Vector3;
|
||||||
phi: float32): Transform {.
|
phi: float32): Transform {.
|
||||||
importc: "godot_transform_rotated", header: "godot_transform.h".}
|
importc: "godot_transform_rotated", header: "godot/transform.h".}
|
||||||
proc scaled*(self: Transform; scale: Vector3): Transform {.
|
proc scaled*(self: Transform; scale: Vector3): Transform {.
|
||||||
importc: "godot_transform_scaled", header: "godot_transform.h".}
|
importc: "godot_transform_scaled", header: "godot/transform.h".}
|
||||||
proc translated*(self: Transform; offset: Vector3): Transform {.
|
proc translated*(self: Transform; offset: Vector3): Transform {.
|
||||||
importc: "godot_transform_translated", header: "godot_transform.h".}
|
importc: "godot_transform_translated", header: "godot/transform.h".}
|
||||||
proc lookingAt*(self: Transform;
|
proc lookingAt*(self: Transform;
|
||||||
target, up: Vector3): Transform {.
|
target, up: Vector3): Transform {.
|
||||||
importc: "godot_transform_looking_at", header: "godot_transform.h".}
|
importc: "godot_transform_looking_at", header: "godot/transform.h".}
|
||||||
|
|
||||||
proc xformPlane*(self: Transform; v: Plane): Plane {.
|
proc xformPlane*(self: Transform; v: Plane): Plane {.
|
||||||
importc: "godot_transform_xform_plane", header: "godot_transform.h".}
|
importc: "godot_transform_xform_plane", header: "godot/transform.h".}
|
||||||
proc xformInvPlane*(self: Transform; v: Plane): Plane {.
|
proc xformInvPlane*(self: Transform; v: Plane): Plane {.
|
||||||
importc: "godot_transform_xform_inv_plane", header: "godot_transform.h".}
|
importc: "godot_transform_xform_inv_plane", header: "godot/transform.h".}
|
||||||
proc xformVector3*(self: Transform; v: Vector3): Vector3 {.
|
proc xformVector3*(self: Transform; v: Vector3): Vector3 {.
|
||||||
importc: "godot_transform_xform_vector3", header: "godot_transform.h".}
|
importc: "godot_transform_xform_vector3", header: "godot/transform.h".}
|
||||||
proc xformInvVector3*(self: Transform; v: Vector3): Vector3 {.
|
proc xformInvVector3*(self: Transform; v: Vector3): Vector3 {.
|
||||||
importc: "godot_transform_xform_inv_vector3", header: "godot_transform.h".}
|
importc: "godot_transform_xform_inv_vector3", header: "godot/transform.h".}
|
||||||
proc xformRect3*(self: Transform; v: Vector3): Rect3 {.
|
proc xformRect3*(self: Transform; v: Vector3): Rect3 {.
|
||||||
importc: "godot_transform_xform_rect3", header: "godot_transform.h".}
|
importc: "godot_transform_xform_rect3", header: "godot/transform.h".}
|
||||||
proc xformInvRect3*(self: Transform; v: Vector3): Vector3 {.
|
proc xformInvRect3*(self: Transform; v: Vector3): Vector3 {.
|
||||||
importc: "godot_transform_xform_inv_rect3", header: "godot_transform.h".}
|
importc: "godot_transform_xform_inv_rect3", header: "godot/transform.h".}
|
||||||
|
|
||||||
proc `==`*(self: Transform; b: Transform): bool {.
|
proc `==`*(self: Transform; b: Transform): bool {.
|
||||||
importc: "godot_transform_operator_equal", header: "godot_transform.h".}
|
importc: "godot_transform_operator_equal", header: "godot/transform.h".}
|
||||||
proc `*`*(a, b: Transform): Transform {.
|
proc `*`*(a, b: Transform): Transform {.
|
||||||
importc: "godot_transform_operator_multiply", header: "godot_transform.h".}
|
importc: "godot_transform_operator_multiply", header: "godot/transform.h".}
|
||||||
proc `*=`*(a: var Transform, b: Transform) {.inline.} =
|
proc `*=`*(a: var Transform, b: Transform) {.inline.} =
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
# Copyright (c) 2017 Xored Software, Inc.
|
# Copyright (c) 2017 Xored Software, Inc.
|
||||||
|
|
||||||
type
|
type
|
||||||
Transform2D* {.importc: "godot_transform2d", header: "godot_transform2d.h",
|
Transform2D* {.importc: "godot_transform2d", header: "godot/transform2d.h",
|
||||||
byref.} = object
|
byref.} = object
|
||||||
|
|
||||||
import godotbase, strings, variant, vector2, rect2
|
import godotbase, strings, variant, vector2, rect2
|
||||||
|
|
||||||
proc initTransform2D(dest: var Transform2D) {.
|
proc initTransform2D(dest: var Transform2D) {.
|
||||||
importc: "godot_transform2d_new_identity", header: "godot_transform2d.h".}
|
importc: "godot_transform2d_new_identity", header: "godot/transform2d.h".}
|
||||||
proc initTransform2D(dest: var Transform2D; rot: float32; pos: Vector2) {.
|
proc initTransform2D(dest: var Transform2D; rot: float32; pos: Vector2) {.
|
||||||
importc: "godot_transform2d_new", header: "godot_transform2d.h".}
|
importc: "godot_transform2d_new", header: "godot/transform2d.h".}
|
||||||
proc initTransform2D(dest: var Transform2D; xAxis, yAxis, origin: Vector2) {.
|
proc initTransform2D(dest: var Transform2D; xAxis, yAxis, origin: Vector2) {.
|
||||||
importc: "godot_transform2d_new_axis_origin",
|
importc: "godot_transform2d_new_axis_origin",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
|
|
||||||
proc initTransform2D*(): Transform2D {.inline.} =
|
proc initTransform2D*(): Transform2D {.inline.} =
|
||||||
initTransform2D(result)
|
initTransform2D(result)
|
||||||
|
|
@ -25,67 +25,67 @@ proc initTransform2D*(xAxis, yAxis, origin: Vector2): Transform2D {.inline.} =
|
||||||
|
|
||||||
proc toGodotString*(self: Transform2D): GodotString {.
|
proc toGodotString*(self: Transform2D): GodotString {.
|
||||||
importc: "godot_transform2d_as_string",
|
importc: "godot_transform2d_as_string",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc `$`*(self: Transform2D): string {.inline.} =
|
proc `$`*(self: Transform2D): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc inverse*(self: Transform2D): Transform2D {.
|
proc inverse*(self: Transform2D): Transform2D {.
|
||||||
importc: "godot_transform2d_inverse", header: "godot_transform2d.h".}
|
importc: "godot_transform2d_inverse", header: "godot/transform2d.h".}
|
||||||
proc affineInverse*(self: Transform2D): Transform2D {.
|
proc affineInverse*(self: Transform2D): Transform2D {.
|
||||||
importc: "godot_transform2d_affine_inverse",
|
importc: "godot_transform2d_affine_inverse",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc rotation*(self: Transform2D): float32 {.
|
proc rotation*(self: Transform2D): float32 {.
|
||||||
importc: "godot_transform2d_get_rotation",
|
importc: "godot_transform2d_get_rotation",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc origin*(self: Transform2D): Vector2 {.
|
proc origin*(self: Transform2D): Vector2 {.
|
||||||
importc: "godot_transform2d_get_origin",
|
importc: "godot_transform2d_get_origin",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc scale*(self: Transform2D): Vector2 {.
|
proc scale*(self: Transform2D): Vector2 {.
|
||||||
importc: "godot_transform2d_get_scale",
|
importc: "godot_transform2d_get_scale",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc orthonormalized*(self: Transform2D): Transform2D {.
|
proc orthonormalized*(self: Transform2D): Transform2D {.
|
||||||
importc: "godot_transform2d_orthonormalized",
|
importc: "godot_transform2d_orthonormalized",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc rotated*(self: Transform2D; phi: float32): Transform2D {.
|
proc rotated*(self: Transform2D; phi: float32): Transform2D {.
|
||||||
importc: "godot_transform2d_rotated",
|
importc: "godot_transform2d_rotated",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc scaled*(self: Transform2D; scale: Vector2): Transform2D {.
|
proc scaled*(self: Transform2D; scale: Vector2): Transform2D {.
|
||||||
importc: "godot_transform2d_scaled",
|
importc: "godot_transform2d_scaled",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc translated*(self: Transform2D;
|
proc translated*(self: Transform2D;
|
||||||
offset: Vector2): Transform2D {.
|
offset: Vector2): Transform2D {.
|
||||||
importc: "godot_transform2d_translated",
|
importc: "godot_transform2d_translated",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc xformVector2*(self: Transform2D; v: Vector2): Vector2 {.
|
proc xformVector2*(self: Transform2D; v: Vector2): Vector2 {.
|
||||||
importc: "godot_transform2d_xform_vector2",
|
importc: "godot_transform2d_xform_vector2",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc xformInvVector2*(self: Transform2D; v: Vector2): Vector2 {.
|
proc xformInvVector2*(self: Transform2D; v: Vector2): Vector2 {.
|
||||||
importc: "godot_transform2d_xform_inv_vector2",
|
importc: "godot_transform2d_xform_inv_vector2",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc basisXformVector2*(self: Transform2D;
|
proc basisXformVector2*(self: Transform2D;
|
||||||
v: Vector2): Vector2 {.
|
v: Vector2): Vector2 {.
|
||||||
importc: "godot_transform2d_basis_xform_vector2",
|
importc: "godot_transform2d_basis_xform_vector2",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc basisXformInvVector2*(self: Transform2D;
|
proc basisXformInvVector2*(self: Transform2D;
|
||||||
v: Vector2): Vector2 {.
|
v: Vector2): Vector2 {.
|
||||||
importc: "godot_transform2d_basis_xform_inv_vector2",
|
importc: "godot_transform2d_basis_xform_inv_vector2",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc xformRect2*(self: Transform2D; v: Rect2): Rect2 {.
|
proc xformRect2*(self: Transform2D; v: Rect2): Rect2 {.
|
||||||
importc: "godot_transform2d_xform_rect2", header: "godot_transform2d.h".}
|
importc: "godot_transform2d_xform_rect2", header: "godot/transform2d.h".}
|
||||||
proc xformInvRect2*(self: Transform2D; v: Rect2): Rect2 {.
|
proc xformInvRect2*(self: Transform2D; v: Rect2): Rect2 {.
|
||||||
importc: "godot_transform2d_xform_inv_rect2",
|
importc: "godot_transform2d_xform_inv_rect2",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
|
|
||||||
proc interpolateWith*(self, m: Transform2D;
|
proc interpolateWith*(self, m: Transform2D;
|
||||||
c: float32): Transform2D {.
|
c: float32): Transform2D {.
|
||||||
importc: "godot_transform2d_interpolate_with",
|
importc: "godot_transform2d_interpolate_with",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc `==`*(a, b: Transform2D): bool {.
|
proc `==`*(a, b: Transform2D): bool {.
|
||||||
importc: "godot_transform2d_operator_equal",
|
importc: "godot_transform2d_operator_equal",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
proc `*`*(a, b: Transform2D): Transform2D {.
|
proc `*`*(a, b: Transform2D): Transform2D {.
|
||||||
importc: "godot_transform2d_operator_multiply",
|
importc: "godot_transform2d_operator_multiply",
|
||||||
header: "godot_transform2d.h".}
|
header: "godot/transform2d.h".}
|
||||||
|
|
||||||
proc `*=`*(a: var Transform2D, b: Transform2D) {.inline.} =
|
proc `*=`*(a: var Transform2D, b: Transform2D) {.inline.} =
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import strings, transform, transform2d, vector2
|
||||||
import vector3, color
|
import vector3, color
|
||||||
|
|
||||||
type
|
type
|
||||||
VariantType* {.importc: "godot_variant_type", header: "godot_variant.h",
|
VariantType* {.importc: "godot_variant_type", header: "godot/variant.h",
|
||||||
size: sizeof(cint), pure.} = enum
|
size: sizeof(cint), pure.} = enum
|
||||||
Nil, ## atomic types
|
Nil, ## atomic types
|
||||||
Bool,
|
Bool,
|
||||||
|
|
@ -39,7 +39,7 @@ type
|
||||||
PoolColorArray
|
PoolColorArray
|
||||||
|
|
||||||
VariantCallErrorType* {.importc: "godot_variant_call_error_error",
|
VariantCallErrorType* {.importc: "godot_variant_call_error_error",
|
||||||
header: "godot_variant.h",
|
header: "godot/variant.h",
|
||||||
size: sizeof(cint),
|
size: sizeof(cint),
|
||||||
pure.} = enum
|
pure.} = enum
|
||||||
OK,
|
OK,
|
||||||
|
|
@ -50,79 +50,79 @@ type
|
||||||
InstanceIsNull
|
InstanceIsNull
|
||||||
|
|
||||||
VariantCallError* {.importc: "godot_variant_call_error",
|
VariantCallError* {.importc: "godot_variant_call_error",
|
||||||
header: "godot_variant.h".} = object
|
header: "godot/variant.h".} = object
|
||||||
error* {.importc: "error".}: VariantCallErrorType
|
error* {.importc: "error".}: VariantCallErrorType
|
||||||
argument* {.importc: "argument".}: cint
|
argument* {.importc: "argument".}: cint
|
||||||
expected* {.importc: "expected".}: VariantType
|
expected* {.importc: "expected".}: VariantType
|
||||||
|
|
||||||
proc getType*(p: Variant): VariantType {.
|
proc getType*(p: Variant): VariantType {.
|
||||||
importc: "godot_variant_get_type", header: "godot_variant.h".}
|
importc: "godot_variant_get_type", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc initNilVariant(dest: var Variant) {.
|
proc initNilVariant(dest: var Variant) {.
|
||||||
importc: "godot_variant_new_nil", header: "godot_variant.h".}
|
importc: "godot_variant_new_nil", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; b: bool) {.
|
proc initVariant(dest: var Variant; b: bool) {.
|
||||||
importc: "godot_variant_new_bool", header: "godot_variant.h".}
|
importc: "godot_variant_new_bool", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; i: uint64) {.
|
proc initVariant(dest: var Variant; i: uint64) {.
|
||||||
importc: "godot_variant_new_uint", header: "godot_variant.h".}
|
importc: "godot_variant_new_uint", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; i: int64) {.
|
proc initVariant(dest: var Variant; i: int64) {.
|
||||||
importc: "godot_variant_new_int", header: "godot_variant.h".}
|
importc: "godot_variant_new_int", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; r: cdouble) {.
|
proc initVariant(dest: var Variant; r: cdouble) {.
|
||||||
importc: "godot_variant_new_real", header: "godot_variant.h".}
|
importc: "godot_variant_new_real", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; s: GodotString) {.
|
proc initVariant(dest: var Variant; s: GodotString) {.
|
||||||
importc: "godot_variant_new_string", header: "godot_variant.h".}
|
importc: "godot_variant_new_string", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; v2: Vector2) {.
|
proc initVariant(dest: var Variant; v2: Vector2) {.
|
||||||
importc: "godot_variant_new_vector2", header: "godot_variant.h".}
|
importc: "godot_variant_new_vector2", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; rect2: Rect2) {.
|
proc initVariant(dest: var Variant; rect2: Rect2) {.
|
||||||
importc: "godot_variant_new_rect2", header: "godot_variant.h".}
|
importc: "godot_variant_new_rect2", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; v3: Vector3) {.
|
proc initVariant(dest: var Variant; v3: Vector3) {.
|
||||||
importc: "godot_variant_new_vector3", header: "godot_variant.h".}
|
importc: "godot_variant_new_vector3", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; t2d: Transform2D) {.
|
proc initVariant(dest: var Variant; t2d: Transform2D) {.
|
||||||
importc: "godot_variant_new_transform2d",
|
importc: "godot_variant_new_transform2d",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; plane: Plane) {.
|
proc initVariant(dest: var Variant; plane: Plane) {.
|
||||||
importc: "godot_variant_new_plane", header: "godot_variant.h".}
|
importc: "godot_variant_new_plane", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; quat: Quat) {.
|
proc initVariant(dest: var Variant; quat: Quat) {.
|
||||||
importc: "godot_variant_new_quat", header: "godot_variant.h".}
|
importc: "godot_variant_new_quat", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; rect3: Rect3) {.
|
proc initVariant(dest: var Variant; rect3: Rect3) {.
|
||||||
importc: "godot_variant_new_rect3", header: "godot_variant.h".}
|
importc: "godot_variant_new_rect3", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; basis: Basis) {.
|
proc initVariant(dest: var Variant; basis: Basis) {.
|
||||||
importc: "godot_variant_new_basis", header: "godot_variant.h".}
|
importc: "godot_variant_new_basis", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant;
|
proc initVariant(dest: var Variant;
|
||||||
trans: Transform) {.
|
trans: Transform) {.
|
||||||
importc: "godot_variant_new_transform",
|
importc: "godot_variant_new_transform",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; color: Color) {.
|
proc initVariant(dest: var Variant; color: Color) {.
|
||||||
importc: "godot_variant_new_color", header: "godot_variant.h".}
|
importc: "godot_variant_new_color", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; nodePath: NodePath) {.
|
proc initVariant(dest: var Variant; nodePath: NodePath) {.
|
||||||
importc: "godot_variant_new_node_path",
|
importc: "godot_variant_new_node_path",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; rid: RID) {.
|
proc initVariant(dest: var Variant; rid: RID) {.
|
||||||
importc: "godot_variant_new_rid", header: "godot_variant.h".}
|
importc: "godot_variant_new_rid", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; obj: ptr GodotObject) {.
|
proc initVariant(dest: var Variant; obj: ptr GodotObject) {.
|
||||||
importc: "godot_variant_new_object", header: "godot_variant.h".}
|
importc: "godot_variant_new_object", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; arr: Array) {.
|
proc initVariant(dest: var Variant; arr: Array) {.
|
||||||
importc: "godot_variant_new_array", header: "godot_variant.h".}
|
importc: "godot_variant_new_array", header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pba: PoolByteArray) {.
|
proc initVariant(dest: var Variant; pba: PoolByteArray) {.
|
||||||
importc: "godot_variant_new_pool_byte_array",
|
importc: "godot_variant_new_pool_byte_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pia: PoolIntArray) {.
|
proc initVariant(dest: var Variant; pia: PoolIntArray) {.
|
||||||
importc: "godot_variant_new_pool_int_array",
|
importc: "godot_variant_new_pool_int_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pra: PoolRealArray) {.
|
proc initVariant(dest: var Variant; pra: PoolRealArray) {.
|
||||||
importc: "godot_variant_new_pool_real_array",
|
importc: "godot_variant_new_pool_real_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; psa: PoolStringArray) {.
|
proc initVariant(dest: var Variant; psa: PoolStringArray) {.
|
||||||
importc: "godot_variant_new_pool_string_array",
|
importc: "godot_variant_new_pool_string_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pv2a: PoolVector2Array) {.
|
proc initVariant(dest: var Variant; pv2a: PoolVector2Array) {.
|
||||||
importc: "godot_variant_new_pool_vector2_array",
|
importc: "godot_variant_new_pool_vector2_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pv3a: PoolVector3Array) {.
|
proc initVariant(dest: var Variant; pv3a: PoolVector3Array) {.
|
||||||
importc: "godot_variant_new_pool_vector3_array",
|
importc: "godot_variant_new_pool_vector3_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc initVariant(dest: var Variant; pca: PoolColorArray) {.
|
proc initVariant(dest: var Variant; pca: PoolColorArray) {.
|
||||||
importc: "godot_variant_new_pool_color_array",
|
importc: "godot_variant_new_pool_color_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
|
|
||||||
proc variant*(): Variant {.inline.} =
|
proc variant*(): Variant {.inline.} =
|
||||||
initNilVariant(result)
|
initNilVariant(result)
|
||||||
|
|
@ -210,82 +210,82 @@ proc variant*(pca: PoolColorArray): Variant {.inline.} =
|
||||||
initVariant(result, pca)
|
initVariant(result, pca)
|
||||||
|
|
||||||
proc asBool*(self: Variant): bool {.
|
proc asBool*(self: Variant): bool {.
|
||||||
importc: "godot_variant_as_bool", header: "godot_variant.h".}
|
importc: "godot_variant_as_bool", header: "godot/variant.h".}
|
||||||
proc asUint*(self: Variant): uint64 {.
|
proc asUint*(self: Variant): uint64 {.
|
||||||
importc: "godot_variant_as_uint", header: "godot_variant.h".}
|
importc: "godot_variant_as_uint", header: "godot/variant.h".}
|
||||||
proc asInt*(self: Variant): int64 {.
|
proc asInt*(self: Variant): int64 {.
|
||||||
importc: "godot_variant_as_int", header: "godot_variant.h".}
|
importc: "godot_variant_as_int", header: "godot/variant.h".}
|
||||||
proc asReal*(self: Variant): cdouble {.
|
proc asReal*(self: Variant): cdouble {.
|
||||||
importc: "godot_variant_as_real", header: "godot_variant.h".}
|
importc: "godot_variant_as_real", header: "godot/variant.h".}
|
||||||
proc asGodotString*(self: Variant): GodotString {.
|
proc asGodotString*(self: Variant): GodotString {.
|
||||||
importc: "godot_variant_as_string", header: "godot_variant.h".}
|
importc: "godot_variant_as_string", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc asString*(self: Variant): string =
|
proc asString*(self: Variant): string =
|
||||||
let s = self.asGodotString()
|
let s = self.asGodotString()
|
||||||
result = $s
|
result = $s
|
||||||
|
|
||||||
proc asVector2*(self: Variant): Vector2 {.
|
proc asVector2*(self: Variant): Vector2 {.
|
||||||
importc: "godot_variant_as_vector2", header: "godot_variant.h".}
|
importc: "godot_variant_as_vector2", header: "godot/variant.h".}
|
||||||
proc asRect2*(self: Variant): Rect2 {.
|
proc asRect2*(self: Variant): Rect2 {.
|
||||||
importc: "godot_variant_as_rect2", header: "godot_variant.h".}
|
importc: "godot_variant_as_rect2", header: "godot/variant.h".}
|
||||||
proc asVector3*(self: Variant): Vector3 {.
|
proc asVector3*(self: Variant): Vector3 {.
|
||||||
importc: "godot_variant_as_vector3", header: "godot_variant.h".}
|
importc: "godot_variant_as_vector3", header: "godot/variant.h".}
|
||||||
proc asTransform2D*(self: Variant): Transform2D {.
|
proc asTransform2D*(self: Variant): Transform2D {.
|
||||||
importc: "godot_variant_as_transform2d", header: "godot_variant.h".}
|
importc: "godot_variant_as_transform2d", header: "godot/variant.h".}
|
||||||
proc asPlane*(self: Variant): Plane {.
|
proc asPlane*(self: Variant): Plane {.
|
||||||
importc: "godot_variant_as_plane", header: "godot_variant.h".}
|
importc: "godot_variant_as_plane", header: "godot/variant.h".}
|
||||||
proc asQuat*(self: Variant): Quat {.
|
proc asQuat*(self: Variant): Quat {.
|
||||||
importc: "godot_variant_as_quat", header: "godot_variant.h".}
|
importc: "godot_variant_as_quat", header: "godot/variant.h".}
|
||||||
proc asRect3*(self: Variant): Rect3 {.
|
proc asRect3*(self: Variant): Rect3 {.
|
||||||
importc: "godot_variant_as_rect3", header: "godot_variant.h".}
|
importc: "godot_variant_as_rect3", header: "godot/variant.h".}
|
||||||
proc asBasis*(self: Variant): Basis {.
|
proc asBasis*(self: Variant): Basis {.
|
||||||
importc: "godot_variant_as_basis", header: "godot_variant.h".}
|
importc: "godot_variant_as_basis", header: "godot/variant.h".}
|
||||||
proc asTransform*(self: Variant): Transform {.
|
proc asTransform*(self: Variant): Transform {.
|
||||||
importc: "godot_variant_as_transform", header: "godot_variant.h".}
|
importc: "godot_variant_as_transform", header: "godot/variant.h".}
|
||||||
proc asColor*(self: Variant): Color {.
|
proc asColor*(self: Variant): Color {.
|
||||||
importc: "godot_variant_as_color", header: "godot_variant.h".}
|
importc: "godot_variant_as_color", header: "godot/variant.h".}
|
||||||
proc asNodePath*(self: Variant): NodePath {.
|
proc asNodePath*(self: Variant): NodePath {.
|
||||||
importc: "godot_variant_as_node_path", header: "godot_variant.h".}
|
importc: "godot_variant_as_node_path", header: "godot/variant.h".}
|
||||||
proc asRid*(self: Variant): RID {.
|
proc asRid*(self: Variant): RID {.
|
||||||
importc: "godot_variant_as_rid", header: "godot_variant.h".}
|
importc: "godot_variant_as_rid", header: "godot/variant.h".}
|
||||||
proc asObject*(self: Variant): ptr GodotObject {.
|
proc asObject*(self: Variant): ptr GodotObject {.
|
||||||
importc: "godot_variant_as_object", header: "godot_variant.h".}
|
importc: "godot_variant_as_object", header: "godot/variant.h".}
|
||||||
proc asArray*(self: Variant): Array {.
|
proc asArray*(self: Variant): Array {.
|
||||||
importc: "godot_variant_as_array", header: "godot_variant.h".}
|
importc: "godot_variant_as_array", header: "godot/variant.h".}
|
||||||
proc asPoolByteArray*(self: Variant): PoolByteArray {.
|
proc asPoolByteArray*(self: Variant): PoolByteArray {.
|
||||||
importc: "godot_variant_as_pool_byte_array",
|
importc: "godot_variant_as_pool_byte_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolIntArray*(self: Variant): PoolIntArray {.
|
proc asPoolIntArray*(self: Variant): PoolIntArray {.
|
||||||
importc: "godot_variant_as_pool_int_array",
|
importc: "godot_variant_as_pool_int_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolRealArray*(self: Variant): PoolRealArray {.
|
proc asPoolRealArray*(self: Variant): PoolRealArray {.
|
||||||
importc: "godot_variant_as_pool_real_array",
|
importc: "godot_variant_as_pool_real_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolStringArray*(self: Variant): PoolStringArray {.
|
proc asPoolStringArray*(self: Variant): PoolStringArray {.
|
||||||
importc: "godot_variant_as_pool_string_array",
|
importc: "godot_variant_as_pool_string_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolVector2Array*(self: Variant): PoolVector2Array {.
|
proc asPoolVector2Array*(self: Variant): PoolVector2Array {.
|
||||||
importc: "godot_variant_as_pool_vector2_array",
|
importc: "godot_variant_as_pool_vector2_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolVector3Array*(self: Variant): PoolVector3Array {.
|
proc asPoolVector3Array*(self: Variant): PoolVector3Array {.
|
||||||
importc: "godot_variant_as_pool_vector3_array",
|
importc: "godot_variant_as_pool_vector3_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
proc asPoolColorArray*(self: Variant): PoolColorArray {.
|
proc asPoolColorArray*(self: Variant): PoolColorArray {.
|
||||||
importc: "godot_variant_as_pool_color_array",
|
importc: "godot_variant_as_pool_color_array",
|
||||||
header: "godot_variant.h".}
|
header: "godot/variant.h".}
|
||||||
|
|
||||||
proc call*(self: Variant; meth: GodotString;
|
proc call*(self: Variant; meth: GodotString;
|
||||||
args: var array[MAX_ARG_COUNT, Variant]; argCount: cint;
|
args: var array[MAX_ARG_COUNT, Variant]; argCount: cint;
|
||||||
error: var VariantCallError): Variant {.
|
error: var VariantCallError): Variant {.
|
||||||
importc: "godot_variant_call", header: "godot_variant.h".}
|
importc: "godot_variant_call", header: "godot/variant.h".}
|
||||||
|
|
||||||
proc hasMethod*(self: Variant; meth: GodotString): bool {.
|
proc hasMethod*(self: Variant; meth: GodotString): bool {.
|
||||||
importc: "godot_variant_has_method", header: "godot_variant.h".}
|
importc: "godot_variant_has_method", header: "godot/variant.h".}
|
||||||
proc `==`*(self, other: Variant): bool {.
|
proc `==`*(self, other: Variant): bool {.
|
||||||
importc: "godot_variant_operator_equal", header: "godot_variant.h".}
|
importc: "godot_variant_operator_equal", header: "godot/variant.h".}
|
||||||
proc `<`*(self, other: Variant): bool {.
|
proc `<`*(self, other: Variant): bool {.
|
||||||
importc: "godot_variant_operator_less", header: "godot_variant.h".}
|
importc: "godot_variant_operator_less", header: "godot/variant.h".}
|
||||||
proc hashCompare*(self, other: Variant): bool {.
|
proc hashCompare*(self, other: Variant): bool {.
|
||||||
importc: "godot_variant_hash_compare", header: "godot_variant.h".}
|
importc: "godot_variant_hash_compare", header: "godot/variant.h".}
|
||||||
proc booleanize*(self: Variant; isValid: var bool): bool {.
|
proc booleanize*(self: Variant; isValid: var bool): bool {.
|
||||||
importc: "godot_variant_booleanize", header: "godot_variant.h".}
|
importc: "godot_variant_booleanize", header: "godot/variant.h".}
|
||||||
|
|
|
||||||
|
|
@ -1,117 +1,117 @@
|
||||||
# Copyright (c) 2017 Xored Software, Inc.
|
# Copyright (c) 2017 Xored Software, Inc.
|
||||||
|
|
||||||
type
|
type
|
||||||
Vector2* {.importc: "godot_vector2", header: "godot_vector2.h",
|
Vector2* {.importc: "godot_vector2", header: "godot/vector2.h",
|
||||||
byref.} = object
|
byref.} = object
|
||||||
|
|
||||||
import godotbase, strings
|
import godotbase, strings
|
||||||
|
|
||||||
proc initVector2(dest: var Vector2; x, y: float32) {.
|
proc initVector2(dest: var Vector2; x, y: float32) {.
|
||||||
importc: "godot_vector2_new", header: "godot_vector2.h".}
|
importc: "godot_vector2_new", header: "godot/vector2.h".}
|
||||||
|
|
||||||
proc vec2*(x, y: float32): Vector2 {.inline.} =
|
proc vec2*(x, y: float32): Vector2 {.inline.} =
|
||||||
initVector2(result, x, y)
|
initVector2(result, x, y)
|
||||||
|
|
||||||
proc toGodotString*(self: Vector2): GodotString {.
|
proc toGodotString*(self: Vector2): GodotString {.
|
||||||
importc: "godot_vector2_as_string", header: "godot_vector2.h".}
|
importc: "godot_vector2_as_string", header: "godot/vector2.h".}
|
||||||
proc `$`*(self: Vector2): string {.inline.} =
|
proc `$`*(self: Vector2): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc normalized*(self: Vector2): Vector2 {.
|
proc normalized*(self: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_normalized", header: "godot_vector2.h".}
|
importc: "godot_vector2_normalized", header: "godot/vector2.h".}
|
||||||
proc length*(self: Vector2): float32 {.
|
proc length*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_length", header: "godot_vector2.h".}
|
importc: "godot_vector2_length", header: "godot/vector2.h".}
|
||||||
proc angle*(self: Vector2): float32 {.
|
proc angle*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_angle", header: "godot_vector2.h".}
|
importc: "godot_vector2_angle", header: "godot/vector2.h".}
|
||||||
proc lengthSquared*(self: Vector2): float32 {.
|
proc lengthSquared*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_length_squared", header: "godot_vector2.h".}
|
importc: "godot_vector2_length_squared", header: "godot/vector2.h".}
|
||||||
proc isNormalized*(self: Vector2): bool {.
|
proc isNormalized*(self: Vector2): bool {.
|
||||||
importc: "godot_vector2_is_normalized", header: "godot_vector2.h".}
|
importc: "godot_vector2_is_normalized", header: "godot/vector2.h".}
|
||||||
proc distanceTo*(self, to: Vector2): float32 {.
|
proc distanceTo*(self, to: Vector2): float32 {.
|
||||||
importc: "godot_vector2_distance_to",
|
importc: "godot_vector2_distance_to",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc distanceSquaredTo*(self, to: Vector2): float32 {.
|
proc distanceSquaredTo*(self, to: Vector2): float32 {.
|
||||||
importc: "godot_vector2_distance_squared_to",
|
importc: "godot_vector2_distance_squared_to",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc angleTo*(self, to: Vector2): float32 {.
|
proc angleTo*(self, to: Vector2): float32 {.
|
||||||
importc: "godot_vector2_angle_to", header: "godot_vector2.h".}
|
importc: "godot_vector2_angle_to", header: "godot/vector2.h".}
|
||||||
proc angleToPoint*(self, to: Vector2): float32 {.
|
proc angleToPoint*(self, to: Vector2): float32 {.
|
||||||
importc: "godot_vector2_angle_to_point",
|
importc: "godot_vector2_angle_to_point",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc lerp*(self, b: Vector2; t: float32): Vector2 {.
|
proc lerp*(self, b: Vector2; t: float32): Vector2 {.
|
||||||
importc: "godot_vector2_linear_interpolate",
|
importc: "godot_vector2_linear_interpolate",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc cubicInterpolate*(self, b, pre_a, post_b: Vector2; t: float32): Vector2 {.
|
proc cubicInterpolate*(self, b, pre_a, post_b: Vector2; t: float32): Vector2 {.
|
||||||
importc: "godot_vector2_cubic_interpolate",
|
importc: "godot_vector2_cubic_interpolate",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc rotated*(self: Vector2; phi: float32): Vector2 {.
|
proc rotated*(self: Vector2; phi: float32): Vector2 {.
|
||||||
importc: "godot_vector2_rotated", header: "godot_vector2.h".}
|
importc: "godot_vector2_rotated", header: "godot/vector2.h".}
|
||||||
proc tangent*(self: Vector2): Vector2 {.
|
proc tangent*(self: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_tangent", header: "godot_vector2.h".}
|
importc: "godot_vector2_tangent", header: "godot/vector2.h".}
|
||||||
proc floor*(self: Vector2): Vector2 {.
|
proc floor*(self: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_floor", header: "godot_vector2.h".}
|
importc: "godot_vector2_floor", header: "godot/vector2.h".}
|
||||||
proc snapped*(self: Vector2; by: Vector2): Vector2 {.
|
proc snapped*(self: Vector2; by: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_snapped", header: "godot_vector2.h".}
|
importc: "godot_vector2_snapped", header: "godot/vector2.h".}
|
||||||
proc aspect*(self: Vector2): float32 {.
|
proc aspect*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_aspect", header: "godot_vector2.h".}
|
importc: "godot_vector2_aspect", header: "godot/vector2.h".}
|
||||||
proc dot*(a, b: Vector2): float32 {.
|
proc dot*(a, b: Vector2): float32 {.
|
||||||
importc: "godot_vector2_dot", header: "godot_vector2.h".}
|
importc: "godot_vector2_dot", header: "godot/vector2.h".}
|
||||||
proc slide*(self, n: Vector2): Vector2 {.
|
proc slide*(self, n: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_slide", header: "godot_vector2.h".}
|
importc: "godot_vector2_slide", header: "godot/vector2.h".}
|
||||||
proc bounce*(self, n: Vector2): Vector2 {.
|
proc bounce*(self, n: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_bounce", header: "godot_vector2.h".}
|
importc: "godot_vector2_bounce", header: "godot/vector2.h".}
|
||||||
proc reflect*(self, n: Vector2): Vector2 {.
|
proc reflect*(self, n: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_reflect", header: "godot_vector2.h".}
|
importc: "godot_vector2_reflect", header: "godot/vector2.h".}
|
||||||
proc abs*(self: Vector2): Vector2 {.
|
proc abs*(self: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_abs", header: "godot_vector2.h".}
|
importc: "godot_vector2_abs", header: "godot/vector2.h".}
|
||||||
proc clamped*(self: Vector2; length: float32): Vector2 {.
|
proc clamped*(self: Vector2; length: float32): Vector2 {.
|
||||||
importc: "godot_vector2_clamped", header: "godot_vector2.h".}
|
importc: "godot_vector2_clamped", header: "godot/vector2.h".}
|
||||||
|
|
||||||
proc `+`*(a, b: Vector2): Vector2 {.
|
proc `+`*(a, b: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_operator_add", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_add", header: "godot/vector2.h".}
|
||||||
proc `+=`*(a: var Vector2, b: Vector2) {.inline.} =
|
proc `+=`*(a: var Vector2, b: Vector2) {.inline.} =
|
||||||
a += b
|
a += b
|
||||||
|
|
||||||
proc `-`*(a, b: Vector2): Vector2 {.
|
proc `-`*(a, b: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_operator_substract", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_substract", header: "godot/vector2.h".}
|
||||||
proc `-=`*(a: var Vector2, b: Vector2) {.inline.} =
|
proc `-=`*(a: var Vector2, b: Vector2) {.inline.} =
|
||||||
a = a - b
|
a = a - b
|
||||||
|
|
||||||
proc `*`*(a, b: Vector2): Vector2 {.
|
proc `*`*(a, b: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_operator_multiply_vector",
|
importc: "godot_vector2_operator_multiply_vector",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
|
|
||||||
proc `*=`*(a: var Vector2, b: Vector2) {.inline.} =
|
proc `*=`*(a: var Vector2, b: Vector2) {.inline.} =
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
||||||
proc `*`*(self: Vector2, scalar: float32): Vector2 {.
|
proc `*`*(self: Vector2, scalar: float32): Vector2 {.
|
||||||
importc: "godot_vector2_operator_multiply_scalar",
|
importc: "godot_vector2_operator_multiply_scalar",
|
||||||
header: "godot_vector2.h".}
|
header: "godot/vector2.h".}
|
||||||
proc `*=`*(self: var Vector2, scalar: float32) {.inline.} =
|
proc `*=`*(self: var Vector2, scalar: float32) {.inline.} =
|
||||||
self = self * scalar
|
self = self * scalar
|
||||||
|
|
||||||
proc `/`*(a, b: Vector2): Vector2 {.
|
proc `/`*(a, b: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_operator_divide_vector", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_divide_vector", header: "godot/vector2.h".}
|
||||||
proc `/=`*(a: var Vector2, b: Vector2) {.inline.} =
|
proc `/=`*(a: var Vector2, b: Vector2) {.inline.} =
|
||||||
a = a / b
|
a = a / b
|
||||||
|
|
||||||
proc `/`*(self: Vector2; scalar: float32): Vector2 {.
|
proc `/`*(self: Vector2; scalar: float32): Vector2 {.
|
||||||
importc: "godot_vector2_operator_divide_scalar", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_divide_scalar", header: "godot/vector2.h".}
|
||||||
proc `/=`*(self: var Vector2; scalar: float32) {.inline.} =
|
proc `/=`*(self: var Vector2; scalar: float32) {.inline.} =
|
||||||
self = self / scalar
|
self = self / scalar
|
||||||
|
|
||||||
proc `==`*(a, b: Vector2): bool {.
|
proc `==`*(a, b: Vector2): bool {.
|
||||||
importc: "godot_vector2_operator_equal", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_equal", header: "godot/vector2.h".}
|
||||||
proc `<`*(a, b: Vector2): bool {.
|
proc `<`*(a, b: Vector2): bool {.
|
||||||
importc: "godot_vector2_operator_less", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_less", header: "godot/vector2.h".}
|
||||||
proc `-`*(self: Vector2): Vector2 {.
|
proc `-`*(self: Vector2): Vector2 {.
|
||||||
importc: "godot_vector2_operator_neg", header: "godot_vector2.h".}
|
importc: "godot_vector2_operator_neg", header: "godot/vector2.h".}
|
||||||
|
|
||||||
proc `x=`*(self: var Vector2; x: float32) {.
|
proc `x=`*(self: var Vector2; x: float32) {.
|
||||||
importc: "godot_vector2_set_x", header: "godot_vector2.h".}
|
importc: "godot_vector2_set_x", header: "godot/vector2.h".}
|
||||||
proc `y=`*(self: var Vector2; y: float32) {.
|
proc `y=`*(self: var Vector2; y: float32) {.
|
||||||
importc: "godot_vector2_set_y", header: "godot_vector2.h".}
|
importc: "godot_vector2_set_y", header: "godot/vector2.h".}
|
||||||
proc x*(self: Vector2): float32 {.
|
proc x*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_get_x", header: "godot_vector2.h".}
|
importc: "godot_vector2_get_x", header: "godot/vector2.h".}
|
||||||
proc y*(self: Vector2): float32 {.
|
proc y*(self: Vector2): float32 {.
|
||||||
importc: "godot_vector2_get_y", header: "godot_vector2.h".}
|
importc: "godot_vector2_get_y", header: "godot/vector2.h".}
|
||||||
|
|
|
||||||
|
|
@ -1,126 +1,126 @@
|
||||||
# Copyright (c) 2017 Xored Software, Inc.
|
# Copyright (c) 2017 Xored Software, Inc.
|
||||||
|
|
||||||
type
|
type
|
||||||
Vector3* {.importc: "godot_vector3", header: "godot_vector3.h",
|
Vector3* {.importc: "godot_vector3", header: "godot/vector3.h",
|
||||||
byref.} = object
|
byref.} = object
|
||||||
|
|
||||||
import godotbase, basis, strings
|
import godotbase, basis, strings
|
||||||
|
|
||||||
type
|
type
|
||||||
Vector3Axis {.importc: "godot_vector3_axis", header: "godot_vector3.h",
|
Vector3Axis {.importc: "godot_vector3_axis", header: "godot/vector3.h",
|
||||||
size: sizeof(cint), pure.} = enum
|
size: sizeof(cint), pure.} = enum
|
||||||
X,
|
X,
|
||||||
Y,
|
Y,
|
||||||
Z
|
Z
|
||||||
|
|
||||||
proc initVector3*(dest: var Vector3; x, y, z: float32) {.
|
proc initVector3*(dest: var Vector3; x, y, z: float32) {.
|
||||||
importc: "godot_vector3_new", header: "godot_vector3.h".}
|
importc: "godot_vector3_new", header: "godot/vector3.h".}
|
||||||
|
|
||||||
proc vec3*(x, y, z: float32): Vector3 {.inline.} =
|
proc vec3*(x, y, z: float32): Vector3 {.inline.} =
|
||||||
initVector3(result, x, y, z)
|
initVector3(result, x, y, z)
|
||||||
|
|
||||||
proc toGodotString*(self: Vector3): GodotString {.
|
proc toGodotString*(self: Vector3): GodotString {.
|
||||||
importc: "godot_vector3_as_string", header: "godot_vector3.h".}
|
importc: "godot_vector3_as_string", header: "godot/vector3.h".}
|
||||||
proc `$`*(self: Vector3): string {.inline.} =
|
proc `$`*(self: Vector3): string {.inline.} =
|
||||||
$self.toGodotString()
|
$self.toGodotString()
|
||||||
|
|
||||||
proc minAxis*(self: Vector3): cint {.
|
proc minAxis*(self: Vector3): cint {.
|
||||||
importc: "godot_vector3_min_axis", header: "godot_vector3.h".}
|
importc: "godot_vector3_min_axis", header: "godot/vector3.h".}
|
||||||
proc maxAxis*(self: Vector3): cint {.
|
proc maxAxis*(self: Vector3): cint {.
|
||||||
importc: "godot_vector3_max_axis", header: "godot_vector3.h".}
|
importc: "godot_vector3_max_axis", header: "godot/vector3.h".}
|
||||||
proc length*(self: Vector3): float32 {.
|
proc length*(self: Vector3): float32 {.
|
||||||
importc: "godot_vector3_length", header: "godot_vector3.h".}
|
importc: "godot_vector3_length", header: "godot/vector3.h".}
|
||||||
proc lengthSquared*(self: Vector3): float32 {.
|
proc lengthSquared*(self: Vector3): float32 {.
|
||||||
importc: "godot_vector3_length_squared", header: "godot_vector3.h".}
|
importc: "godot_vector3_length_squared", header: "godot/vector3.h".}
|
||||||
proc isNormalized*(self: Vector3): bool {.
|
proc isNormalized*(self: Vector3): bool {.
|
||||||
importc: "godot_vector3_is_normalized", header: "godot_vector3.h".}
|
importc: "godot_vector3_is_normalized", header: "godot/vector3.h".}
|
||||||
proc normalized*(self: Vector3): Vector3 {.
|
proc normalized*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_normalized", header: "godot_vector3.h".}
|
importc: "godot_vector3_normalized", header: "godot/vector3.h".}
|
||||||
proc inverse*(self: Vector3): Vector3 {.
|
proc inverse*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_inverse", header: "godot_vector3.h".}
|
importc: "godot_vector3_inverse", header: "godot/vector3.h".}
|
||||||
proc snapped*(self: Vector3; by: float32): Vector3 {.
|
proc snapped*(self: Vector3; by: float32): Vector3 {.
|
||||||
importc: "godot_vector3_snapped", header: "godot_vector3.h".}
|
importc: "godot_vector3_snapped", header: "godot/vector3.h".}
|
||||||
proc rotated*(self: Vector3; axis: Vector3;
|
proc rotated*(self: Vector3; axis: Vector3;
|
||||||
phi: float32): Vector3 {.
|
phi: float32): Vector3 {.
|
||||||
importc: "godot_vector3_rotated", header: "godot_vector3.h".}
|
importc: "godot_vector3_rotated", header: "godot/vector3.h".}
|
||||||
proc lerp*(self: Vector3; b: Vector3; t: float32): Vector3 {.
|
proc lerp*(self: Vector3; b: Vector3; t: float32): Vector3 {.
|
||||||
importc: "godot_vector3_linear_interpolate", header: "godot_vector3.h".}
|
importc: "godot_vector3_linear_interpolate", header: "godot/vector3.h".}
|
||||||
proc cubicInterpolate*(self, b, preA, postB: Vector3;
|
proc cubicInterpolate*(self, b, preA, postB: Vector3;
|
||||||
t: float32): Vector3 {.
|
t: float32): Vector3 {.
|
||||||
importc: "godot_vector3_cubic_interpolate", header: "godot_vector3.h".}
|
importc: "godot_vector3_cubic_interpolate", header: "godot/vector3.h".}
|
||||||
proc dot*(a, b: Vector3): float32 {.
|
proc dot*(a, b: Vector3): float32 {.
|
||||||
importc: "godot_vector3_dot", header: "godot_vector3.h".}
|
importc: "godot_vector3_dot", header: "godot/vector3.h".}
|
||||||
proc cross*(a, b: Vector3): Vector3 {.
|
proc cross*(a, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_cross", header: "godot_vector3.h".}
|
importc: "godot_vector3_cross", header: "godot/vector3.h".}
|
||||||
proc outer*(a, b: Vector3): Basis {.
|
proc outer*(a, b: Vector3): Basis {.
|
||||||
importc: "godot_vector3_outer", header: "godot_vector3.h".}
|
importc: "godot_vector3_outer", header: "godot/vector3.h".}
|
||||||
proc toDiagonalMatrix*(self: Vector3): Basis {.
|
proc toDiagonalMatrix*(self: Vector3): Basis {.
|
||||||
importc: "godot_vector3_to_diagonal_matrix", header: "godot_vector3.h".}
|
importc: "godot_vector3_to_diagonal_matrix", header: "godot/vector3.h".}
|
||||||
proc abs*(self: Vector3): Vector3 {.
|
proc abs*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_abs", header: "godot_vector3.h".}
|
importc: "godot_vector3_abs", header: "godot/vector3.h".}
|
||||||
proc floor*(self: Vector3): Vector3 {.
|
proc floor*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_floor", header: "godot_vector3.h".}
|
importc: "godot_vector3_floor", header: "godot/vector3.h".}
|
||||||
proc ceil*(self: Vector3): Vector3 {.
|
proc ceil*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_ceil", header: "godot_vector3.h".}
|
importc: "godot_vector3_ceil", header: "godot/vector3.h".}
|
||||||
proc distanceTo*(a, b: Vector3): float32 {.
|
proc distanceTo*(a, b: Vector3): float32 {.
|
||||||
importc: "godot_vector3_distance_to", header: "godot_vector3.h".}
|
importc: "godot_vector3_distance_to", header: "godot/vector3.h".}
|
||||||
proc distanceSquaredTo*(a, b: Vector3): float32 {.
|
proc distanceSquaredTo*(a, b: Vector3): float32 {.
|
||||||
importc: "godot_vector3_distance_squared_to", header: "godot_vector3.h".}
|
importc: "godot_vector3_distance_squared_to", header: "godot/vector3.h".}
|
||||||
proc angleTo*(self, to: Vector3): float32 {.
|
proc angleTo*(self, to: Vector3): float32 {.
|
||||||
importc: "godot_vector3_angle_to", header: "godot_vector3.h".}
|
importc: "godot_vector3_angle_to", header: "godot/vector3.h".}
|
||||||
proc slide*(self, n: Vector3): Vector3 {.
|
proc slide*(self, n: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_slide", header: "godot_vector3.h".}
|
importc: "godot_vector3_slide", header: "godot/vector3.h".}
|
||||||
proc bounce*(self, n: Vector3): Vector3 {.
|
proc bounce*(self, n: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_bounce", header: "godot_vector3.h".}
|
importc: "godot_vector3_bounce", header: "godot/vector3.h".}
|
||||||
proc reflect*(self, b: Vector3): Vector3 {.
|
proc reflect*(self, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_reflect", header: "godot_vector3.h".}
|
importc: "godot_vector3_reflect", header: "godot/vector3.h".}
|
||||||
|
|
||||||
proc `+`*(a, b: Vector3): Vector3 {.
|
proc `+`*(a, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_operator_add", header: "godot_vector3.h".}
|
importc: "godot_vector3_operator_add", header: "godot/vector3.h".}
|
||||||
proc `+=`*(a: var Vector3, b: Vector3) {.inline.} =
|
proc `+=`*(a: var Vector3, b: Vector3) {.inline.} =
|
||||||
a = a + b
|
a = a + b
|
||||||
|
|
||||||
proc `-`*(a, b: Vector3): Vector3 {.
|
proc `-`*(a, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_operator_substract", header: "godot_vector3.h".}
|
importc: "godot_vector3_operator_substract", header: "godot/vector3.h".}
|
||||||
proc `-=`*(a: var Vector3, b: Vector3) {.inline.} =
|
proc `-=`*(a: var Vector3, b: Vector3) {.inline.} =
|
||||||
a = a - b
|
a = a - b
|
||||||
|
|
||||||
proc `*`*(a, b: Vector3): Vector3 {.
|
proc `*`*(a, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_operator_multiply_vector",
|
importc: "godot_vector3_operator_multiply_vector",
|
||||||
header: "godot_vector3.h".}
|
header: "godot/vector3.h".}
|
||||||
proc `*=`*(a: var Vector3, b: Vector3) {.inline.}=
|
proc `*=`*(a: var Vector3, b: Vector3) {.inline.}=
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
||||||
proc `*`*(self: Vector3; b: float32): Vector3 {.
|
proc `*`*(self: Vector3; b: float32): Vector3 {.
|
||||||
importc: "godot_vector3_operator_multiply_scalar",
|
importc: "godot_vector3_operator_multiply_scalar",
|
||||||
header: "godot_vector3.h".}
|
header: "godot/vector3.h".}
|
||||||
proc `*=`*(a: var Vector3; b: float32) {.inline.} =
|
proc `*=`*(a: var Vector3; b: float32) {.inline.} =
|
||||||
a = a * b
|
a = a * b
|
||||||
|
|
||||||
proc `/`*(a, b: Vector3): Vector3 {.
|
proc `/`*(a, b: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_operator_divide_vector",
|
importc: "godot_vector3_operator_divide_vector",
|
||||||
header: "godot_vector3.h".}
|
header: "godot/vector3.h".}
|
||||||
proc `/=`*(a: var Vector3; b: Vector3) {.inline.} =
|
proc `/=`*(a: var Vector3; b: Vector3) {.inline.} =
|
||||||
a = a / b
|
a = a / b
|
||||||
|
|
||||||
proc `/`*(self: Vector3; b: float32): Vector3 {.
|
proc `/`*(self: Vector3; b: float32): Vector3 {.
|
||||||
importc: "godot_vector3_operator_divide_scalar",
|
importc: "godot_vector3_operator_divide_scalar",
|
||||||
header: "godot_vector3.h".}
|
header: "godot/vector3.h".}
|
||||||
proc `/=`*(a: var Vector3; b: float32) {.inline.} =
|
proc `/=`*(a: var Vector3; b: float32) {.inline.} =
|
||||||
a = a / b
|
a = a / b
|
||||||
|
|
||||||
proc `==`*(a, b: Vector3): bool {.
|
proc `==`*(a, b: Vector3): bool {.
|
||||||
importc: "godot_vector3_operator_equal", header: "godot_vector3.h".}
|
importc: "godot_vector3_operator_equal", header: "godot/vector3.h".}
|
||||||
proc `<`*(a, b: Vector3): bool {.
|
proc `<`*(a, b: Vector3): bool {.
|
||||||
importc: "godot_vector3_operator_less", header: "godot_vector3.h".}
|
importc: "godot_vector3_operator_less", header: "godot/vector3.h".}
|
||||||
proc `-`*(self: Vector3): Vector3 {.
|
proc `-`*(self: Vector3): Vector3 {.
|
||||||
importc: "godot_vector3_operator_neg", header: "godot_vector3.h".}
|
importc: "godot_vector3_operator_neg", header: "godot/vector3.h".}
|
||||||
|
|
||||||
proc setAxis(self: var Vector3; axis: Vector3Axis;
|
proc setAxis(self: var Vector3; axis: Vector3Axis;
|
||||||
val: float32) {.
|
val: float32) {.
|
||||||
importc: "godot_vector3_set_axis", header: "godot_vector3.h".}
|
importc: "godot_vector3_set_axis", header: "godot/vector3.h".}
|
||||||
proc getAxis(self: Vector3; axis: Vector3Axis): float32 {.
|
proc getAxis(self: Vector3; axis: Vector3Axis): float32 {.
|
||||||
importc: "godot_vector3_get_axis", header: "godot_vector3.h".}
|
importc: "godot_vector3_get_axis", header: "godot/vector3.h".}
|
||||||
|
|
||||||
proc `[]`(self: Vector3, idx: range[0..2]): float32 {.inline.} =
|
proc `[]`(self: Vector3, idx: range[0..2]): float32 {.inline.} =
|
||||||
self.getAxis(Vector3Axis(idx))
|
self.getAxis(Vector3Axis(idx))
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ template registerGodotClass(classNameIdent, classNameLit,
|
||||||
destroyFunc: nimDestroyFunc
|
destroyFunc: nimDestroyFunc
|
||||||
)
|
)
|
||||||
registerClass(classNameIdent, classNameLit, false)
|
registerClass(classNameIdent, classNameLit, false)
|
||||||
godotScriptRegisterClass(classNameLit, baseNameLit,
|
godotScriptRegisterClass(getNativeLibHandle(), classNameLit, baseNameLit,
|
||||||
createFuncObj, destroyFuncObj)
|
createFuncObj, destroyFuncObj)
|
||||||
|
|
||||||
template registerGodotField(classNameLit, classNameIdent, propNameLit,
|
template registerGodotField(classNameLit, classNameIdent, propNameLit,
|
||||||
|
|
@ -325,7 +325,7 @@ template registerGodotField(classNameLit, classNameIdent, propNameLit,
|
||||||
)
|
)
|
||||||
when hasDefaultValue:
|
when hasDefaultValue:
|
||||||
attr.defaultValue = (defaultValueNode).toGodot()
|
attr.defaultValue = (defaultValueNode).toGodot()
|
||||||
godotScriptRegisterProperty(classNameLit, propNameLit,
|
godotScriptRegisterProperty(getNativeLibHandle(), classNameLit, propNameLit,
|
||||||
attr, setFunc, getFunc)
|
attr, setFunc, getFunc)
|
||||||
static:
|
static:
|
||||||
import strutils
|
import strutils
|
||||||
|
|
@ -440,7 +440,7 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
|
||||||
let meth = GodotInstanceMethod(
|
let meth = GodotInstanceMethod(
|
||||||
meth: methFuncIdent
|
meth: methFuncIdent
|
||||||
)
|
)
|
||||||
godotScriptRegisterMethod(classNameLit, methodNameLit,
|
godotScriptRegisterMethod(getNativeLibHandle(), classNameLit, methodNameLit,
|
||||||
GodotMethodAttributes(), meth)
|
GodotMethodAttributes(), meth)
|
||||||
|
|
||||||
for meth in obj.methods:
|
for meth in obj.methods:
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ proc `as`*[T: NimGodotObject](obj: NimGodotObject, t: typedesc[T]): T =
|
||||||
result = T(obj)
|
result = T(obj)
|
||||||
|
|
||||||
proc getSingletonGodot*(name: cstring): ptr GodotObject {.
|
proc getSingletonGodot*(name: cstring): ptr GodotObject {.
|
||||||
importc: "godot_global_get_singleton", header: "../godot.h".}
|
importc: "godot_global_get_singleton", header: "godot/gdnative.h".}
|
||||||
|
|
||||||
proc newRStrLit(s: string): NimNode {.compileTime.} =
|
proc newRStrLit(s: string): NimNode {.compileTime.} =
|
||||||
result = newNimNode(nnkRStrLit)
|
result = newNimNode(nnkRStrLit)
|
||||||
|
|
@ -175,25 +175,6 @@ proc gdnew*[T: NimGodotObject](): T =
|
||||||
if obj.isNil:
|
if obj.isNil:
|
||||||
printError("godot_new returned nil for type " & $godotName)
|
printError("godot_new returned nil for type " & $godotName)
|
||||||
result = asNimGodotObject[T](obj)
|
result = asNimGodotObject[T](obj)
|
||||||
# const godotName = toGodotName(T)
|
|
||||||
# let objInfo = classRegistry.getOrDefault(godotName)
|
|
||||||
# if objInfo.constructor.isNil:
|
|
||||||
# printError("gdnew invoked on unregistered class: " & $godotName)
|
|
||||||
# return
|
|
||||||
# let godotConstructor = getClassConstructor(
|
|
||||||
# if objInfo.isNative: godotName else: objInfo.baseNativeClass)
|
|
||||||
# printError("Base native class for " & T.name & ": " & $objInfo.baseNativeClass)
|
|
||||||
# when not defined(release):
|
|
||||||
# if godotConstructor.isNil:
|
|
||||||
# printError("Failed to obtain Godot constrcutor for type: " & $godotName)
|
|
||||||
# return
|
|
||||||
# let godotObject = godotConstructor()
|
|
||||||
# when not defined(release):
|
|
||||||
# if godotObject.isNil:
|
|
||||||
# printError("Godot constructor returned nil - must never happen")
|
|
||||||
# return
|
|
||||||
# new(result, godotFinalizer[T])
|
|
||||||
# result.setGodotObject(godotObject)
|
|
||||||
|
|
||||||
proc newCallError*(err: VariantCallError): ref CallError =
|
proc newCallError*(err: VariantCallError): ref CallError =
|
||||||
let msg = case err.error:
|
let msg = case err.error:
|
||||||
|
|
@ -511,9 +492,14 @@ void NimMain(void);
|
||||||
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
|
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
|
||||||
""".}
|
""".}
|
||||||
|
|
||||||
const stackIncreases = defined(emscripten)
|
var nativeLibHandle: pointer
|
||||||
|
proc getNativeLibHandle*(): pointer =
|
||||||
|
return nativeLibHandle
|
||||||
|
|
||||||
|
proc godot_nativescript_init(handle: pointer) {.
|
||||||
|
cdecl, exportc, dynlib.} =
|
||||||
|
nativeLibHandle = handle
|
||||||
|
|
||||||
proc godot_native_init() {.cdecl, exportc, dynlib.} =
|
|
||||||
let stackBottom = godotStackBottom()
|
let stackBottom = godotStackBottom()
|
||||||
{.emit: """
|
{.emit: """
|
||||||
NimMain();
|
NimMain();
|
||||||
|
|
@ -522,5 +508,10 @@ proc godot_native_init() {.cdecl, exportc, dynlib.} =
|
||||||
GC_fullCollect()
|
GC_fullCollect()
|
||||||
GC_disable()
|
GC_disable()
|
||||||
|
|
||||||
proc godot_native_terminate() {.cdecl, exportc, dynlib.} =
|
proc godot_gdnative_init(options: ptr GodotNativeInitOptions) {.
|
||||||
|
cdecl, exportc, dynlib.} =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
proc godot_gdnative_terminate(options: ptr GodotNativeTerminateOptions) {.
|
||||||
|
cdecl, exportc, dynlib.} =
|
||||||
|
deallocHeap()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue