Returns a list of nearest terrain objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered according to 3D distance to the object (i.e. the closest one will be first in the array).
In contrast to nearestObjects this command returns terrain placed objects like trees, rocks and buildings which don't necessarily need an associated config class.
Since Arma 3 v1.61.136035 it is possible to switch the sorting algorithm off by providing optional param, which significantly increases the performance of this command, especially if the search is performed with large radius.
Since Arma 3 v1.65.138818 it is possible to switch search and sorting mode between 2D and 3D.
Since Arma 3 v1.65.138818 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation.
Be aware that some terrain objects types might be tricky to be found, such as terrain rocks and boulders which are not considered to be "ROCKS" or "ROCK", but "HIDE". Example:
nearestTerrainObjects [player, ["HIDE"], 20]; // [939688: bluntstone_01.p3d,939691: garbagebags_f.p3d,939671: wreck_car_f.p3d,939692: junkpile_f.p3d]
Here is a readout for Altis (as of 1.76), showing you the actual usefulness of the different object-types (some of them are apparently not used/defined at all).
Especially the road type names sadly return nothing.