| 149 | } |
| 150 | |
| 151 | int Models::LoadModelAsMorph(const std::string& rel_path, int base_model_id, const std::string& base_model_name) { |
| 152 | MorphIndex index; |
| 153 | index.first = rel_path; |
| 154 | index.second = base_model_id; |
| 155 | MorphMap::iterator iter = morph_map_.find(index); |
| 156 | if (iter != morph_map_.end()) { |
| 157 | return iter->second; |
| 158 | } |
| 159 | |
| 160 | int morph_model_id = AddModel(); |
| 161 | Model& morph_model = GetModel(morph_model_id); |
| 162 | const std::string& name = base_model_name; |
| 163 | morph_model.LoadObjMorph(rel_path, name); |
| 164 | GetModelData(morph_model_id).name = std::string(rel_path); |
| 165 | |
| 166 | GetModel(morph_model_id).CopyVertCollapse(GetModel(base_model_id)); |
| 167 | |
| 168 | morph_map_[index] = morph_model_id; |
| 169 | |
| 170 | return morph_model_id; |
| 171 | } |
| 172 | |
| 173 | void Models::Dispose() { |
| 174 | models.clear(); |
no test coverage detected