Basically, I have a bunch of shapes attached to a body, and these shapes use this API call to adjust the vertices in different ways, specifically, by applying an offset to them, in the 'offset' part.
This allows to create shapes that adjust their appearance, for example, a larger box that becomes smaller when shot at.
So far, everything is working fine and the simulation behaves pretty much as you would expect, but with one wierd and subtle behaviour...
I decided to use CPSegmentQueryFirst, as in the following example...
Code: Select all
cpSegmentQueryInfo info = {};
if(cpSpaceSegmentQueryFirst(g_Space, start, end,CP_LAYER_BITMASK_ALL_OBJECTS, 0, &info))
{
out_hitpoint = cpSegmentQueryHitPoint(start, end, info);
return (void*) info.shape->data;
}
return NULL;
Do you have any ideas why the call to cpPolyShapeSetVerts would mess up the call cpSpaceSegmentQueryFirst ? any suggestion about how to fix this problem would be welcome