| 54 | } |
| 55 | |
| 56 | static void parse_physics(PhysicsSettings *settings, const char *json) |
| 57 | { |
| 58 | TempAllocator1024 ta; |
| 59 | JsonObject obj(ta); |
| 60 | sjson::parse(obj, json); |
| 61 | |
| 62 | auto cur = json_object::begin(obj); |
| 63 | auto end = json_object::end(obj); |
| 64 | for (; cur != end; ++cur) { |
| 65 | JSON_OBJECT_SKIP_HOLE(obj, cur); |
| 66 | |
| 67 | if (cur->first == "step_frequency") { |
| 68 | settings->step_frequency = sjson::parse_int(cur->second); |
| 69 | } else if (cur->first == "max_substeps") { |
| 70 | settings->max_substeps = sjson::parse_int(cur->second); |
| 71 | } else if (cur->first == "solver_iterations") { |
| 72 | settings->solver_iterations = sjson::parse_int(cur->second); |
| 73 | } else if (cur->first == "sleep_threshold") { |
| 74 | settings->sleep_threshold = sjson::parse_float(cur->second); |
| 75 | } else { |
| 76 | logw(BOOT_CONFIG |
| 77 | , "Unknown physics property '%.*s'" |
| 78 | , cur->first.length() |
| 79 | , cur->first.data() |
| 80 | ); |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | static void parse_renderer_settings(BootConfig *config, const char *json) |
| 86 | { |