| 427 | } |
| 428 | |
| 429 | void Car::resetCar(glm::vec3 reset_position, glm::quat reset_orientation) |
| 430 | { |
| 431 | setPosition(reset_position, reset_orientation); |
| 432 | if (m_vehicle) |
| 433 | { |
| 434 | m_carChassis->clearForces(); |
| 435 | m_carChassis->setLinearVelocity(btVector3(0,0,0)); |
| 436 | m_carChassis->setAngularVelocity(btVector3(0,0,0)); |
| 437 | m_vehicle -> resetSuspension(); |
| 438 | for (int i = 0; i < m_vehicle->getNumWheels(); i++) |
| 439 | { |
| 440 | //synchronize the wheels with the (interpolated) chassis worldtransform |
| 441 | m_vehicle -> updateWheelTransform(i, true); |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | void Car::writeObj(const std::string &path) { |
| 447 | std::cout << "Writing Meshes to " << path << std::endl; |