| 736 | } |
| 737 | |
| 738 | void CCar::ParseDefinitions() |
| 739 | { |
| 740 | bone_map.clear(); |
| 741 | |
| 742 | IKinematics* pKinematics = smart_cast<IKinematics*>(Visual()); |
| 743 | bone_map.insert(mk_pair(pKinematics->LL_GetBoneRoot(), physicsBone())); |
| 744 | CInifile* ini = pKinematics->LL_UserData(); |
| 745 | R_ASSERT2(ini, "Car has no description !!! See ActorEditor Object - UserData"); |
| 746 | CExplosive::Load(ini, "explosion"); |
| 747 | // CExplosive::SetInitiator(ID()); |
| 748 | m_camera_position = ini->r_fvector3("car_definition", "camera_pos"); |
| 749 | ///////////////////////////car definition/////////////////////////////////////////////////// |
| 750 | fill_wheel_vector(ini->r_string("car_definition", "driving_wheels"), m_driving_wheels); |
| 751 | fill_wheel_vector(ini->r_string("car_definition", "steering_wheels"), m_steering_wheels); |
| 752 | fill_wheel_vector(ini->r_string("car_definition", "breaking_wheels"), m_breaking_wheels); |
| 753 | fill_exhaust_vector(ini->r_string("car_definition", "exhausts"), m_exhausts); |
| 754 | fill_doors_map(ini->r_string("car_definition", "doors"), m_doors); |
| 755 | |
| 756 | ///////////////////////////car properties/////////////////////////////// |
| 757 | |
| 758 | m_max_power = ini->r_float("car_definition", "engine_power"); |
| 759 | m_max_power *= (0.8f * 1000.f); |
| 760 | |
| 761 | m_max_rpm = ini->r_float("car_definition", "max_engine_rpm"); |
| 762 | m_max_rpm *= (1.f / 60.f * 2.f * M_PI); |
| 763 | |
| 764 | m_min_rpm = ini->r_float("car_definition", "idling_engine_rpm"); |
| 765 | m_min_rpm *= (1.f / 60.f * 2.f * M_PI); |
| 766 | |
| 767 | m_power_rpm = ini->r_float("car_definition", "max_power_rpm"); |
| 768 | m_power_rpm *= (1.f / 60.f * 2.f * M_PI); // |
| 769 | |
| 770 | m_torque_rpm = ini->r_float("car_definition", "max_torque_rpm"); |
| 771 | m_torque_rpm *= (1.f / 60.f * 2.f * M_PI); // |
| 772 | |
| 773 | m_power_increment_factor = READ_IF_EXISTS(ini, r_float, "car_definition", "power_increment_factor", m_power_increment_factor); |
| 774 | m_rpm_increment_factor = READ_IF_EXISTS(ini, r_float, "car_definition", "rpm_increment_factor", m_rpm_increment_factor); |
| 775 | m_power_decrement_factor = READ_IF_EXISTS(ini, r_float, "car_definition", "power_decrement_factor", m_power_increment_factor); |
| 776 | m_rpm_decrement_factor = READ_IF_EXISTS(ini, r_float, "car_definition", "rpm_decrement_factor", m_rpm_increment_factor); |
| 777 | m_power_neutral_factor = READ_IF_EXISTS(ini, r_float, "car_definition", "power_neutral_factor", m_power_neutral_factor); |
| 778 | R_ASSERT2(m_power_neutral_factor > 0.1f && m_power_neutral_factor < 1.f, "power_neutral_factor must be 0 - 1 !!"); |
| 779 | if (ini->line_exist("car_definition", "exhaust_particles")) |
| 780 | { |
| 781 | m_exhaust_particles = ini->r_string("car_definition", "exhaust_particles"); |
| 782 | } |
| 783 | |
| 784 | b_auto_switch_transmission = !!ini->r_bool("car_definition", "auto_transmission"); |
| 785 | |
| 786 | InitParabola(); |
| 787 | |
| 788 | m_axle_friction = ini->r_float("car_definition", "axle_friction"); |
| 789 | m_steering_speed = ini->r_float("car_definition", "steering_speed"); |
| 790 | |
| 791 | if (ini->line_exist("car_definition", "break_time")) |
| 792 | { |
| 793 | m_break_time = ini->r_float("car_definition", "break_time"); |
| 794 | } |
| 795 | /////////////////////////transmission//////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected