 The thoracic cavity contains the lungs and the heart, which is located in the mediastinum.The diaphragm forms the floor of the thoracic cavity and separates it from the more inferior abdominopelvic cavity.The abdominopelvic cavity is the largest cavity in the body.