|
Re: Camera code does not recognize target
I tried changing the compareTargets function to boolean as follows:
bool compareTargets(Target t1, Target t2) {
return (t1.m_score > t2.m_score)
}
This solved the problem. Apparently the sort function is looking for a true/false rather than -1/0/1. Both -1 and 1 were considered true (only 0 is considered false) so no sorting was actually being done.
|