mgMeshPrimitiveGetVtxIndexArray will pass back zero if any of the following are true:
- The rec you pass is not a mesh
- The primNo you specify is not a primitive of the mesh (first primitive is 0)
- The indexArray you pass to "fill in" is NULL
- The maxLen you pass is 0
I just double checked here and it seems to work fine given the criteria above.
The index array was NULL. Thanks for all the help!
Craig
I am always getting a return value of zero from mgMeshPrimitiveGetVtxIndexArray even though I get valid values back from mgMeshPrimitiveGetNumVtx with the same mesh and primitive number. According to the documentation "The actual number of vertex indices returned is the smaller of maxLen and the number of vertex indices in the specified mesh primitive." I pass in the number of vertex indices in the specified mesh primitive as my maxLen so how am I getting zero?