|
1 | | -# Line of sight |
| 1 | +# Determine the visibility for a line of sight |
2 | 2 |
|
3 | 3 | Determine if the line of sight is obstructed by any object in the scene. |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
| 7 | +## How to use the sample |
| 8 | + |
| 9 | +1. Open **LineOfSight** level. |
| 10 | +2. Click on **ArcGISMapActor** in the **Outliner**. |
| 11 | +3. Set your API key in the **Details** panel. |
| 12 | +4. Click play and see the line color change to red if there is any object obstructing the sight. |
| 13 | + |
7 | 14 | ## How it works |
8 | 15 |
|
9 | | -1. Ensure the box for **Enable Mesh Colliders** on the `ArcGIS Map View` component of `ArcGIS Map Actor` is checked. |
10 | | -2. Add a `Line of Sight` and a `Way Points` actor to the scene and place them at the desired locations. |
11 | | -3. Modify the `Path Spline` component of the `Way Points` actor to define the path that the target object is moving along. |
12 | | -4. The `Line of Sight` actor looks for an instance of `Path Splnie` at `Begin Play` and performs a line trace between them at each frame. |
13 | | -5. Any actors that unintentionally interfere with the trace can be added to the `Actors to Ignore` argument of the line trace in the `Line of Sight` blueprint. |
14 | | -6. The visual cue for the line of sight changes its color depending on whether the line trace hits the target object or not. |
| 16 | +1. Have an ArcGIS Map with the [mesh collider](https://developers.arcgis.com/unreal-engine/maps/mesh-collider/) enabled. |
| 17 | +2. Have a camera with the [**ArcGIS Camera Component**](https://developers.arcgis.com/unreal-engine/maps/camera/#arcgis-camera-component) attached for the area. |
| 18 | +3. Have an Actor for checking line of sight (**LineOfSight** Actor) and another for defining the path that the target object is moving along (**WayPoints** Actor). |
| 19 | +4. The moiving object's path is defined by [Spline Components](https://docs.unrealengine.com/5.0/en-US/blueprint-spline-components-overview-in-unreal-engine/). |
| 20 | +5. The **LineOfSignt** Actor looks for an instance of the **WayPoints** Actor and performs a [line trace](https://docs.unrealengine.com/5.0/en-US/BlueprintAPI/Collision/LineTraceByChannel/) between them at each frame. |
| 21 | + - Any actors that unintentionally intersect the trace can be added to the `Actors to Ignore` of the line trace in the **LineOfSignt** Actor blueprint. |
| 22 | + - The visual cue for the line of sight changes its color depending on whether the line trace hits the target object or not. |
15 | 23 |
|
16 | 24 | ## About the data |
17 | 25 |
|
18 | 26 | Building models for New York are loaded from a [3D object scene layer](https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/New_York_LoD2_3D_Buildings/SceneServer/layers/0) hosted by Esri. |
19 | 27 |
|
20 | | -WorldElevation3D/Terrain3D |
21 | 28 | Elevation data is loaded from the [Terrain 3D layer](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) hosted by Esri. |
22 | 29 |
|
23 | 30 | ## Tags |
|
0 commit comments