Doc and minor improvements to terrainSample.