MCPcopy
hub / github.com/CesiumGS/cesium / sampleTerrain

Function sampleTerrain

packages/engine/Source/Core/sampleTerrain.js:46–63  ·  view source on GitHub ↗

* Initiates a terrain height query for an array of Cartographic positions by * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation * matches the triangles used to render the terrain at the specified level. The query * happens asynchronously, so this

(
  terrainProvider,
  level,
  positions,
  rejectOnTileFail,
)

Source from the content-addressed store, hash-verified

44 * }
45 */
46async function sampleTerrain(
47 terrainProvider,
48 level,
49 positions,
50 rejectOnTileFail,
51) {
52 if (!defined(rejectOnTileFail)) {
53 rejectOnTileFail = false;
54 }
55 //>>includeStart('debug', pragmas.debug);
56 Check.typeOf.object("terrainProvider", terrainProvider);
57 Check.typeOf.number("level", level);
58 Check.typeOf.bool("rejectOnTileFail", rejectOnTileFail);
59 Check.defined("positions", positions);
60 //>>includeEnd('debug');
61
62 return doSampling(terrainProvider, level, positions, rejectOnTileFail);
63}
64
65/**
66 * @param {object[]} tileRequests The mutated list of requests, the first one will be attempted

Callers 5

testFunction · 0.90
testFunction · 0.85
testFunction · 0.85

Calls 3

doSamplingFunction · 0.85
objectMethod · 0.80
definedFunction · 0.70

Tested by 3

testFunction · 0.72
testFunction · 0.68
testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…