Skip to content

Commit

Permalink
Line of sight readme improvements (#27)
Browse files Browse the repository at this point in the history
* Update readme

* reduce the image size

* Apply suggestions from code review

Co-authored-by: Jade Huang <jadehuang@esri.com>

* Apply suggestions from code review

Co-authored-by: Andy Ren <aren@esri.com>
Co-authored-by: Jade Huang <jadehuang@esri.com>

Co-authored-by: Jade Huang <jadehuang@esri.com>
Co-authored-by: Andy Ren <aren@esri.com>
  • Loading branch information
3 people authored Nov 15, 2022
1 parent 2c067ae commit f228a84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 15 additions & 8 deletions sample_project/Content/SampleViewer/Samples/LineOfSight/readme.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# Line of sight
# Determine the visibility for a line of sight

Determine if the line of sight is obstructed by any object in the scene.

![Image of line of sight](LineOfSight.jpg)

## How to use the sample

1. Open **LineOfSight** level.
2. Click on **ArcGISMapActor** in the **Outliner**.
3. Set your API key in the **Details** panel.
4. Click play and see the line color change to red if there is any object obstructing the sight.

## How it works

1. Ensure the box for **Enable Mesh Colliders** on the `ArcGIS Map View` component of `ArcGIS Map Actor` is checked.
2. Add a `Line of Sight` and a `Way Points` actor to the scene and place them at the desired locations.
3. Modify the `Path Spline` component of the `Way Points` actor to define the path that the target object is moving along.
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.
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.
6. The visual cue for the line of sight changes its color depending on whether the line trace hits the target object or not.
1. Have an ArcGIS Map with the [mesh collider](https://developers.arcgis.com/unreal-engine/maps/mesh-collider/) enabled.
2. Have a camera with the [**ArcGIS Camera Component**](https://developers.arcgis.com/unreal-engine/maps/camera/#arcgis-camera-component) attached for the area.
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).
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/).
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.
- Any actors that unintentionally intersect the trace can be added to the `Actors to Ignore` of the line trace in the **LineOfSignt** Actor blueprint.
- The visual cue for the line of sight changes its color depending on whether the line trace hits the target object or not.

## About the data

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.

WorldElevation3D/Terrain3D
Elevation data is loaded from the [Terrain 3D layer](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) hosted by Esri.

## Tags
Expand Down

0 comments on commit f228a84

Please sign in to comment.