| 444 | } |
| 445 | |
| 446 | void Car::writeObj(const std::string &path) { |
| 447 | std::cout << "Writing Meshes to " << path << std::endl; |
| 448 | |
| 449 | std::ofstream obj_dump; |
| 450 | obj_dump.open(path); |
| 451 | |
| 452 | /*for (Model &mesh : car_body_model) { |
| 453 | *//* Print Part name*//* |
| 454 | obj_dump << "o " << mesh.m_name << std::endl; |
| 455 | //Dump Vertices |
| 456 | for (auto vertex : mesh.m_vertices) { |
| 457 | obj_dump << "v " << vertex[0] << " " << vertex[1] << " " << vertex[2] << std::endl; |
| 458 | } |
| 459 | //Dump UVs |
| 460 | for (auto uv : mesh.m_uvs) { |
| 461 | obj_dump << "vt " << uv[0] << " " << uv[1] << std::endl; |
| 462 | } |
| 463 | //Dump Indices |
| 464 | for (auto vert_index : mesh.m_vertex_indices) { |
| 465 | obj_dump << "f " << vert_index << std::endl; |
| 466 | } |
| 467 | }*/ |
| 468 | |
| 469 | obj_dump.close(); |
| 470 | } |
| 471 | |
| 472 | float Car::getRotY() { |
| 473 | glm::quat orientation = car_body_model.orientation; |