From bf5bd54356931e0e3baed793501cd4eb2377b450 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Mon, 20 Nov 2017 06:52:37 +0700 Subject: [PATCH] Rename Rect3 to AABB to sync with Godot --- docs/index.rst | 2 +- godot.nimble | 2 +- godot/core/aabb.nim | 73 ++++++++++ godot/core/godotcoretypes.nim | 2 +- godot/core/rect3.nim | 73 ---------- godot/core/transforms.nim | 8 +- godot/core/variants.nim | 10 +- godot/gdnativeapi.nim | 192 +++++++++++++------------- godot/godot.nim | 4 +- godot/godotapigen.nim | 2 +- godot/internal/godotinternaltypes.nim | 2 +- godot/internal/godotvariants.nim | 8 +- godot/nim/godotnim.nim | 12 +- 13 files changed, 195 insertions(+), 195 deletions(-) create mode 100644 godot/core/aabb.nim delete mode 100644 godot/core/rect3.nim diff --git a/docs/index.rst b/docs/index.rst index 320e99a..a1607f6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -152,7 +152,7 @@ exported and you don't have to import any of them directly. * `quats `_ Defines ``Quat`` (quaternion) describing object rotation in 3D space. * `rect2 `_ Defines ``Rect2`` - a 2D rectangle. -* `rect3 `_ Defines ``Rect3`` - a 3D box. +* `aabb `_ Defines ``AABB`` - a 3D box. * `rids `_ Defines ``RID`` - a resource identifier. * `transform2d `_ Defines ``Transform2D``. * `transforms `_ Defines ``Transform``. diff --git a/godot.nimble b/godot.nimble index 1349055..72b93a8 100644 --- a/godot.nimble +++ b/godot.nimble @@ -1,4 +1,4 @@ -version = "0.6.4" +version = "0.6.5" author = "Xored Software, Inc." description = "Godot Engine bindings" license = "MIT" diff --git a/godot/core/aabb.nim b/godot/core/aabb.nim new file mode 100644 index 0000000..5892081 --- /dev/null +++ b/godot/core/aabb.nim @@ -0,0 +1,73 @@ +# Copyright (c) 2017 Xored Software, Inc. + +import internal.godotinternaltypes, internal.godotstrings +import godotcoretypes, gdnativeapi + +proc initAABB*(pos, size: Vector3): AABB {.inline.} = + AABB(position: pos, size: size) + +proc `$`*(self: AABB): string {.inline.} = + $getGDNativeAPI().aabbAsString(self) + +proc area*(self: AABB): float32 {.inline.} = + getGDNativeAPI().aabbGetArea(self) + +proc hasNoArea*(self: AABB): bool {.inline.} = + getGDNativeAPI().aabbHasNoArea(self) + +proc hasNoSurface*(self: AABB): bool {.inline.} = + getGDNativeAPI().aabbHasNoSurface(self) + +proc intersects*(self, other: AABB): bool {.inline.} = + getGDNativeAPI().aabbIntersects(self, other) + +proc encloses*(self, other: AABB): bool {.inline.} = + getGDNativeAPI().aabbEncloses(self, other) + +proc merge*(self, other: AABB): AABB {.inline.} = + getGDNativeAPI().aabbMerge(self, other) + +proc intersection*(self, other: AABB): AABB {.inline.} = + getGDNativeAPI().aabbIntersection(self, other) + +proc intersectsPlane*(self: AABB; plane: Plane): bool {.inline.} = + getGDNativeAPI().aabbIntersectsPlane(self, plane) + +proc intersectsSegment*(self: AABB; start, to: Vector3): bool {.inline.} = + getGDNativeAPI().aabbIntersectsSegment(self, start, to) + +proc contains*(self: AABB; point: Vector3): bool {.inline.} = + getGDNativeAPI().aabbHasPoint(self, point) + +proc getSupport*(self: AABB; dir: Vector3): Vector3 {.inline.} = + getGDNativeAPI().aabbGetSupport(self, dir) + +proc getLongestAxis*(self: AABB): Vector3 {.inline.} = + getGDNativeAPI().aabbGetLongestAxis(self) + +proc getLongestAxisIndex*(self: AABB): cint {.inline.} = + getGDNativeAPI().aabbGetLongestAxisIndex(self) + +proc getLongestAxisSize*(self: AABB): float32 {.inline.} = + getGDNativeAPI().aabbGetLongestAxisSize(self) + +proc getShortestAxis*(self: AABB): Vector3 {.inline.} = + getGDNativeAPI().aabbGetShortestAxis(self) + +proc getShortestAxisIndex*(self: AABB): cint {.inline.} = + getGDNativeAPI().aabbGetShortestAxisIndex(self) + +proc getShortestAxisSize*(self: AABB): float32 {.inline.} = + getGDNativeAPI().aabbGetShortestAxisSize(self) + +proc expand*(self: AABB; toPoint: Vector3): AABB {.inline.} = + getGDNativeAPI().aabbExpand(self, toPoint) + +proc grow*(self: AABB; by: float32): AABB {.inline.} = + getGDNativeAPI().aabbGrow(self, by) + +proc getEndpoint*(self: AABB; idx: cint): Vector3 {.inline.} = + getGDNativeAPI().aabbGetEndpoint(self, idx) + +proc `==`*(a, b: AABB): bool {.inline.} = + getGDNativeAPI().aabbOperatorEqual(a, b) diff --git a/godot/core/godotcoretypes.nim b/godot/core/godotcoretypes.nim index 8b92407..cc5da9e 100644 --- a/godot/core/godotcoretypes.nim +++ b/godot/core/godotcoretypes.nim @@ -29,7 +29,7 @@ type z*: float32 w*: float32 - Rect3* {.byref.} = object + AABB* {.byref.} = object position*: Vector3 size*: Vector3 diff --git a/godot/core/rect3.nim b/godot/core/rect3.nim deleted file mode 100644 index dc2f2c2..0000000 --- a/godot/core/rect3.nim +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (c) 2017 Xored Software, Inc. - -import internal.godotinternaltypes, internal.godotstrings -import godotcoretypes, gdnativeapi - -proc initRect3*(pos, size: Vector3): Rect3 {.inline.} = - Rect3(position: pos, size: size) - -proc `$`*(self: Rect3): string {.inline.} = - $getGDNativeAPI().rect3AsString(self) - -proc area*(self: Rect3): float32 {.inline.} = - getGDNativeAPI().rect3GetArea(self) - -proc hasNoArea*(self: Rect3): bool {.inline.} = - getGDNativeAPI().rect3HasNoArea(self) - -proc hasNoSurface*(self: Rect3): bool {.inline.} = - getGDNativeAPI().rect3HasNoSurface(self) - -proc intersects*(self, other: Rect3): bool {.inline.} = - getGDNativeAPI().rect3Intersects(self, other) - -proc encloses*(self, other: Rect3): bool {.inline.} = - getGDNativeAPI().rect3Encloses(self, other) - -proc merge*(self, other: Rect3): Rect3 {.inline.} = - getGDNativeAPI().rect3Merge(self, other) - -proc intersection*(self, other: Rect3): Rect3 {.inline.} = - getGDNativeAPI().rect3Intersection(self, other) - -proc intersectsPlane*(self: Rect3; plane: Plane): bool {.inline.} = - getGDNativeAPI().rect3IntersectsPlane(self, plane) - -proc intersectsSegment*(self: Rect3; start, to: Vector3): bool {.inline.} = - getGDNativeAPI().rect3IntersectsSegment(self, start, to) - -proc contains*(self: Rect3; point: Vector3): bool {.inline.} = - getGDNativeAPI().rect3HasPoint(self, point) - -proc getSupport*(self: Rect3; dir: Vector3): Vector3 {.inline.} = - getGDNativeAPI().rect3GetSupport(self, dir) - -proc getLongestAxis*(self: Rect3): Vector3 {.inline.} = - getGDNativeAPI().rect3GetLongestAxis(self) - -proc getLongestAxisIndex*(self: Rect3): cint {.inline.} = - getGDNativeAPI().rect3GetLongestAxisIndex(self) - -proc getLongestAxisSize*(self: Rect3): float32 {.inline.} = - getGDNativeAPI().rect3GetLongestAxisSize(self) - -proc getShortestAxis*(self: Rect3): Vector3 {.inline.} = - getGDNativeAPI().rect3GetShortestAxis(self) - -proc getShortestAxisIndex*(self: Rect3): cint {.inline.} = - getGDNativeAPI().rect3GetShortestAxisIndex(self) - -proc getShortestAxisSize*(self: Rect3): float32 {.inline.} = - getGDNativeAPI().rect3GetShortestAxisSize(self) - -proc expand*(self: Rect3; toPoint: Vector3): Rect3 {.inline.} = - getGDNativeAPI().rect3Expand(self, toPoint) - -proc grow*(self: Rect3; by: float32): Rect3 {.inline.} = - getGDNativeAPI().rect3Grow(self, by) - -proc getEndpoint*(self: Rect3; idx: cint): Vector3 {.inline.} = - getGDNativeAPI().rect3GetEndpoint(self, idx) - -proc `==`*(a, b: Rect3): bool {.inline.} = - getGDNativeAPI().rect3OperatorEqual(a, b) diff --git a/godot/core/transforms.nim b/godot/core/transforms.nim index f70a1f8..fe43ccb 100644 --- a/godot/core/transforms.nim +++ b/godot/core/transforms.nim @@ -55,11 +55,11 @@ proc xformVector3*(self: Transform; v: Vector3): Vector3 {.inline.} = proc xformInvVector3*(self: Transform; v: Vector3): Vector3 {.inline.} = getGDNativeAPI().transformXformInvVector3(self, v) -proc xformRect3*(self: Transform; rect: Rect3): Rect3 {.inline.} = - getGDNativeAPI().transformXformRect3(self, rect) +proc xformAABB*(self: Transform; rect: AABB): AABB {.inline.} = + getGDNativeAPI().transformXformAABB(self, rect) -proc xformInvRect3*(self: Transform; rect: Rect3): Rect3 {.inline.} = - getGDNativeAPI().transformXformInvRect3(self, rect) +proc xformInvAABB*(self: Transform; rect: AABB): AABB {.inline.} = + getGDNativeAPI().transformXformInvAABB(self, rect) proc `==`*(self: Transform; b: Transform): bool {.inline.} = getGDNativeAPI().transformOperatorEqual(self, b) diff --git a/godot/core/variants.nim b/godot/core/variants.nim index 2dcc8d8..55284a1 100644 --- a/godot/core/variants.nim +++ b/godot/core/variants.nim @@ -80,7 +80,7 @@ proc newVariant*(s: string): Variant {.inline.} = godotStr.deinit() import basis, nodepaths -import planes, quats, rect2, rect3, rids +import planes, quats, rect2, aabb, rids import transforms, transform2d, vector2 import vector3, colors @@ -108,9 +108,9 @@ proc newVariant*(quat: Quat): Variant {.inline.} = new(result, variantFinalizer) initGodotVariant(result.godotVariant, quat) -proc newVariant*(rect3: Rect3): Variant {.inline.} = +proc newVariant*(aabb: AABB): Variant {.inline.} = new(result, variantFinalizer) - initGodotVariant(result.godotVariant, rect3) + initGodotVariant(result.godotVariant, aabb) proc newVariant*(basis: Basis): Variant {.inline.} = new(result, variantFinalizer) @@ -207,8 +207,8 @@ proc asPlane*(self: Variant): Plane = proc asQuat*(self: Variant): Quat = self.godotVariant.asQuat() -proc asRect3*(self: Variant): Rect3 = - self.godotVariant.asRect3() +proc asAABB*(self: Variant): AABB = + self.godotVariant.asAABB() proc asBasis*(self: Variant): Basis = self.godotVariant.asBasis() diff --git a/godot/gdnativeapi.nim b/godot/gdnativeapi.nim index ee7f6ad..64ea7eb 100644 --- a/godot/gdnativeapi.nim +++ b/godot/gdnativeapi.nim @@ -910,65 +910,65 @@ type rect2SetSize: proc (self: var Rect2, size: Vector2) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - # Rect3 API - rect3New: proc (dest: var Rect3, pos, size: Vector3) + # AABB API + aabbNew: proc (dest: var AABB, pos, size: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetPosition: proc (self: Rect3): Vector3 + aabbGetPosition: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3SetPosition: proc (self: var Rect3, pos: Vector3) + aabbSetPosition: proc (self: var AABB, pos: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetSize: proc (self: Rect3): Vector3 + aabbGetSize: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3SetSize: proc (self: var Rect3, pos: Vector3) + aabbSetSize: proc (self: var AABB, pos: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3AsString: proc (self: Rect3): GodotString + aabbAsString: proc (self: AABB): GodotString {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetArea: proc (self: Rect3): float32 + aabbGetArea: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasNoArea: proc (self: Rect3): bool + aabbHasNoArea: proc (self: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasNoSurface: proc (self: Rect3): bool + aabbHasNoSurface: proc (self: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Intersects: proc (self, other: Rect3): bool + aabbIntersects: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Encloses: proc (self, other: Rect3): bool + aabbEncloses: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Merge: proc (self, other: Rect3): Rect3 + aabbMerge: proc (self, other: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Intersection: proc (self, other: Rect3): Rect3 + aabbIntersection: proc (self, other: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3IntersectsPlane: proc (self: Rect3, plane: Plane): bool + aabbIntersectsPlane: proc (self: AABB, plane: Plane): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3IntersectsSegment: proc (self: Rect3, vFrom, vTo: Vector3): bool + aabbIntersectsSegment: proc (self: AABB, vFrom, vTo: Vector3): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasPoint: proc (self: Rect3, point: Vector3): bool + aabbHasPoint: proc (self: AABB, point: Vector3): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetSupport: proc (self: Rect3, dir: Vector3): Vector3 + aabbGetSupport: proc (self: AABB, dir: Vector3): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxis: proc (self: Rect3): Vector3 + aabbGetLongestAxis: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxisIndex: proc (self: Rect3): cint + aabbGetLongestAxisIndex: proc (self: AABB): cint {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxisSize: proc (self: Rect3): float32 + aabbGetLongestAxisSize: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxis: proc (self: Rect3): Vector3 + aabbGetShortestAxis: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxisIndex: proc (self: Rect3): cint + aabbGetShortestAxisIndex: proc (self: AABB): cint {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxisSize: proc (self: Rect3): float32 + aabbGetShortestAxisSize: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Expand: proc (self: Rect3, toPoint: Vector3): Rect3 + aabbExpand: proc (self: AABB, toPoint: Vector3): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Grow: proc (self: Rect3, by: float32): Rect3 + aabbGrow: proc (self: AABB, by: float32): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetEndpoint: proc (self: Rect3, idx: cint): Vector3 + aabbGetEndpoint: proc (self: AABB, idx: cint): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3OperatorEqual: proc (self, other: Rect3): bool + aabbOperatorEqual: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} # RID API @@ -1036,9 +1036,9 @@ type transformXformInvVector3: proc (self: Transform, v: Vector3): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - transformXformRect3: proc (self: Transform, v: Rect3): Rect3 + transformXformAABB: proc (self: Transform, v: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - transformXformInvRect3: proc (self: Transform, v: Rect3): Rect3 + transformXformInvAABB: proc (self: Transform, v: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -1136,7 +1136,7 @@ type {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantNewQuat: proc (dest: var GodotVariant, val: Quat) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - variantNewRect3: proc (dest: var GodotVariant, val: Rect3) + variantNewAABB: proc (dest: var GodotVariant, val: AABB) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantNewBasis: proc (dest: var GodotVariant, val: Basis) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -1203,7 +1203,7 @@ type {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantAsQuat: proc (self: GodotVariant): Quat {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - variantAsRect3: proc (self: GodotVariant): Rect3 + variantAsAABB: proc (self: GodotVariant): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantAsBasis: proc (self: GodotVariant): Basis {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -2176,65 +2176,65 @@ type rect2SetSize*: proc (self: var Rect2, size: Vector2) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - # Rect3 API - rect3New*: proc (dest: var Rect3, pos, size: Vector3) + # AABB API + aabbNew*: proc (dest: var AABB, pos, size: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetPosition*: proc (self: Rect3): Vector3 + aabbGetPosition*: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3SetPosition*: proc (self: var Rect3, pos: Vector3) + aabbSetPosition*: proc (self: var AABB, pos: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetSize*: proc (self: Rect3): Vector3 + aabbGetSize*: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3SetSize*: proc (self: var Rect3, pos: Vector3) + aabbSetSize*: proc (self: var AABB, pos: Vector3) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3AsString*: proc (self: Rect3): GodotString + aabbAsString*: proc (self: AABB): GodotString {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetArea*: proc (self: Rect3): float32 + aabbGetArea*: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasNoArea*: proc (self: Rect3): bool + aabbHasNoArea*: proc (self: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasNoSurface*: proc (self: Rect3): bool + aabbHasNoSurface*: proc (self: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Intersects*: proc (self, other: Rect3): bool + aabbIntersects*: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Encloses*: proc (self, other: Rect3): bool + aabbEncloses*: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Merge*: proc (self, other: Rect3): Rect3 + aabbMerge*: proc (self, other: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Intersection*: proc (self, other: Rect3): Rect3 + aabbIntersection*: proc (self, other: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3IntersectsPlane*: proc (self: Rect3, plane: Plane): bool + aabbIntersectsPlane*: proc (self: AABB, plane: Plane): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3IntersectsSegment*: proc (self: Rect3, vFrom, vTo: Vector3): bool + aabbIntersectsSegment*: proc (self: AABB, vFrom, vTo: Vector3): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3HasPoint*: proc (self: Rect3, point: Vector3): bool + aabbHasPoint*: proc (self: AABB, point: Vector3): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetSupport*: proc (self: Rect3, dir: Vector3): Vector3 + aabbGetSupport*: proc (self: AABB, dir: Vector3): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxis*: proc (self: Rect3): Vector3 + aabbGetLongestAxis*: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxisIndex*: proc (self: Rect3): cint + aabbGetLongestAxisIndex*: proc (self: AABB): cint {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetLongestAxisSize*: proc (self: Rect3): float32 + aabbGetLongestAxisSize*: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxis*: proc (self: Rect3): Vector3 + aabbGetShortestAxis*: proc (self: AABB): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxisIndex*: proc (self: Rect3): cint + aabbGetShortestAxisIndex*: proc (self: AABB): cint {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetShortestAxisSize*: proc (self: Rect3): float32 + aabbGetShortestAxisSize*: proc (self: AABB): float32 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Expand*: proc (self: Rect3, toPoint: Vector3): Rect3 + aabbExpand*: proc (self: AABB, toPoint: Vector3): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3Grow*: proc (self: Rect3, by: float32): Rect3 + aabbGrow*: proc (self: AABB, by: float32): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3GetEndpoint*: proc (self: Rect3, idx: cint): Vector3 + aabbGetEndpoint*: proc (self: AABB, idx: cint): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - rect3OperatorEqual*: proc (self, other: Rect3): bool + aabbOperatorEqual*: proc (self, other: AABB): bool {.noconv, raises: [], gcsafe, tags: [], locks: 0.} # RID API @@ -2302,9 +2302,9 @@ type transformXformInvVector3*: proc (self: Transform, v: Vector3): Vector3 {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - transformXformRect3*: proc (self: Transform, v: Rect3): Rect3 + transformXformAABB*: proc (self: Transform, v: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - transformXformInvRect3*: proc (self: Transform, v: Rect3): Rect3 + transformXformInvAABB*: proc (self: Transform, v: AABB): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -2402,7 +2402,7 @@ type {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantNewQuat*: proc (dest: var GodotVariant, val: Quat) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - variantNewRect3*: proc (dest: var GodotVariant, val: Rect3) + variantNewAABB*: proc (dest: var GodotVariant, val: AABB) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantNewBasis*: proc (dest: var GodotVariant, val: Basis) {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -2469,7 +2469,7 @@ type {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantAsQuat*: proc (self: GodotVariant): Quat {.noconv, raises: [], gcsafe, tags: [], locks: 0.} - variantAsRect3*: proc (self: GodotVariant): Rect3 + variantAsAABB*: proc (self: GodotVariant): AABB {.noconv, raises: [], gcsafe, tags: [], locks: 0.} variantAsBasis*: proc (self: GodotVariant): Basis {.noconv, raises: [], gcsafe, tags: [], locks: 0.} @@ -2953,34 +2953,34 @@ proc setGDNativeAPI*(apiStruct: pointer) {.inline.} = rect2SetPosition rect2SetSize - # Rect3 API - rect3New - rect3GetPosition - rect3SetPosition - rect3GetSize - rect3SetSize - rect3AsString - rect3GetArea - rect3HasNoArea - rect3HasNoSurface - rect3Intersects - rect3Encloses - rect3Merge - rect3Intersection - rect3IntersectsPlane - rect3IntersectsSegment - rect3HasPoint - rect3GetSupport - rect3GetLongestAxis - rect3GetLongestAxisIndex - rect3GetLongestAxisSize - rect3GetShortestAxis - rect3GetShortestAxisIndex - rect3GetShortestAxisSize - rect3Expand - rect3Grow - rect3GetEndpoint - rect3OperatorEqual + # AABB API + aabbNew + aabbGetPosition + aabbSetPosition + aabbGetSize + aabbSetSize + aabbAsString + aabbGetArea + aabbHasNoArea + aabbHasNoSurface + aabbIntersects + aabbEncloses + aabbMerge + aabbIntersection + aabbIntersectsPlane + aabbIntersectsSegment + aabbHasPoint + aabbGetSupport + aabbGetLongestAxis + aabbGetLongestAxisIndex + aabbGetLongestAxisSize + aabbGetShortestAxis + aabbGetShortestAxisIndex + aabbGetShortestAxisSize + aabbExpand + aabbGrow + aabbGetEndpoint + aabbOperatorEqual # RID API ridNew @@ -3011,8 +3011,8 @@ proc setGDNativeAPI*(apiStruct: pointer) {.inline.} = transformOperatorMultiply transformXformVector3 transformXformInvVector3 - transformXformRect3 - transformXformInvRect3 + transformXformAABB + transformXformInvAABB # Transform2D API transform2DNew @@ -3054,7 +3054,7 @@ proc setGDNativeAPI*(apiStruct: pointer) {.inline.} = variantNewPlane variantNewQuat - variantNewRect3 + variantNewAABB variantNewBasis variantNewTransform variantNewColor @@ -3081,7 +3081,7 @@ proc setGDNativeAPI*(apiStruct: pointer) {.inline.} = variantAsTransform2D variantAsPlane variantAsQuat - variantAsRect3 + variantAsAABB variantAsBasis variantAsTransform variantAsColor diff --git a/godot/godot.nim b/godot/godot.nim index bab24f7..d72c4f1 100644 --- a/godot/godot.nim +++ b/godot/godot.nim @@ -4,14 +4,14 @@ import core.godotbase, godotinternal import core.godotcoretypes import core.vector2, core.rect2, core.vector3, core.transform2d, core.planes, core.quats -import core.rect3, core.basis, core.transforms, core.colors, core.nodepaths, +import core.aabb, core.basis, core.transforms, core.colors, core.nodepaths, core.rids import core.dictionaries, core.arrays, core.poolarrays, core.variants import nim.godotmacros, nim.godotnim export godotbase, godotcoretypes, vector2, rect2, vector3, transform2d, planes, - quats, rect3, basis, transforms, colors, nodepaths, rids, dictionaries, + quats, aabb, basis, transforms, colors, nodepaths, rids, dictionaries, arrays, poolarrays, variants export godotmacros, godotnim diff --git a/godot/godotapigen.nim b/godot/godotapigen.nim index 526a1f8..6d12c64 100644 --- a/godot/godotapigen.nim +++ b/godot/godotapigen.nim @@ -274,7 +274,7 @@ const standardTypes = toSet( ["bool", "cint", "int", "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", "float32", "cfloat", "float64", "GodotString", "Vector2", "Rect2", - "Vector3", "Transform2D", "Plane", "Quat", "Rect3", "Basis", "Transform", + "Vector3", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform", "Color", "RID", "NodePath", "Dictionary", "Variant", "Array", "PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray", "PoolVector2Array", "PoolVector3Array", "PoolColorArray"]) diff --git a/godot/internal/godotinternaltypes.nim b/godot/internal/godotinternaltypes.nim index 29b0e00..ba661ad 100644 --- a/godot/internal/godotinternaltypes.nim +++ b/godot/internal/godotinternaltypes.nim @@ -45,7 +45,7 @@ type Transform2D, Plane, Quat, ## 10 - Rect3, + AABB, Basis, Transform, ## misc types Color, diff --git a/godot/internal/godotvariants.nim b/godot/internal/godotvariants.nim index 5e9ebb8..d48e876 100644 --- a/godot/internal/godotvariants.nim +++ b/godot/internal/godotvariants.nim @@ -44,8 +44,8 @@ proc initGodotVariant*(dest: var GodotVariant; plane: Plane) {.inline.} = proc initGodotVariant*(dest: var GodotVariant; quat: Quat) {.inline.} = getGDNativeAPI().variantNewQuat(dest, quat) -proc initGodotVariant*(dest: var GodotVariant; rect3: Rect3) {.inline.} = - getGDNativeAPI().variantNewRect3(dest, rect3) +proc initGodotVariant*(dest: var GodotVariant; aabb: AABB) {.inline.} = + getGDNativeAPI().variantNewAABB(dest, aabb) proc initGodotVariant*(dest: var GodotVariant; basis: Basis) {.inline.} = getGDNativeAPI().variantNewBasis(dest, basis) @@ -138,8 +138,8 @@ proc asPlane*(self: GodotVariant): Plane {.inline.} = proc asQuat*(self: GodotVariant): Quat {.inline.} = getGDNativeAPI().variantAsQuat(self) -proc asRect3*(self: GodotVariant): Rect3 {.inline.} = - getGDNativeAPI().variantAsRect3(self) +proc asAABB*(self: GodotVariant): AABB {.inline.} = + getGDNativeAPI().variantAsAABB(self) proc asBasis*(self: GodotVariant): Basis {.inline.} = getGDNativeAPI().variantAsBasis(self) diff --git a/godot/nim/godotnim.nim b/godot/nim/godotnim.nim index 54d8d23..b1c4be5 100644 --- a/godot/nim/godotnim.nim +++ b/godot/nim/godotnim.nim @@ -5,7 +5,7 @@ import gdnativeapi import core.godotcoretypes import core.vector2, core.rect2, core.vector3, core.transform2d, - core.planes, core.quats, core.rect3, + core.planes, core.quats, core.aabb, core.basis, core.transforms, core.colors, core.nodepaths, core.rids, core.dictionaries, core.arrays, core.poolarrays, core.variants @@ -57,7 +57,7 @@ type SomeFloat = float32 or float64 or cfloat SomeGodot = bool or Vector2 or Rect2 or Vector3 or - Transform2D or Plane or Quat or Rect3 or + Transform2D or Plane or Quat or AABB or Basis or Transform or Color or NodePath or RID or GodotObject or Dictionary or Array or PoolByteArray or PoolIntArray or PoolRealArray or @@ -497,8 +497,8 @@ proc godotTypeInfo*(T: typedesc[SomeGodotOrNum]): GodotTypeInfo {.inline.} = VariantType.Plane elif T is Quat: VariantType.Quat - elif T is Rect3: - VariantType.Rect3 + elif T is AABB: + VariantType.AABB elif T is Basis: VariantType.Basis elif T is Transform: @@ -614,8 +614,8 @@ proc fromVariant*[T: SomeGodot](self: var T, val: Variant): ConversionResult = self = val.asPlane() elif self is Quat: self = val.asQuat() - elif self is Rect3: - self = val.asRect3() + elif self is AABB: + self = val.asAABB() elif self is Basis: self = val.asBasis() elif self is Transform: