OrbPro2 a Cesium distribution

Sensor

new Cesium.Sensor(options)

A sensor primitive for visualization and detection. Combines WASM-accelerated geometric detection with shadow map-based occlusion analysis for viewshed.
Name Type Description
options object Configuration options.
Name Type Default Description
scene Scene The scene.
position Cartesian3 Sensor position in world coordinates.
type SensorType SensorType.CONIC optional Sensor geometry type.
radius number Number.POSITIVE_INFINITY optional Range in meters.
orientation Quaternion Quaternion.IDENTITY optional Sensor orientation.
innerHalfAngle number 0.0 optional Inner cone half-angle (conic).
outerHalfAngle number Math.PI/4 optional Outer cone half-angle (conic).
minimumClockAngle number 0.0 optional Minimum azimuth (conic).
maximumClockAngle number 2*Math.PI optional Maximum azimuth (conic).
minimumConeAngle number 0.0 optional Minimum cone angle from +Z for spherical slices.
maximumConeAngle number Math.PI optional Maximum cone angle from +Z for spherical slices.
xHalfAngle number Math.PI/4 optional Horizontal half-angle (rectangular).
yHalfAngle number Math.PI/4 optional Vertical half-angle (rectangular).
directions Array optional Clock/cone angle pairs (custom).
sphericalCap boolean true optional Use spherical cap. When true, shows dome and uses spherical range. When false, open-ended cone with planar boundary.
show boolean true optional Whether visible.
color Color Color.WHITE.withAlpha(0.5) optional Sensor color.
splitDirection SplitDirection SplitDirection.NONE optional Screen split direction for side-by-side comparison rendering.
showViewshed boolean false optional Enable viewshed analysis.
visibleColor Color Color.LIME.withAlpha(0.5) optional Visible terrain color.
occludedColor Color Color.RED.withAlpha(0.5) optional Occluded terrain color.
viewshedVisualizationMode ViewshedVisualizationMode ViewshedVisualizationMode.VISIBILITY optional Viewshed coloring mode.
viewshedRfFrequency number 2.4e9 optional Frequency in Hz for RF path-loss visualization.
viewshedRfAtmosphericLossDbPerKm number 0.0 optional Atmospheric attenuation rate used by RF path-loss visualization.
viewshedRfOccludedLossDb number 35.0 optional Additional loss applied to occluded fragments in RF path-loss visualization.
viewshedRfThresholdDb number 140.0 optional Path-loss threshold used by the legacy analytic RF path-loss shader.
viewshedRfTransitionWidthDb number 6.0 optional Transition band around the RF threshold in analytic RF path-loss mode, or around zero margin in projected RF link-margin mode.
viewshedRfPositiveMarginColor Color Color.LIME.withAlpha(0.55) optional Color for terrain cells with positive link margin.
viewshedRfNegativeMarginColor Color Color.RED.withAlpha(0.55) optional Color for terrain cells with negative link margin.
viewshedRfGoodColor Color optional Legacy alias for `viewshedRfPositiveMarginColor`.
viewshedRfBadColor Color optional Legacy alias for `viewshedRfNegativeMarginColor`.
viewshedQualityHighColor Color Color.LIME.withAlpha(0.55) optional Color used for high-quality visible coverage in the coverage-quality heat map.
viewshedQualityMediumColor Color Color.YELLOW.withAlpha(0.55) optional Color used for mid-quality visible coverage in the coverage-quality heat map.
viewshedQualityLowColor Color Color.RED.withAlpha(0.55) optional Color used for low-quality visible coverage in the coverage-quality heat map.
viewshedQualityDistanceExponent number 1.0 optional Exponent controlling how quickly coverage quality falls off with distance.
viewshedQualityAngleExponent number 1.5 optional Exponent controlling how quickly coverage quality falls off away from boresight.
viewshedPattern object optional Optional radiation pattern used for viewshed clipping and pattern-aware containment tests.
viewshedRfLinkMarginFootprint object optional Optional terrain-analysis-backed projected link-margin raster used by `RF_LINK_MARGIN`.
viewshedResolution number 2048 optional Shadow map resolution.
terrainDetail number optional Terrain detail level within sensor area (1-8, lower=more detail). If not specified, uses the global terrain LOD setting.
terrainDetailMode string "distance" optional Terrain detail distance mode. "distance" uses sensor-to-tile distance, while "forced" caps the far-footprint distance for stable high-detail terrain.
showIntersection boolean true optional Show terrain intersection line.
intersectionColor Color Color.WHITE optional Intersection line color.
intersectionWidth number 2.0 optional Intersection line width.
Example:
// Sensor automatically adds itself to scene.primitives on construction
// and removes itself on destroy().
const sensor = new Cesium.Sensor({
  scene: viewer.scene,
  position: Cesium.Cartesian3.fromDegrees(-122.4, 37.8, 100),
  type: Cesium.Sensor.Type.CONIC,
  outerHalfAngle: Cesium.Math.toRadians(30),
  radius: 5000,
  color: Cesium.Color.CYAN.withAlpha(0.5),
  showViewshed: true,
});

// Viewshed auto-caches when sensor is stationary.
// Force refresh if objects in FOV change:
sensor.refreshViewshed();

// To remove:
sensor.destroy();

Members

static Cesium.Sensor.forceJSFallback : boolean

Set to true to force use of JS fallback instead of WASM for containsPoint. Useful for debugging.

readonly ready : Promise.<void>

A promise that resolves when the sensor's WASM handle is ready. Await this before calling containsPoint() to ensure WASM is initialized.

sphericalCap : boolean

Whether to use spherical cap for the sensor. When true (default), the sensor shows a dome at the range boundary and detection uses spherical distance (dist < range). When false, the cone is visually open-ended and detection uses a planar boundary perpendicular to boresight (z < range in local coordinates).
Default Value: true
Gets or sets the split direction used for side-by-side comparison rendering.

stopAtOcclusion : boolean

Whether to clip the sensor volume at terrain/geometry occlusion points. When true and viewshed is enabled, the sensor volume will stop rendering at terrain and geometry that blocks the line of sight. Requires viewshed to be enabled. Default is true. Note: Changing this requires rebuilding the sensor geometry.

terrainDetail : number|undefined

The terrain detail level within the sensor's viewshed area. Value from 1-8, where 1 is highest detail and 8 is lowest. Set to undefined to use the global terrain LOD setting. Lower values require more GPU/CPU but provide more accurate viewshed.

terrainDetailMode : string

The terrain detail distance mode within the sensor's viewshed area. "distance" refines terrain based on distance from the sensor, while "forced" caps far-footprint terrain distance for stable high-detail terrain.
See:

viewshedDepthBias : number

Gets or sets the depth-comparison bias used by viewshed visibility tests. Expressed in normalized depth units relative to the shadow-map reference distance of 10,000 km. Default 1e-7. Larger values eliminate the per-pixel "zebra" banding caused by shadow-map quantization at the cost of fine-scale occlusion detail; smaller values preserve detail but may reintroduce banding. Tunable at runtime — no rebuild needed.

viewshedDirty : boolean

Whether the viewshed needs to be re-rendered. Automatically set to true when position, orientation, or intersection settings change. Set this to true or call Sensor#refreshViewshed to force an update.

viewshedPositiveLinkFootprint : object|undefined

Optional terrain-analysis-backed positive-link footprint overlay for viewshed terrain shading.

viewshedQualityAngleExponent : number

Gets or sets the boresight-falloff exponent used by the coverage-quality heat map.

viewshedQualityDistanceExponent : number

Gets or sets the distance-falloff exponent used by the coverage-quality heat map.

viewshedQualityHighColor : Color

Gets or sets the high-quality color used by the coverage-quality heat map.

viewshedQualityLowColor : Color

Gets or sets the low-quality color used by the coverage-quality heat map.

viewshedQualityMediumColor : Color

Gets or sets the medium-quality color used by the coverage-quality heat map.

viewshedRfAtmosphericLossDbPerKm : number

Gets or sets the atmospheric attenuation rate used by RF viewshed visualization.
Legacy alias for `viewshedRfNegativeMarginColor`.

viewshedRfFrequency : number

Gets or sets the RF frequency used by RF viewshed visualization.
Legacy alias for `viewshedRfPositiveMarginColor`.

viewshedRfLinkMarginFootprint : object|undefined

Optional terrain-analysis-backed projected RF link-margin raster.

viewshedRfNegativeMarginColor : Color

Gets or sets the negative link-margin color used by RF terrain overlays.

viewshedRfOccludedLossDb : number

Gets or sets the occlusion penalty applied in RF viewshed visualization.

viewshedRfPositiveMarginColor : Color

Gets or sets the positive link-margin color used by RF terrain overlays.

viewshedRfThresholdDb : number

Gets or sets the RF path-loss threshold.

viewshedRfTransitionWidthDb : number

Gets or sets the transition band around the RF threshold.
Gets or sets the viewshed visualization mode.

Methods

static Cesium.Sensor.createCoverageRequestFromEntity(options)object

Builds a sensor-coverage module request from an OrbPro Sensor graphics object attached to a propagated entity. The module owns footprint and swath projection; this helper only samples the entity's propagated state and carries sensor semantics into the request.
Name Type Description
options object Options.
Name Type Default Description
entity Entity Entity with conicSensor or rectangularSensor.
startTime JulianDate Start time.
stopTime JulianDate Stop time.
grid object Coverage grid definition.
sampleCount number 9 optional Number of propagated samples.
figureOfMerit string "percent_coverage" optional Figure of merit.
colorMap string "orbpro_coverage" optional Color map name.
Returns:
JSON-serializable coverage request.

static Cesium.Sensor.debugEvaluateSDF(sensor, point)object

Debug method to evaluate SDF for a specific point against a sensor. This uses the already-loaded WASM backend, avoiding import path issues.
Name Type Description
sensor Sensor The sensor instance to debug.
point Cartesian3 Point in world coordinates.
Returns:
Debug info about the SDF evaluation.

static Cesium.Sensor.debugWasmState(sensor)object

Debug method to get WASM sensor state for a specific sensor. This uses the already-loaded WASM backend, avoiding import path issues.
Name Type Description
sensor Sensor The sensor instance to debug.
Returns:
Debug info about the sensor's WASM state.

static Cesium.Sensor.ensureWasmReady()Promise.<boolean>

Ensures the WASM backend is loaded and ready for sensor operations. Call this once before creating any sensors that will use containsPoint().
Returns:
Resolves to true when WASM is ready.
Throws:
  • Error : If WASM backend fails to initialize.
Example:
await Cesium.Sensor.ensureWasmReady();
const sensor = new Cesium.Sensor({ ... });
sensor.containsPoint(point); // Now works

static Cesium.Sensor.isWasmReady()boolean

Checks if the WASM backend is currently initialized and ready.
Returns:
True if WASM is ready for use.

applyViewshedLinkMarginConfiguration(configuration)

Apply projected RF link-margin visualization settings in one update.
Name Type Description
configuration object RF link-margin configuration.

applyViewshedProbabilityConfiguration(configuration)

Name Type Description
configuration object RF link-margin configuration.

applyViewshedQualityConfiguration(configuration)

Apply coverage-quality heat-map settings in one update.
Name Type Description
configuration object Coverage-quality visualization configuration.

applyViewshedRfConfiguration(configuration)

Apply RF viewshed visualization settings in one update.
Name Type Description
configuration object RF viewshed configuration.

containsPointGeometrically(point)boolean

Tests geometric containment only. This intentionally excludes body occlusion, terrain occlusion, and shadow-map visibility so higher-level access logic can layer those concerns independently.
Name Type Description
point Cartesian3 Point in world coordinates.
Returns:
True if the point is geometrically inside the sensor volume.

debugContainsPoint(point)object

Debug method to compare JS and WASM containsPoint results. Call this to diagnose mismatches between JS and WASM implementations.
Name Type Description
point Cartesian3 Point in world coordinates.
Returns:
Debug info comparing JS and WASM results.

evaluateGeometricContainmentSdf(point)number|undefined

Evaluates the geometric signed-distance function for this sensor when a handle-backed WASM containment primitive is available.
Name Type Description
point Cartesian3 Point in world coordinates.
Returns:
Signed distance in meters, or undefined when a non-SDF containment path is active.

getEntitiesInVolume(entities, time, options)Array.<Entity>

Gets entities inside the sensor volume.
Name Type Description
entities EntityCollection Entity collection to check.
time JulianDate Time to evaluate positions.
options object optional Options object.
Name Type Default Description
occlusionAware boolean false optional If true and viewshed is enabled, entities must also be visible (not occluded by terrain) to be included.
Returns:
Entities inside the sensor volume.

getPointsInVolume(points, options)Array.<number>

Gets indices of points inside the sensor volume (batch operation).
Name Type Description
points Array.<Cartesian3> Array of points to test.
options object optional Options object.
Name Type Default Description
occlusionAware boolean false optional If true and viewshed is enabled, points must also be visible (not occluded by terrain) to be included.
Returns:
Indices of points inside the sensor.

hasAccess(targetPosition, options)boolean

Tests whether this sensor has access to a target position using a multi-tier filtering pipeline ordered from cheapest to most expensive: 1. Range check (<0.001ms) 2. Body occlusion via WASM (~0.005ms) or JS EllipsoidalOccluder (~0.01ms fallback) 3. FOV containment via WASM (~0.1ms) 4. Terrain occlusion via GPU readback (~1ms, opt-in)
Name Type Description
targetPosition Cartesian3 World-space target position.
options object optional Options.
Name Type Default Description
bodyOcclusion boolean true optional Check Earth body occlusion.
terrainOcclusion boolean false optional Check terrain occlusion (GPU, expensive).
ellipsoid Ellipsoid Ellipsoid.WGS84 optional Ellipsoid for body occlusion (JS fallback only).
Returns:
True if the sensor has access to the target.
Manually triggers a viewshed shadow map update. Use this when objects in the sensor's field of view have moved and you want to refresh the occlusion analysis. The viewshed automatically updates when the sensor position or orientation changes, but objects moving within the FOV won't trigger an update.
Example:
// Force refresh when a building in the FOV was added/moved:
sensor.refreshViewshed();
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.