Implement hash proc for Godot types

This commit is contained in:
Ruslan Mustakov 2018-06-04 11:23:23 +07:00
commit 76de026b4f
15 changed files with 139 additions and 38 deletions

View file

@ -1,5 +1,7 @@
# Copyright (c) 2018 Xored Software, Inc.
import hashes
import internal.godotinternaltypes, internal.godotstrings
import godotcoretypes, gdnativeapi
@ -17,6 +19,9 @@ proc initQuat*(axis: Vector3; angle: float32): Quat {.inline.} =
proc `$`*(self: Quat): string {.inline.} =
$getGDNativeAPI().quatAsString(self)
proc hash*(self: Quat): Hash {.inline.} =
!$(self.x.hash() !& self.y.hash() !& self.z.hash() !& self.w.hash())
proc length*(self: Quat): float32 {.inline.} =
getGDNativeAPI().quatLength(self)