i ran into a bug (a forum post by niko said so) with the metatriangleselector (mts): it calculates collisions for the last appended selector only. i think i found the reason: mts::getTriangles uses the getTriangle methods of it's members and these write the triangles into the given array, starting at index 0, so each member overrides the triangles found by it's forerunner.
wouldn't be useful without, so i have a (quick and dirty) suggestions to fix this until niko provides a clean and fast solution . in the CCMetaTriangleSelector.cpp file you could change the getTriangle() methods in a way like this:
Code: Select all
[...]
s32 outWritten = 0;
for (s32 i=0; i<(s32)TriangleSelectors.size(); ++i)
{
core::triangle3df _triangles[arraySize - outWritten]; //addition
s32 t = 0;
TriangleSelectors[i]->getTriangles(_triangles, arraySize - outWritten, t, box, transform); //changed
for(s32 a = 0; a < t; a++) {
triangles[outWritten + a] = _triangles[a];
}//addition
outWritten += t;
}
outTriangleCount = outWritten;
[...]
hope that helps,
corban