//private
void BodyCreator::m_Split(const MapObject& object, b2Body* body)
{
	//check object shapes is valid
	if (!m_CheckShape(const_cast<MapObject&>(object))) return;

	const Shape& points = object.PolyPoints();
	Shapes shapes;
	if (object.Convex())
		shapes = m_ProcessConvex(points);
	else
		shapes = m_ProcessConcave(points);

	for (auto& shape : shapes)
	{
		sf::Uint16 s = shape.size();

		if (s > b2_maxPolygonVertices)
		{
			//break into smaller and append
			Shapes moreShapes = m_ProcessConvex(shape);
			for (auto& anotherShape : moreShapes)
				m_CreateFixture(anotherShape, body);

			continue; //skip shape because it's too big
		}
		m_CreateFixture(shape, body);
	}
}