seeding the pot for 2.0 features [small vectors]
Chad J
gamerChad at _spamIsBad_gmail.com
Sun Jan 28 21:12:17 PST 2007
Bill Baxter wrote:
> Chad J wrote:
>
>> Bill Baxter wrote:
>>
>>> Mikola Lysenko wrote:
>>>
>>>> Bill Baxter wrote:
>>>>
>>>>> Mikola Lysenko wrote:
>>>>>
>>>>>> 2. Low dimensional vectors as primitive types
>>
>> [...]
>
>
>>>
>>> float[4] v = a*b + c*d;
>>>
>>> you can even make aliases if you like.
>>>
>>> alias float[4] float4;
>>>
>>> But your 3D graphics library will still need to be a library on top
>>> of that.
>>
>>
>> Yeah I mentioned static arrays earlier, but I realized that they can
>> be a bit of a pain in the ass to work with. This probably means that
>> static arrays should be fixed, then they could be useful vectors.
>
>
> Agreed. So basically the D 2.0 wish list item becomes to make float[4]
> act more like a plain-old-data value type, give it simple math
> operations, optimize the heck out of it, and make it possible to alias
> it to float4 for convenience.
>
> And maybe add the .xyzw accessors and swizzles too. :-)
>
> I suspect the "optimize the heck out of it" step will be a long time
> coming though. Probably more like D 3.0.
>
> --bb
*sigh* but I want my uber vector operations NOW! :)
More information about the Digitalmars-d
mailing list