Boost logo

Boost :

From: Michael Marcin (mike_at_[hidden])
Date: 2006-10-08 18:18:38


Janek Kozicki wrote:
> Marcus Lindblom said: (by the date of Sun, 08 Oct 2006 13:28:56 +0200)
>
>> Perhaps we can make it so that you can decouple access style from the
>> general algorithms? We might need that anyway, if we want to support
>> things like rgba, stqr, etc, for the small 1-4 element vectors.
>
> interesting idea, compare:
>
> - iterators <-> continers
> - member access <-> vectors
>
> maybe with MPL it's possible to define that 'custom' access method.
>

It would be very cool if you could swizzle the components for small
vectors cheaply into views ala high level shader languages. I.E.

geom::vector<float,4> vec( 1, 0, 0, 0 );

// replicate x to all channels
vec = vec.xxxx;
// vec = { 1, 1, 1, 1 }

or

// convert the result of 3rd party geometry lib based function
// that uses +y up to a result that a +z up application can use

geom::vector<float,3> some_function();

geom::vector<float,3> app_vec( some_function().xzy );

- Mike


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk