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 <[email protected]> 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 > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

