HDK all prims into a group

   1928   3   1
User Avatar
Member
83 posts
Joined: July 2005
Offline
I have this:

GA_PrimitiveGroup *deleteUs = gdp->newPrimitiveGroup(“deleteUs”);
GA_Offset lcl_start, lcl_end, crr;
for (GA_Iterator lcl_it((gdp)->getPrimitiveRange());lcl_it.blockAdvance(lcl_start, lcl_end); )
for (crr = lcl_start; crr < lcl_end; ++crr){
deleteUs->addIndex(crr);
}

sorta stolen from “GA_FOR_ALL_PTOFF”

is this the fastest? or is there a way to simply say newPrimGroup(“foo”,ADD_ALL);

or sumthin'?
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
I believe you can use GA_PrimitiveGroup::setEntries() to add all the prims to the group.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
83 posts
Joined: July 2005
Offline


perfect.

now, if I can only figure out why they don't have a “GA_FOR_ALL_PRIM_OFF” macro…..
User Avatar
Member
678 posts
Joined: July 2005
Offline
You can also do:

GA_PrimitiveGroup::addRange(GU_Detail::getPrimitiveRange());
  • Quick Links