Determine if the line of sight is obstructed by any object in the scene.
How to use the sample
- Open LineOfSight level.
- Click on ArcGISMapActor in the Outliner.
- Set your API key in the Details panel.
- Click play and see the line color change to red if there is any object obstructing the sight.
How it works
- Have an ArcGIS Map with the mesh collider enabled.
- Have a camera with the ArcGIS Camera Component attached for the area.
- 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).
- The moiving object's path is defined by Spline Components.
- The LineOfSignt Actor looks for an instance of the WayPoints Actor and performs a line trace 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.
- Any actors that unintentionally intersect the trace can be added to the
About the data
Building models for New York are loaded from a 3D object scene layer hosted by Esri.
Elevation data is loaded from the Terrain 3D layer hosted by Esri.
Tags
line of sight, raycast, visibility, visibility analysis