# HG changeset patch # User sam # Date 1722928011 -25200 # Node ID da3bbd587fe10b85ba37ebcd8d3d1e4669fd1ecc # Parent 76ca976804d02c5a6a2caa9f876c4f2b7908c75d add: a few more helper constants diff -r 76ca976804d0 -r da3bbd587fe1 semicongine/core/vector.nim --- a/semicongine/core/vector.nim Mon Aug 05 17:17:31 2024 +0700 +++ b/semicongine/core/vector.nim Tue Aug 06 14:06:51 2024 +0700 @@ -90,15 +90,25 @@ const + R* = vec4(1, 0, 0, 1) + G* = vec4(1, 0, 0, 1) + B* = vec4(1, 0, 0, 1) + X* = vec3(1, 0, 0) Y* = vec3(0, 1, 0) Z* = vec3(0, 0, 1) - R* = vec4(1, 0, 0, 1) - G* = vec4(1, 0, 0, 1) - B* = vec4(1, 0, 0, 1) + XY* = vec3(1, 1, 0) + XZ* = vec3(1, 0, 1) + YZ* = vec3(0, 1, 1) + XYZ* = vec3(1, 1, 1) + Xi* = vec3i(1, 0, 0) Yi* = vec3i(0, 1, 0) Zi* = vec3i(0, 0, 1) + XYi* = vec3i(1, 1, 0) + XZi* = vec3i(1, 0, 1) + YZi* = vec3i(0, 1, 1) + XYZi* = vec3i(1, 1, 1) func to*[T](v: TVec1): auto = TVec1([T(v[0])]) func to*[T](v: TVec2): auto = TVec2([T(v[0]), T(v[1])])