ExampleGridContourToggle
ExampleGridContourToggle

Purpose

Demonstrates various tools for real-time terrain analysis.

How to Use

The MGRS Grid, Contours, Overlay, Overlay Maximum Angle and Add Gridloc Marker tools function by simple checkbox, dropdown selection or slider UI controls. 

The terrain panel appears by default on scene launch and is divided into the following options:

GUI Debug Menu Navigation

Top Options
  • Toggle format of terrain maps; use the arrows to select between Split LMAB (default) and Single LMAB formats. System/System2 display various real-time stats.
General
  • Clear Terrain – Removes an in-progress or completely loaded terrain map from the scene.
  • Clear Data Cache – Removes …\AppData\LocalLow\USC-ICT\Ride\datacache folder; use this command in the event terrain maps fail to load properly.
  • Center Camera – Places the camera at the defined map center of the terrain map.
Load Terrain
  • Load Trees – Click to toggle off/on. Replaces low-detail tree geometry in the map with various high-fidelity SpeedTree objects; note, may not be available in all maps.
  • Use Camera Pos As Start – Terrain map streams into scene from approximate scene camera location; used in conjunction with Radius slider.
  • Radius – Adjust the slider to change the distance at which terrain tiles are rendered from the current camera position.  
  • Use Asset Bundles – Test command for future delivery method of terrain map data. 
  • Progress – Indicator of approximate completeness for the streaming of the current terrain map into the scene. 
  • Time – Tracks how long the terrain map took to stream into the scene, reaching 100% completion. 
  • Plane – Instances a simple plane object for test purposes; note, does not have tree objects.

Tip

If steaming terrain on a mobile device (Android/iOS) strongly recommend setting the Radius to a value of < 800 to avoid running out of device memory.

Load Terrain – Split LMAB Format & LOD
  • Select a terrain map, choose a LOD setting (lowest selected by default) and then click Load Terrain to begin streaming that terrain map data into the scene. Overall progress statements incrementally appear until loading finishes (1.0 value).
Load Terrain – Single LMAB Format & LOD
  • Select a terrain map, choose a LOD setting (lowest selected by default) and then click Load Terrain to begin streaming that terrain map data into the scene. Overall progress statements incrementally appear until loading finishes (1.0 value).

Important

The steaming of Single LMAB terrain maps, with the exception of those with the “s3” location designation, only function while on the ICT domain. If remote, ensure your ICT VPN is active.

Tip

Navigation Controls: 

  • WASD keys – Move the camera forward/backward/left/right
  • Q/E keys – Lower and raise the camera
  • Use the J key to toggle “free-look” mouse cursor control

Note, terrain loading menu cannot be toggled off currently. Use the top arrows to switch to the smaller system menu.

Scene Location & Name

Assets/Ride/Examples/GridContourToggle/ExampleGridContourToggle.unity

Setup Requirements 

Utilize the Grid Contour Toggle tools by adding related script and prefabs to your scene. Refer to the example scene for all components.  

ExampleGridContourToggle Script

Add this script to an empty object in your scene to enable the contour tools. This script is derived from ExampleLoadTerrain, hence the terrain loading debug panel. Modify as needed to suit your own needs. 

LocationMarker Prefab

To enable the Gridloc Marker tool, add the LocationMarker prefab to your scene, then disable it from startup. The related prefab under the Canvas object will handle the UI.

Canvas and Prefabs

Add a Canvas object to the scene to organize the different UI elements. Next, add the following prefabs as child objects:

  • GeoreferenceDisplayMenu
  • GeoreferenceLocationMarkerMenu
  • ShadingMenu

RideSystems Prefab

Instance the RideSystems prefab in your scene to enable the various necessary RIDE systems. Expand it in the Hierarchy panel, choose ResourceLoader, and add the LocationMarker prefab to the Unit Prefabs section.

Camera

Recommend adding the Simple Terrain Camera script to the Camera object, per the controls described above for manipulating the camera at run-time.