Skip to content

Instantly share code, notes, and snippets.

@barcharcraz
Last active August 29, 2015 13:59
Show Gist options
  • Save barcharcraz/8a6d216f7f072fb62984 to your computer and use it in GitHub Desktop.
Save barcharcraz/8a6d216f7f072fb62984 to your computer and use it in GitHub Desktop.
type TMatrix*[N: static[int]; M: static[int]; T] = object
data*: array[0..M*N-1, T]
type TVec3f*[N: static[int]; T] = TMatrix[N, 1, T]
proc `$`*(a: TVec3f): string {.noSideEffect.} =
result = "x: " & formatFloat(a[1])
result &= " y: " & formatFloat(a[2])
result &= " z: " & formatFloat(a[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment