Fixed some issues caused by dereferencing pointers to elements of an std::vector that has since been re-allocated.
Some comments:
The _originalVertices doesn't have to be a member variable, since we only use it inside the processContours function. But it should be more efficient like this, since making it local to the function would cause it to re-allocate every time.
In vertexDataCallback: I replaced the if (vertex_data[i] != nullptr) with if (weight[i] > 0.0f), since we're no longer passing pointers but instead index values directly, and an index of 0 would cause the null-check to fail.
Fixed some issues caused by dereferencing pointers to elements of an std::vector that has since been re-allocated.
Some comments:
_originalVertices
doesn't have to be a member variable, since we only use it inside theprocessContours
function. But it should be more efficient like this, since making it local to the function would cause it to re-allocate every time.vertexDataCallback
: I replaced theif (vertex_data[i] != nullptr)
withif (weight[i] > 0.0f)
, since we're no longer passing pointers but instead index values directly, and an index of 0 would cause the null-check to fail.76