// Delete the tank object, deleting also all bodies corresponding to // the various parts and removing them from the physical system. Also // removes constraints from the system. ~MySimpleTank() { ChSystem* mysystem = truss->GetBody()->GetSystem(); // trick to get the system here // When a ChBodySceneNode is removed via ->remove() from Irrlicht 3D scene manager, // it is also automatically removed from the ChSystem (the ChSystem::RemoveBody() is // automatically called at Irrlicht node deletion - see ChBodySceneNode.h ). // For links, just remove them from the ChSystem using ChSystem::RemoveLink() mysystem->RemoveLink(link_revoluteRF); mysystem->RemoveLink(link_revoluteLF); mysystem->RemoveLink(link_revoluteRB); mysystem->RemoveLink(link_revoluteLB); truss->remove(); wheelRF->remove(); wheelLF->remove(); wheelRB->remove(); wheelLB->remove(); }
// Delete the car object, deleting also all bodies corresponding to // the various parts and removing them from the physical system. Also // removes constraints from the system. ~MySimpleForklift() { ChSystem* mysystem = truss->GetBody()->GetSystem(); // trick to get the system here // When a ChBodySceneNode is removed via ->remove() from Irrlicht 3D scene manager, // it is also automatically removed from the ChSystem (the ChSystem::RemoveBody() is // automatically called at Irrlicht node deletion - see ChBodySceneNode.h ). // For links, just remove them from the ChSystem using ChSystem::RemoveLink() mysystem->RemoveLink(link_revoluteRF); mysystem->RemoveLink(link_revoluteLF); mysystem->RemoveLink(link_steer_engineB); mysystem->RemoveLink(link_engineB); mysystem->RemoveLink(link_engineArm); mysystem->RemoveLink(link_prismaticFork); mysystem->RemoveLink(link_actuatorFork); truss->remove(); wheelRF->remove(); wheelLF->remove(); wheelB->remove(); spindleB->remove(); arm->remove(); fork->remove(); }
// Delete the car object, deleting also all bodies corresponding to // the various parts and removing them from the physical system. Also // removes constraints from the system. MySimpleCar::~MySimpleCar() { ChSystem* mysystem = spindleRF->GetBody()->GetSystem(); // trick to get the system here // When a ChBodySceneNode is removed via ->remove() from Irrlicht 3D scene manager, // it is also automatically removed from the ChSystem (the ChSystem::RemoveBody() is // automatically called at Irrlicht node deletion - see ChBodySceneNode.h ). // For links, just remove them from the ChSystem using ChSystem::RemoveLink() mysystem->RemoveLink(link_revoluteRF); mysystem->RemoveLink(link_brakeRF); mysystem->RemoveLink(link_distRFU1); mysystem->RemoveLink(link_distRFU2); mysystem->RemoveLink(link_distRFL1); mysystem->RemoveLink(link_distRFL2); mysystem->RemoveLink(link_springRF); mysystem->RemoveLink(link_distRSTEER); mysystem->RemoveLink(link_revoluteLF); mysystem->RemoveLink(link_brakeLF); mysystem->RemoveLink(link_distLFU1); mysystem->RemoveLink(link_distLFU2); mysystem->RemoveLink(link_distLFL1); mysystem->RemoveLink(link_distLFL2); mysystem->RemoveLink(link_springLF); mysystem->RemoveLink(link_distLSTEER); mysystem->RemoveLink(link_revoluteRB); mysystem->RemoveLink(link_brakeRB); mysystem->RemoveLink(link_distRBU1); mysystem->RemoveLink(link_distRBU2); mysystem->RemoveLink(link_distRBL1); mysystem->RemoveLink(link_distRBL2); mysystem->RemoveLink(link_springRB); mysystem->RemoveLink(link_distRBlat); mysystem->RemoveLink(link_engineR); mysystem->RemoveLink(link_revoluteLB); mysystem->RemoveLink(link_brakeLB); mysystem->RemoveLink(link_distLBU1); mysystem->RemoveLink(link_distLBU2); mysystem->RemoveLink(link_distLBL1); mysystem->RemoveLink(link_distLBL2); mysystem->RemoveLink(link_springLB); mysystem->RemoveLink(link_distLBlat); mysystem->RemoveLink(link_engineL); truss->remove(); spindleRF->remove(); wheelRF->remove(); spindleLF->remove(); wheelLF->remove(); spindleRB->remove(); wheelRB->remove(); spindleLB->remove(); wheelLB->remove(); sound_engine->drop(); }