| 148 | } |
| 149 | |
| 150 | void MobileNerf::read_json_map() |
| 151 | { |
| 152 | std::string assetBase = vkb::fs::path::get(vkb::fs::path::Type::Assets); |
| 153 | LOGI("Base assets path: {}", assetBase); |
| 154 | |
| 155 | #if defined(NERF_JSON_FILE) |
| 156 | const std::string nerf_obj_map = assetBase + "scenes/mobile_nerf_models.json"; |
| 157 | |
| 158 | std::ifstream f(nerf_obj_map); |
| 159 | |
| 160 | if (!f) |
| 161 | { |
| 162 | LOGE("Failed to open nerf obj map data"); |
| 163 | assert(0); |
| 164 | } |
| 165 | |
| 166 | LOGI("Parsing nerf obj map data {}", nerf_obj_map); |
| 167 | |
| 168 | json raw_asset_map = json::parse(f); |
| 169 | #else |
| 170 | |
| 171 | const std::string nerf_obj_json = |
| 172 | R"V0G0N( |
| 173 | { |
| 174 | "width": 0, |
| 175 | |
| 176 | "height": 0, |
| 177 | |
| 178 | "texture_type": "8bit", |
| 179 | |
| 180 | "target_model": "lego_combo", |
| 181 | |
| 182 | "deferred": false, |
| 183 | |
| 184 | "rotation": true, |
| 185 | |
| 186 | "lego_ball":{ |
| 187 | "path": "scenes/morpheus_team/lego_ball_phone/", |
| 188 | "num_sub_model": 1, |
| 189 | "original": false, |
| 190 | "camera": [-1, 1, 1], |
| 191 | "instancing":{ |
| 192 | "dim": [1, 1, 1], |
| 193 | "interval": [2.0, 2.0, 2.0] |
| 194 | } |
| 195 | }, |
| 196 | |
| 197 | "lego_boba_fett":{ |
| 198 | "path": "scenes/morpheus_team/lego_boba_fett_phone/", |
| 199 | "num_sub_model": 1, |
| 200 | "original": false, |
| 201 | "camera": [-1, 1, 1], |
| 202 | "instancing":{ |
| 203 | "dim": [1, 1, 1], |
| 204 | "interval": [2.0, 2.0, 2.0] |
| 205 | } |
| 206 | }, |
| 207 | |