Hi Timm,

Timm Drevensek wrote:
> Joho,
> 
> found a funny bug while trying to set texture coordinates of 4 elements.
> 
>  
> 
> If you have:
> 
> osg::GeoTexCoords4fPtr coord; 
> 
>  
> 
> The 2 Commands do not the same!
> 
> coord->setValue(osg::Vec4f(x,y,z,w), 0); // only sets X & Y!
> 
> coord->getFieldPtr()->setValue(osg::Vec4f(x,y,z,w), 0); // sets X, Y, Z, W

it's not a bug, it's a feature! ;)

The generic access was designed to hide the actual internal type and give 
applications a way to read any attribute without having to worry abot its 
internal type. As you found the generic type for texture coordinates is Vec2f, 
so if you use the generic interface, everything is converted to and from Vec2f. 
To get the full data you have to use the field access.

It seemed like a good idea at the beginning, and it has helped writing a lot of 
the utility functions that can handle generic Geometry, but it certainly is a 
FAQ. So in 2 we're getting rid of the generic type and instead allow arbitrary 
conversions (compilers are better about templates now than they were when we 
stated 1).

Yours

        Dirk

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to