Hi Paul,
No, neither is allocated (both are 0). I'm trying to find out what could
cause that... My workaround of course is to create it myself if both
arrays are 0, but Uniform should work correctly...
I think it's in the copy constructor.
Uniform::Uniform( const Uniform& rhs, const CopyOp& copyop ) :
Object(rhs,copyop), _type(rhs._type)
{
copyData( rhs );
}
void Uniform::copyData(const Uniform& rhs)
{
// caller must ensure that _type==rhs._type
_numElements = rhs._numElements;
if( _floatArray.valid() && rhs._floatArray.valid() )
*_floatArray = *rhs._floatArray;
if( _intArray.valid() && rhs._intArray.valid() )
*_intArray = *rhs._intArray;
dirty();
}
So the type and number of elements are initialized, but no array is
allocated (no call to allocateDataArray) so the two ifs return false
(rhs's array is valid but this's is not). The copy constructor should
allocate the same array as rhs if rhs has one, and then just copy the
elements, shouldn't it?
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org