Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/RegistrationTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,13 +659,19 @@ ICPRegistrationTools::RESULT_TYPE ICPRegistrationTools::Register( GenericIndexed
CCVector3 Nm;
if (inputModelMesh)
{
assert(data.CPSetPlain);
unsigned triIndex = static_cast<unsigned>(data.CPSetPlain->getPointScalarValue(i));
assert(triIndex < inputModelMesh->size());
inputModelMesh->interpolateNormals(triIndex, *data.CPSetPlain->getPoint(i), Nm);
}
else if (inputModelCloud)
{
assert(data.CPSetRef);
Nm = *inputModelCloud->getNormal(data.CPSetRef->getPointGlobalIndex(i));
}
else
{
Nm = *inputModelCloud->getNormal(i);
assert(false);
}

//we assume the vectors are unitary!
Expand Down
Loading