hdk get prims by type

   1101   1   2
User Avatar
Member
897 posts
Joined: July 2018
Offline
How do I get the number of polygons in a detail?

On a similar note, I can't get my code to run this: gdp->getPrimitivesOfType(GA_PRIMPOLY, prims);, saying the function is unknown. I can see Spinynormal uses it here: https://raw.githubusercontent.com/spinynormal/DEC-SOP/master/diff.cpp [raw.githubusercontent.com] but I don't get how he does it.

That example is even more confusing for me as the gdp isn't even declared in that function, if I don't pass my gdp I can't use it. Wonder if there's any legecy setup I'm running that that means I'm not using these GA functions?
B.Henriksson, DICE
User Avatar
Staff
727 posts
Joined: Oct. 2012
Offline
You can use
GA_Detail::countPrimitiveType()
which is very fast since the counts are maintained as prims are added and removed.
  • Quick Links