Exemple #1
0
IBody* IBody::clone()
{
	if (m_filename == "") return NULL;

	IBody* body = BodyFactory::createBody(m_filename, m_scale);

	body->m_filename = m_filename;
	body->m_alive = m_alive;
	body->m_world = m_world;
	body->m_scale = m_scale;

	b2Body* b2body = body->getBody();
	b2body->SetTransform(m_body->GetPosition(), m_body->GetAngle());

	return body;
}