[osg-users] Vec3Array Deep Copy

Erik Hensens ehensens at hunter.com
Thu Aug 20 11:12:49 PDT 2015


Hi Robert,

Thanks again. "You da man".

Erik


robertosfield wrote:
> 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 < ()> 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 (http://forum.openscenegraph.org/viewtopic.php?p=64852#64852)
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> 
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64854#64854








More information about the osg-users mailing list