And <@U3JQ35YQK>’s <https://www.youtube.com/watch?...
# gamedev
o
And @romainguy’s

https://www.youtube.com/watch?v=LJyDCYP0WG4

I’m slightly confused. Shouldn’t intersection be
and
and union be
or
?
👌 1
I hope
inline classes
will be used for
Color
stuff in the new Kotlin code
update: watched more, it is there
also inline classes for GLSL generic vec3 vs color or coordinates
inline var xy
should probably be an extension property instead of a Float4 member?
e
no, intersection is what is contained in both the operand
and union is like a merge
then following the same logic of bitwise operators, intersection requires
or
and union
and
1101 & 0111 = 0101
o
But your example shows clearly that
&
(and) returns an intersection of `1`s
Also, using math notation,
a in (A union B)
is the same as
(a in A) or (a in B)
e
yeah
I definitely need holiday
🌴 1
r
Yeah there was a mistake in the slides
It's fixed on speaker deck
vec3 cannot be an inline class since it has more than one member
o
vec3 cannot be, but instead of
vec3.r
style, you could have
color3
or something, which is inline class over
vec3
and has these rgb properties
r
To create new types yes
But that's not what the swizzling and aliasing is entirely about
Even if your vector a position you might want to address its components as RGB for visualization without wrapping it
And the original goal was GLSL compatibility :)
o
Okay, here goes some reading on the topic… I’ll be back 🙂
r
As for extension properties vs members, I can see either work. I'm not sure which would be better here
I guess potentially extensions would mean a smaller class to load
o
Well, it will have to load the
Kt
class to use them anyway