[osg-users] Vec3Array Deep Copy

Robert Osfield robert.osfield at gmail.com
Thu Aug 20 10:40:06 PDT 2015


HI Erik,

The constructor takes a reference not a pointer so try:

 osg::ref_ptr < osg::Vec3Array > pCopy = new osg::Vec3Array(*pVertexArray,
osg::CopyOp::DEEP_COPY_ALL);

Noe the *.


Or use osg::clone() i.e.

  pCopy = osg::clone(pVertexArray->get());

Robert.

On 20 August 2015 at 18:30, Erik Hensens <ehensens at hunter.com> wrote:

> Hi everyone!
>
> I have a simple question but I just can't figure it out. What is the
> proper way to copy a Vec3Array? The code below is not right:
>
>
> Code:
>
> osg::ref_ptr < osg::Vec3Array > pVertexArray = new osg::Vec3Array;
> ...
> osg::ref_ptr < osg::Vec3Array > pCopy = new osg::Vec3Array(pVertexArray,
> osg::CopyOp::DEEP_COPY_ALL);
>
>
>
>
> I get the compilation error below:
>
>
> Code:
>
> error : no matching function for call to 'osg::TemplateArray < osg::Vec3f,
> (osg::Array::Type)28u, 3, 5126 >
> ::TemplateArray(osg::ref_ptr<osg::TemplateArray < osg::Vec3f,
> (osg::Array::Type)28u, 3, 5126 > > &, osg::CopyOp::Options)'
>
>
>
>
> Thanks very much for your help!
>
> Cheers,
> Erik
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64852#64852
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150820/c104a011/attachment-0003.htm>


More information about the osg-users mailing list