Paged Terrain Tutorial

NameLocation
Paged Terrain<Vortex Studio Installation Folder>\tutorials\ExPagedTerrain

This tutorial how to create a paged terrain extension.

A paged terrain extension allows a user to feed the simulation with terrain information.

A classic example would be simulating driving on a large map. Since the map is too big to be created in Vortex, the client database can be used to feed Vortex as needed.

The extension is usually added to a scene or a setup. It manages a Terrain Producer, which answer to a VxTerrainInterface.

Vortex will detect when a terrain tile is needed, based on the location of dynamics objects and will query the interface for terrain information.

The tutorial shows how to add a terrain surface and objects such as trees and post.

Classes

TerrainSource

This source is a virtual database with its own interface. It is completely unrelated to Vortex structure.

The Internal implementation of the source is not of interest for the tutorial and is provided as an example

The source simulates an infinite terrain made of predefined features.
Here the infinite terrain goes as follow :

  • One surface for each request. The surface can return an height at given position
  • One Tree by request located near a corner of the surface
  • One Post at each 72X72 grid point.

The source was built to be called in a specific sequence:

  1. SearchFeatureIntersecting returns some FeatureKey
  2. FeatureTypeFromKey and GetXX can be called with FeatureKey returned in 1. of current sequence.
  3. Restart at point 1.

PagedTerrain

This class adapts the content of a given source to Vortex as a paged terrain.

Its role is to:

  1. Retrieve from the source, upon request, the objects laying in a region of interest.
  2. Convert the retrieved objects into Vortex objects.
  3. Insert the objects into the terrain producer.
  4. Inform the producer that the object lies in the new region requested. This must be done even if the retrieved object is already in the terrain producer; in this case, there is no need to perform step #2.
  5. function in an asynchronous, or non-blocking, manner.

PagedTerrainExtension

The paged terrain extension adds a paged terrain producer for simulation of a client terrain database to a Vortex simulation.

The paged terrain extension will then automatically create terrain elements where needed to support collisions with the mechanism you have added to the scene.


See Vortex Studio SDK - Paged Terrain Producer for more information

Using the tutorial

  1. Open Tutorials solution
  2. Compile the ExPagedTerrain project.
  3. Deploy the plugin
  4. The code is fully documented for extra information.
  5. Launch the Vortex Editor
  6. Create a scene
  7. Add the paged terrain. It can be found under the "Tutorials" category in the editor's toolbox.
  8. Add some vehicles from the Vortex Studio Samples 
  9. Save the scene.
  10. Start the simulation
  11. If required, move the mechanism slightly from its initial location before starting the simulation, so that it does not start directly inside a post or a tree geometry, or underneath the terrain surface produced by the paged terrain extension.
  12. By moving the vehicle around, new tiles of terrain should be generated as needed.