Remove dependency on headers

This commit is contained in:
Ruslan Mustakov 2017-07-27 18:44:23 +07:00
commit 2fd1efcc4e
42 changed files with 1280 additions and 3614 deletions

View file

@ -1,82 +1,64 @@
# Copyright (c) 2017 Xored Software, Inc.
import godotbase, basis, vector3, strings, plane, rect3
type
Transform* {.importc: "godot_transform", header: "godot/transform.h",
byref.} = object
import godotbase, basis, variant, vector3, strings, plane, rect3
proc initTransform(dest: var Transform) {.
importc: "godot_transform_new_identity", header: "godot/transform.h".}
## Initializes the ``dest`` as identity transform.
proc initTransform(dest: var Transform;
xAxis, yAxis, zAxis, origin: Vector3) {.
importc: "godot_transform_new_with_axis_origin",
header: "godot/transform.h".}
proc initTransform(dest: var Transform; basis: Basis;
origin: Vector3) {.
importc: "godot_transform_new",
header: "godot/transform.h".}
Transform* {.byref.} = object
basis*: Basis
origin*: Vector3
proc initTransform*(): Transform {.inline.} =
initTransform(result)
discard
proc initTransform*(xAxis, yAxis, zAxis,
origin: Vector3): Transform {.inline.} =
initTransform(result, xAxis, yAxis, zAxis, origin)
var basis: Basis
basis.setAxis(0, xAxis)
basis.setAxis(1, yAxis)
basis.setAxis(2, zAxis)
Transform(basis: basis, origin: origin)
proc initTransform*(basis: Basis, origin: Vector3): Transform {.inline.} =
initTransform(result, basis, origin)
proc basis*(self: Transform): Basis {.
importc: "godot_transform_get_basis", header: "godot/transform.h".}
proc `basis=`*(self: var Transform; v: Basis) {.
importc: "godot_transform_set_basis", header: "godot/transform.h".}
proc origin*(self: Transform): Vector3 {.
importc: "godot_transform_get_origin", header: "godot/transform.h".}
proc `origin=`*(self: var Transform; v: Vector3) {.
importc: "godot_transform_set_origin", header: "godot/transform.h".}
Transform(basis: basis, origin: origin)
proc toGodotString*(self: Transform): GodotString {.
importc: "godot_transform_as_string", header: "godot/transform.h".}
importc: "godot_transform_as_string".}
proc `$`*(self: Transform): string {.inline.} =
$self.toGodotString()
proc inverse*(self: Transform): Transform {.
importc: "godot_transform_inverse", header: "godot/transform.h".}
importc: "godot_transform_inverse".}
proc affineInverse*(self: Transform): Transform {.
importc: "godot_transform_affine_inverse",
header: "godot/transform.h".}
importc: "godot_transform_affine_inverse".}
proc orthonormalized*(self: Transform): Transform {.
importc: "godot_transform_orthonormalized",
header: "godot/transform.h".}
importc: "godot_transform_orthonormalized".}
proc rotated*(self: Transform; axis: Vector3;
phi: float32): Transform {.
importc: "godot_transform_rotated", header: "godot/transform.h".}
importc: "godot_transform_rotated".}
proc scaled*(self: Transform; scale: Vector3): Transform {.
importc: "godot_transform_scaled", header: "godot/transform.h".}
importc: "godot_transform_scaled".}
proc translated*(self: Transform; offset: Vector3): Transform {.
importc: "godot_transform_translated", header: "godot/transform.h".}
importc: "godot_transform_translated".}
proc lookingAt*(self: Transform;
target, up: Vector3): Transform {.
importc: "godot_transform_looking_at", header: "godot/transform.h".}
importc: "godot_transform_looking_at".}
proc xformPlane*(self: Transform; v: Plane): Plane {.
importc: "godot_transform_xform_plane", header: "godot/transform.h".}
importc: "godot_transform_xform_plane".}
proc xformInvPlane*(self: Transform; v: Plane): Plane {.
importc: "godot_transform_xform_inv_plane", header: "godot/transform.h".}
importc: "godot_transform_xform_inv_plane".}
proc xformVector3*(self: Transform; v: Vector3): Vector3 {.
importc: "godot_transform_xform_vector3", header: "godot/transform.h".}
importc: "godot_transform_xform_vector3".}
proc xformInvVector3*(self: Transform; v: Vector3): Vector3 {.
importc: "godot_transform_xform_inv_vector3", header: "godot/transform.h".}
importc: "godot_transform_xform_inv_vector3".}
proc xformRect3*(self: Transform; v: Vector3): Rect3 {.
importc: "godot_transform_xform_rect3", header: "godot/transform.h".}
importc: "godot_transform_xform_rect3".}
proc xformInvRect3*(self: Transform; v: Vector3): Vector3 {.
importc: "godot_transform_xform_inv_rect3", header: "godot/transform.h".}
importc: "godot_transform_xform_inv_rect3".}
proc `==`*(self: Transform; b: Transform): bool {.
importc: "godot_transform_operator_equal", header: "godot/transform.h".}
importc: "godot_transform_operator_equal".}
proc `*`*(a, b: Transform): Transform {.
importc: "godot_transform_operator_multiply", header: "godot/transform.h".}
importc: "godot_transform_operator_multiply".}
proc `*=`*(a: var Transform, b: Transform) {.inline.} =
a = a * b