Hi there. What’s the meaning of source_array in deindexer()?Is it the actual data of the positions, normals and texcoords? Here’s the code:
std::map<domSource*,domSource*> source_map;
domSource_Array & source_array = mesh->getSource_array();
domUint source_count = source_array.getCount();
for(size_t i=0; i<source_count; i++)
{ //make a map of old source and new duplicat source
domSource* source = (domSource*) (domElement*) source_array[i];
domSourceRef newsource = (domSource*) (domElement*) source->clone();
assert(newsource);
ResetSource(newsource, vertexindex);
mesh->placeElement(newsource);
source_map[source] = newsource;
}
What does the function ResetSource() do?Here’s its definition:
void ResetSource(domSource * newsource, domUint new_vertex_size)
{
newsource->getTechnique_common()->getAccessor()->setCount(new_vertex_size);
domUint stride = newsource->getTechnique_common()->getAccessor()->getStride();
domFloat_arrayRef newfloat_array = newsource->getFloat_array();
if (newfloat_array)
{
newfloat_array->setCount(new_vertex_size * stride);
newfloat_array->getValue().setCount((size_t)(new_vertex_size * stride));
}
domInt_arrayRef newint_array = newsource->getInt_array();
if (newint_array)
{
newint_array->setCount(new_vertex_size * stride);
newint_array->getValue().setCount((size_t)(new_vertex_size * stride));
}
domName_arrayRef newname_array = newsource->getName_array();
if (newname_array)
{
newname_array->setCount(new_vertex_size * stride);
newname_array->getValue().setCount((size_t)(new_vertex_size * stride));
}
domIDREF_arrayRef newidref_array = newsource->getIDREF_array();
if (newidref_array)
{
newidref_array->setCount(new_vertex_size * stride);
newidref_array->getValue().setCount((size_t)(new_vertex_size * stride));
}
domBool_arrayRef newbool_array = newsource->getBool_array();
if (newbool_array)
{
newbool_array->setCount(new_vertex_size * stride);
newbool_array->getValue().setCount((size_t)(new_vertex_size * stride));
}
}
-Ehsan-