Implement hash proc for Godot types
This commit is contained in:
parent
4eb771e9be
commit
76de026b4f
15 changed files with 139 additions and 38 deletions
|
|
@ -1,8 +1,10 @@
|
|||
# Copyright (c) 2018 Xored Software, Inc.
|
||||
|
||||
import hashes
|
||||
|
||||
import internal.godotinternaltypes, internal.godotstrings
|
||||
import godotcoretypes, gdnativeapi
|
||||
import basis
|
||||
import basis, vector3
|
||||
|
||||
proc initTransform*(): Transform {.inline.} =
|
||||
result.basis = initBasis()
|
||||
|
|
@ -21,6 +23,9 @@ proc initTransform*(basis: Basis, origin: Vector3): Transform {.inline.} =
|
|||
proc `$`*(self: Transform): string {.inline.} =
|
||||
$getGDNativeAPI().transformAsString(self)
|
||||
|
||||
proc hash*(self: Transform): Hash {.inline.} =
|
||||
!$(self.basis.hash() !& self.origin.hash())
|
||||
|
||||
proc inverse*(self: Transform): Transform {.inline.} =
|
||||
getGDNativeAPI().transformInverse(self)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue