aardvark-platform / aardvark.base

Aardvark.Base is the foundation of the open-source Aardvark Platform for visual computing, real-time graphics, and visualization.
https://aardvarkians.com/
Apache License 2.0
153 stars 9 forks source link

Add vector swizzle property setters #56

Closed luithefirst closed 3 years ago

luithefirst commented 3 years ago

It would nice to allow using the swizzle properties as setters:

var vec = V3d.III;
vec.XY = V2d.OO;

This would be also convenient for shaders where I currently use this workaround:

[<GLSLIntrinsic("{0} = {1}")>] [<KeepCall>]
let set (a: 'a) (b : 'a) = onlyInShaderCode "set" 
...
set va.XYZ value
hyazinthh commented 3 years ago

Added setters in v51 for properties without constants and without duplicates. E.g. a setter for V4d.XX would not make much sense. Let me know if I missed anything.