Guest xionmark Posted November 28, 2012 Share Posted November 28, 2012 (edited) Hello, I'm confused about retrieving a point from a GEO_PointPtrArray array. The array is getting properly built, verified by a call to GEO_PointPtrArray.display, but when trying to make the assignment to a GEO_Point* variable, mantra crashes. It's got to be something obvious ... ! Code fragment: GEO_PointTree mySRCPointTree // this actually gets set before this function is called; GEO_Point * ppt, * inst_ppt; GEO_PointPtrArray src_list; GA_FOR_ALL_GPOINTS(inst_gdp, inst_ppt) { UT_Vector3 inst_pos = inst_ppt->getPos(); fpreal inst_radius = static_cast<fpreal>(inst_ppt->getValue<fpreal>(myInstAttrRefs.pointRadius, 0)); int num_src_pts_found = mySRCPointTree.findAllClosePt(inst_pos, inst_radius, src_list); src_list.display(); // works! if(num_src_pts_found > 0) for(uint i = 0; i < src_list.entries(); i++) { ppt = src_list(i); // CRASHOLA! // fpreal radius = static_cast<fpreal>(ppt->getValue<fpreal>(myPointAttrRefs.radius, 0)); } } As always, thanks in advance! --Mark Edited November 28, 2012 by xionmark Quote Link to comment Share on other sites More sharing options...
Guest xionmark Posted November 28, 2012 Share Posted November 28, 2012 Fixed! I was using the wrong form of appendPtRadius() to build the point tree list. For my purposes this was wrong (but valid): mySRCPointTree.appendPtRadius(ppt->getPos(), radius); And this is correct: mySRCPointTree.appendPtRadius(myGdp, ppt, radius); Never mind! :-) --Mark Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.