예제 #1
0
bool entity_intersects(Entity& entity, tmx::MapObject& obj)
{
	sf::FloatRect objRect(createRect(OrthogonalToIsometric(obj.GetPosition()), obj.GetSize()));
	return  (createRect(OrthogonalToIsometric(entity.objectEntity->GetPosition()), entity.objectEntity->GetSize()).intersects(objRect));
}
예제 #2
0
bool entity_ojectInView(tmx::MapObject& object, sf::View& view)
{
	return createRect(object.GetPosition(), object.GetSize()).intersects((createRect(view.getCenter() - view.getSize() / 1.5f, view.getSize() * 1.5f)));
}