View Full Version : outline.collision test error

12-19-2012, 04:11 PM
I have a character outline and a self made box outline,
I want to check collision between them with generating collision info like normal and penetration depth.
the problem is that on outline.collision an assert error is thrown, I've tracked it down and its on penetration depth calculation, it finds uneven points and crash the app when trying to get the line information that is out of vector range.

the box is calculated like so:

CL_Contour contour;
contour.get_points().push_back( CL_Pointf(150.0f,50.0f) );
contour.get_points().push_back( CL_Pointf(150.0f,150.0f) );
contour.get_points().push_back( CL_Pointf(300.0f,150.0f) );
contour.get_points().push_back( CL_Pointf(300.0f,50.0f) );

the charoutline is from a png file.
I'm also using set_aligment and set_translation for charoutline

Here is the source: 1305

12-19-2012, 05:31 PM
Seems to work if I enable metadata

12-20-2012, 08:48 AM
CL_Contour contour;
contour.get_points().push_back( CL_Pointf(150.0f,50.0f) );

That looks like unexpected usage. I have not checked the internals to see if that is safe.

Ideally contour should contain: contour.add_point(const CL_Pointf &point);
And the get_points() should only return a const reference.