Add world.searchObjects RPC with volume support #287
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expose DCS’ world.searchObjects via WorldService/SearchObjects with full volume support (sphere, box, segment, pyramid).
Example request payload:
{ "categories": [1], "volume": { "sphere": { "center": { "lat": 41.9, "lon": 41.9, "alt": 200 }, "radius": 3000000 } } }Example request payload for a pyramid search:
{ "categories": [1], "volume": { "pyramid": { "center": { "lat": 43.0, "lon": 44.0, "alt": 0 }, "forward": { "x": 1, "y": 0, "z": 0 }, "right": { "x": 0, "y": 0, "z": 1 }, "up": { "x": 0, "y": 1, "z": 0 }, "length": 3000000, "halfAngleHorizontal": 1.56, "halfAngleVertical": 1.56 } } }Example response:
{ "objects": [ { "unit": { "id": 2, "name": "Aerial-2-1", "callsign": "Springfield11", "coalition": "COALITION_BLUE", "type": "A-10A", "position": { "lat": 43.80128964094778, "lon": 36.80316924193918, "alt": 1962.2799072265625, "u": 206424.18943715096, "v": -141278.69705298543 }, "orientation": { "heading": 95.71059450833623, "yaw": 98.36883403042783, "pitch": 7.451955739887493, "roll": 0.0000330837287922511, "forward": { "x": -0.098663330078125, "y": 0.12969478964805603, "z": 0.9866330623626709 }, "right": { "x": -0.9950371980667114, "y": -5.774199962615967e-7, "z": -0.09950366616249084 }, "up": { "x": 0.012904536910355091, "y": 0.9915539622306824, "z": -0.12905119359493256 } }, "velocity": { "heading": 95.7105901371753, "speed": 123.22611009175196, "velocity": { "x": -12.261449813842773, "y": 1.445429801940918, "z": 122.61456298828125 } }, "group": { "id": 2, "name": "Aerial-2", "coalition": "COALITION_BLUE", "category": "GROUP_CATEGORY_AIRPLANE" }, "number_in_group": 1 } }, { "unit": { "id": 8, "name": "Ground-3-1", "callsign": "", "coalition": "COALITION_BLUE", "type": "mrap_mk19", "position": { "lat": 45.0422479049929, "lon": 38.10749053330819, "alt": 5.001004695892334, "u": 302734.90625, "v": 2232.5100098262274 }, "orientation": { "heading": 0, "yaw": 3.6502970123791134, "pitch": 0, "roll": 0, "forward": { "x": 1, "y": 0, "z": 0 }, "right": { "x": 0, "y": 0, "z": 1 }, "up": { "x": 0, "y": 1, "z": 0 } }, "velocity": { "heading": 0, "speed": 0, "velocity": { "x": 0, "y": 0, "z": 0 } }, "group": { "id": 8, "name": "Ground-3", "coalition": "COALITION_BLUE", "category": "GROUP_CATEGORY_GROUND" }, "number_in_group": 1 } } ] }