| 82 | } |
| 83 | |
| 84 | SpawnOptions ScriptBatch::parseSpawnOptions(const sol::object& object) const { |
| 85 | const glm::vec3 worldSize = simulation_.world().getWorldSize(); |
| 86 | SpawnOptions options; |
| 87 | options.max = worldSize; |
| 88 | if (!object.is<sol::table>()) { |
| 89 | return options; |
| 90 | } |
| 91 | |
| 92 | const sol::table table = object.as<sol::table>(); |
| 93 | if (const sol::object velocity = table["velocity"]; velocity.is<sol::table>()) { |
| 94 | options.velocity = readVec3Object(velocity); |
| 95 | } |
| 96 | if (const sol::object regionObject = table["region"]; regionObject.is<sol::table>()) { |
| 97 | const sol::table regionTable = regionObject.as<sol::table>(); |
| 98 | options.min = readVec3Object(regionTable["min"], options.min); |
| 99 | options.max = readVec3Object(regionTable["max"], options.max); |
| 100 | } |
| 101 | options.temperature = table.get_or("temperature", options.temperature); |
| 102 | options.margin = table.get_or("margin", options.margin); |
| 103 | options.minDistance = table.get_or("min_distance", options.minDistance); |
| 104 | options.maxAttempts = table.get_or("attempts", options.maxAttempts); |
| 105 | options.randomRotation = table.get_or("random_rotation", options.randomRotation); |
| 106 | options.fixed = table.get_or("fixed", options.fixed); |
| 107 | return options; |
| 108 | } |
| 109 | |
| 110 | void ScriptAPI::clear() { simulation_.clear(); } |
| 111 |
nothing calls this directly
no test coverage detected