Communicator.View

 View

Object representing the view associated to a model. All major functionality that affects how a model is rendered including the currently active camera, the view mode and other functionality like selection are part of this object.

Methods

Methods

addLight

advanceIncrementalSelection

  • Returns the next batch of geometry selected by the supplied selection context.

    Parameters

    Returns Promise<NodeSelectionItem[] | null>

    Returns selected items. If the resulting list is null then there are no more items to select.

advanceVolumeSelection    [deprecated]

beginConvexPolyhedronSelection

  • Creates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.

    Parameters

    • volumePlanes: Plane[]

      The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.

    • heuristicOrigin: Point3

      A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.

    • config: IncrementalPickConfig

      The configuration object used for this selection operation.

    Returns Promise<IncrementalSelectionId>

    The handle for the selection context.

beginRayDrillSelection

  • Creates a new and active selection context for the provided selection ray. The ray is created at the supplied ray origin and is cast into the scene. Faces are selected if they lie along the ray. Lines and points are selected if they lie within the ray's box radius.

    Parameters

    • rayCssOrigin: Point2

      The coodinate in CSS pixel space for the selection ray's origin.

    • rayCssBoxRadius: number

      The radius around the ray in CSS pixel space used for line and point selection proximity.

    • config: IncrementalPickConfig

      The configuration object used for this selection operation.

    Returns Promise<IncrementalSelectionId>

    The handle for the selection context.

beginScreenSelectByArea

  • Creates a new and active selection context for the provided selection window.

    Parameters

    • areaCssMin: Point2

      The minimum coodinate in CSS pixel space for the selection window.

    • areaCssMax: Point2

      The maximum coodinate in CSS pixel space for the selection window.

    • config: IncrementalPickConfig

      The configuration object used for this selection operation.

    Returns Promise<IncrementalSelectionId>

    The handle for the selection context.

beginSphereSelection

  • Creates a new and active selection context for the provided selection sphere.

    Parameters

    • sphereCenter: Point3

      The center of the selection sphere.

    • sphereRadius: number

      The radius of the selection sphere.

    • config: IncrementalPickConfig

      The configuration object used for this selection operation.

    Returns Promise<IncrementalSelectionId>

    The handle for the selection context.

centerCameraOnNode

  • centerCameraOnNode(nodeId: NodeId, duration?: number, camera?: Camera): Promise<void>
  • Centers the camera on a specified node id.

    Parameters

    • nodeId: NodeId
    • Optional duration: number

      the number of milliseconds to transition to the new camera.

    • Optional camera: Camera

    Returns Promise<void>

clearLights

  • clearLights(): void
  • Removes all lights from the scene. When there are no lights, material colors are drawn at full intensity. This has the same visual effect as calling setLightingEnabled(false).

    See also:

    Returns void

compositePickFromPoint

  • Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.

    Parameters

    • point: Point2

      Canvas position to pick from.

    • config: PickConfig

      The configuration object used for this picking operation.

    Returns Promise<CompositeSelectionItem>

    An object containing the result of the picking operation.

endComparison

  • endComparison(): void
  • Disables a visual comparison of two sets of nodes enabled by startComparison.

    Returns void

endIncrementalSelection

endVolumeSelection    [deprecated]

fitBounding

  • fitBounding(bounding: Box, duration?: number, camera?: Camera): Promise<void>
  • Fits the camera to the bounding box.

    Parameters

    • bounding: Box

      bounding box to fit the camera.

    • Optional duration: number

      Time in milliseconds for the camera transition to the new camera view.

    • Optional camera: Camera

    Returns Promise<void>

    A promise that will be resolved once the transition is complete.

fitNodes

  • fitNodes(ids: NodeId[], duration?: number): Promise<void>
  • Fits the camera to the bounding box containing the node ids.

    Parameters

    • ids: NodeId[]
    • Optional duration: number

      Time in milliseconds for the camera transition to the new camera view.

    Returns Promise<void>

    A promise that will be resolved once the transition is complete.

fitWorld

  • fitWorld(duration?: number, camera?: Camera): Promise<void>
  • Fits the view to the model bounding box.

    Parameters

    • Optional duration: number

      the number of milliseconds to transition to the new camera.

    • Optional camera: Camera

    Returns Promise<void>

    A promise that will be resolved once the transition is complete.

getAmbientLightColor

  • getAmbientLightColor(): Color

getAmbientOcclusionEnabled

  • getAmbientOcclusionEnabled(): boolean
  • Returns boolean

    boolean value indicating whether ambient occlusion is enabled

getAmbientOcclusionRadius

  • getAmbientOcclusionRadius(): number
  • Returns number

    the ambient occlusion radius

getAntiAliasingMode

  • Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA

    Returns AntiAliasingMode

    the current anti-aliasing mode.

getAxisTriad

getBackfacesVisible

  • getBackfacesVisible(): boolean
  • Gets whether backfaces are being rendered in the scene.

    Returns boolean

    Boolean value indicating whether backfaces are being rendered in the scene.

getBackgroundColor

  • Returns the background colors of the canvas.

    Returns VerticalGradient

    the canvas background colors.

getBloomEnabled

  • getBloomEnabled(): boolean

getBloomIntensityScale

  • getBloomIntensityScale(): number

getBloomLayers

  • getBloomLayers(): BloomLayerInfo[]
  • Returns an array of objects describing each layer in the bloom effect.

    See setBloomLayers.

    Returns BloomLayerInfo[]

getBloomThreshold

  • getBloomThreshold(): number

getBloomThresholdRampWidth

  • getBloomThresholdRampWidth(): number

getBoundingCalculationIgnoresInvisible

  • getBoundingCalculationIgnoresInvisible(): boolean
  • Returns boolean

    whether or not bounding calculations by this View object ignores invisible geometry.

getCamera

  • Gets the current camera

    Returns Camera

    the current camera

getCanvasSize

  • Returns the size of the viewer canvas.

    Returns Point2

    the current size of the viewer canvas.

getDrawMode

  • Returns DrawMode

    The current draw mode

getEyeDomeLightingBlurEdgeDistance

  • getEyeDomeLightingBlurEdgeDistance(): Promise<number>
  • Returns a value that controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is a proportion of the screen size.

    Returns Promise<number>

getEyeDomeLightingBlurInterval

  • getEyeDomeLightingBlurInterval(): Promise<number>
  • Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.

    Returns Promise<number>

getEyeDomeLightingBlurSamples

  • getEyeDomeLightingBlurSamples(): Promise<number>
  • Returns the diameter of the blur filter used in eye-dome lighting for point clouds. A value of 0 means that blurring is disabled.

    Returns Promise<number>

getEyeDomeLightingEnabled

  • getEyeDomeLightingEnabled(): Promise<boolean>
  • Returns Promise<boolean>

    boolean value indicating if eye-dome lighting is enabled or disabled.

getEyeDomeLightingOpacity

  • getEyeDomeLightingOpacity(): Promise<number>
  • Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].

    Returns Promise<number>

getEyeDomeLightingShadingEdgeDistance

  • getEyeDomeLightingShadingEdgeDistance(): Promise<number>
  • Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.

    Returns Promise<number>

getFaceVisibility

  • getFaceVisibility(): boolean
  • Gets the face visibility for the view.

    Returns boolean

    whether faces are currently being drawn.

getFullCameraMatrix

  • getFullCameraMatrix(): Matrix
  • This is equivalent to (projectionMatrix * viewMatrix).

    Returns Matrix

    The current full camera matrix.

getGroundPlane

  • Returns information about the invisible ground plane onto which simple shadows and reflections are projected.

    See also:

    Returns GroundPlane

getHardEdgeColor

  • getHardEdgeColor(): Color

getHardEdgeOpacity

  • getHardEdgeOpacity(): number

getHardEdgeThreshold

  • getHardEdgeThreshold(): number

getHardEdgeThresholdRampWidth

  • getHardEdgeThresholdRampWidth(): number

getHardEdgesEnabled

  • getHardEdgesEnabled(): boolean
  • Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.

    Hard edges are always enabled in hidden line mode, regardless of the return value.

    See setHardEdgesEnabled.

    Returns boolean

getHiddenLineSettings

getInteractiveDrawLimitIncreaseEnabled

  • getInteractiveDrawLimitIncreaseEnabled(): Promise<boolean>
  • Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.

    Returns Promise<boolean>

    boolean value indicating whether this feature is enabled or not

getLightingEnabled

  • getLightingEnabled(): boolean

getLineVisibility

  • getLineVisibility(): boolean
  • Gets the line visibility for the view.

    Returns boolean

    whether lines are currently being drawn.

getNavCube

getPointShape

getPointSize

getProjectionMatrix

  • getProjectionMatrix(): Matrix
  • Gets the projection matrix.

    Returns Matrix

    The current projection matrix.

getProjectionMode

  • Gets the projection mode.

    Returns Projection

    The current projection mode.

getSilhouetteColor

  • getSilhouetteColor(): Color

getSilhouetteEnabled

  • getSilhouetteEnabled(): boolean
  • Returns whether silhouette edges are enabled.

    Silhouette edges are always enabled in hidden line mode, regardless of the return value.

    See setSilhouetteEnabled.

    Returns boolean

getSilhouetteOpacity

  • getSilhouetteOpacity(): number

getSilhouetteThreshold

  • getSilhouetteThreshold(): number
  • Returns the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

    The value is a proportion of the canvas size and not a world-space distance.

    See also:

    Returns number

getSilhouetteThresholdRampWidth

  • getSilhouetteThresholdRampWidth(): number

getSimpleReflectionAttenuation

  • getSimpleReflectionAttenuation(): object
  • Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.

    Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

    Attenuation is disabled if farDistance is less than or equal to nearDistance.

    See also:

    Returns object

    An object with the following properties:

    • farDistance: number

      The distance from the ground plane at which the model is completely faded.

    • nearDistance: number

      The distance from the ground plane at which the model begins to fade.

    • unit: SimpleReflectionAttenuationUnit

      The unit in which nearDistance and farDistance are specified.

getSimpleReflectionBlurInterval

getSimpleReflectionBlurSamples

  • getSimpleReflectionBlurSamples(): number

getSimpleReflectionEnabled

  • getSimpleReflectionEnabled(): boolean

getSimpleReflectionFadeAngle

  • getSimpleReflectionFadeAngle(): number
  • Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

    A value to 0 means that the fading effect is disabled.

    Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

    See also:

    Returns number

getSimpleReflectionOpacity

  • getSimpleReflectionOpacity(): number

getSimpleShadowBlurInterval

  • getSimpleShadowBlurInterval(): number

getSimpleShadowBlurSamples

  • getSimpleShadowBlurSamples(): number

getSimpleShadowColor

  • getSimpleShadowColor(): Color

getSimpleShadowEnabled

  • getSimpleShadowEnabled(): boolean

getSimpleShadowInteractiveUpdateEnabled

  • getSimpleShadowInteractiveUpdateEnabled(): boolean

getSimpleShadowOpacity

  • getSimpleShadowOpacity(): number

getSimpleShadowResolution

  • getSimpleShadowResolution(): number

getViewMatrix

  • Gets the view matrix.

    Returns Matrix

    The current view matrix.

getViewOrientationCamera

  • Returns a camera set to a ViewOrientation

    Parameters

    • orientation: ViewOrientation

      The desired view orientation for the camera.

    • Optional bounding: Box

      Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

    • Optional preserveModelUp: boolean

    Returns Promise<Camera>

isolateNodes

  • isolateNodes(nodeIds: NodeId[], duration?: number, fitNodes?: boolean, initiallyHiddenStayHidden?: boolean | null): Promise<void>
  • Hides all nodes except those specified. Also fits the camera to those nodes' bounding box.

    Parameters

    • nodeIds: NodeId[]

      An array of the node IDs to be isolated.

    • Optional duration: number

      Time in milliseconds for the camera transition to the new camera view.

    • Optional fitNodes: boolean

      If true, then the view is fitted around the isolated nodes.

    • Optional initiallyHiddenStayHidden: boolean | null

      Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by setBehaviorInitiallyHidden.

    Returns Promise<void>

pickAllFromPoint

  • pickAllFromPoint(point: Point2, config: PickConfig): Promise<NodeEntitySelectionItem[]>
  • Performs a picking operation from the given position on the canvas. All candidate entities are returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

    Parameters

    • point: Point2

      Canvas position to pick from.

    • config: PickConfig

      The configuration object used for this picking operation.

    Returns Promise<NodeEntitySelectionItem[]>

    An object containing the result of the picking operation.

pickAllFromRay

  • pickAllFromRay(ray: Ray, config: PickConfig): Promise<NodeEntitySelectionItem[]>
  • Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.

    Parameters

    • ray: Ray

      The world-space ray to perform the selection with.

    • config: PickConfig

      The configuration object used for this picking operation.

    Returns Promise<NodeEntitySelectionItem[]>

    An object containing the result of the picking operation.

pickFromPoint

  • Performs a picking operation from the given position on the canvas. The best candidate entity is be returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

    Parameters

    • point: Point2

      Canvas position to pick from.

    • config: PickConfig

      The configuration object used for this picking operation.

    Returns Promise<SelectionItem>

    An object containing the result of the picking operation.

pickFromRay

  • Performs a selection operation from the given world-space ray. The best candidate entity is be returned. This method does not trigger a selection event.

    Parameters

    • ray: Ray

      The world-space ray to perform the selection with.

    • config: PickConfig

      The configuration object used for this picking operation.

    Returns Promise<SelectionItem>

    An object containing the result of the picking operation.

pointToWindowPosition

  • Creates a normalized window position in the range of (-1, 1) for a given point in window space.

    Parameters

    Returns Point2

    the normalized window position

projectPoint

  • Projects a 3d world space point to a 3d screen space point.

    Parameters

    • source: Point3
    • Optional camera: Camera

      if a camera is provided, its projection and view matrix will be used.

    Returns Point3

    point projected into 3d screen space.

raycastFromPoint

  • raycastFromPoint(point: Point2): Ray | null
  • Creates a ray based on a viewport position.

    Parameters

    • point: Point2

      The (X, Y) viewport position.

    Returns Ray | null

    The ray if it was generated, otherwise null.

removeLight

resetCamera

  • resetCamera(duration?: number): Promise<void>
  • Resets the camera to the initial view of the model when first loaded.

    Parameters

    • Optional duration: number

      the amount of time in milliseconds that the camera transition between the current and initial view should take.

    Returns Promise<void>

setAmbientLightColor

  • setAmbientLightColor(value: Color): void
  • Sets the color of the ambient light applied to the scene. This is a constant source of light that affects every point in the scene in the same way regardless of position or surface normal.

    See also getAmbientLightColor.

    Parameters

    Returns void

setAmbientOcclusionEnabled

  • Sets whether ambient occlusion is enabled

    Parameters

    • Optional enabled: boolean

      sets whether ambient occlusion will be enabled

    Returns DeprecatedPromise

setAmbientOcclusionRadius

  • Sets the ambient occlusion radius. This value represents the maximum screen-proportional distance between two points such that one will cast a shadow on the other.

    Parameters

    • radius: number

      the ambient occlusion radius.

    Returns DeprecatedPromise

setAntiAliasingMode

setBackfacesVisible

  • Sets whether backfaces should be rendered in the scene.

    Parameters

    • visible: boolean

      Boolean value indicating whether backfaces should be rendered.

    Returns DeprecatedPromise

    Promise that is resolved when this operation has completed.

setBackgroundColor

  • Sets the viewer background color to a gradient interpolating from the top to bottom color. For a solid color, the top and bottom color should have the same values. Background Transparency is only available with client-side rendering. To re-enable a transparent background, pass null to the parameters of this function.

    Parameters

    • Optional top: Color | null

      the top color for the the background gradient.

    • Optional bottom: Color | null

      the bottom color for the the background gradient.

    Returns DeprecatedPromise

    a promise that resolves when the operation has completed.

setBloomEnabled

  • setBloomEnabled(value?: boolean): void
  • Sets whether bloom is enabled.

    See getBloomEnabled.

    Parameters

    • Optional value: boolean

    Returns void

setBloomIntensityScale

  • setBloomIntensityScale(value: number): void
  • Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by setBloomLayers.

    See getBloomIntensityScale.

    Parameters

    • value: number

    Returns void

setBloomLayers

  • setBloomLayers(layers: BloomLayerInfo[]): void
  • Sets the number of layers in the bloom effect and the layers' attributes.

    The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.

    See BloomLayerInfo, getBloomLayers.

    Parameters

    • layers: BloomLayerInfo[]

    Returns void

setBloomThreshold

  • setBloomThreshold(value: number): void

setBloomThresholdRampWidth

  • setBloomThresholdRampWidth(value: number): void
  • Sets how much greater than the threshold set by setBloomThreshold a pixel's luminance value must be before it contributes fully to the bloom effect.

    If the pixel's luminance value does not exceed the threshold by at least the amount set by this function, the pixel's contribution will be diminished based on how close its luminance value is to the threshold.

    See getBloomThresholdRampWidth.

    Parameters

    • value: number

    Returns void

setBoundingCalculationIgnoresInvisible

  • setBoundingCalculationIgnoresInvisible(value: boolean): void
  • Sets whether or not bounding calculations by this View object ignores invisible geometry.

    Parameters

    • value: boolean

    Returns void

setCamera

  • setCamera(camera: Camera | null, duration?: number): boolean
  • Sets the current camera

    Parameters

    • camera: Camera | null

      the camera to set

    • Optional duration: number

      camera transition time in milliseconds

    Returns boolean

setDisplayIncompleteFrames

  • Sets whether intermediate frames of an incremental draw will be displayed. (default: true)

    If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call setInteractiveDrawDelay with a value of 0.

    Parameters

    • value: boolean

    Returns DeprecatedPromise

setDrawMode

setEyeDomeLightingBlurEdgeDistance

  • Controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is taken as a proportion of the screen size. Decreasing the value will result in sharper edges, and increasing the value will result in softer edges. (default: .03)

    Parameters

    • value: number

    Returns DeprecatedPromise

setEyeDomeLightingBlurInterval

  • Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)

    Parameters

    • value: number

    Returns DeprecatedPromise

setEyeDomeLightingBlurSamples

  • Sets the diameter of the blur filter used in eye-dome lighting for point clouds. Setting the value to 0 will disable blurring. (default: 7)

    Parameters

    • value: number

    Returns DeprecatedPromise

setEyeDomeLightingEnabled

  • Enables or disables eye-dome lighting for point clouds. (default: disabled)

    Parameters

    • Optional enabled: boolean

    Returns DeprecatedPromise

setEyeDomeLightingOpacity

  • Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)

    Parameters

    • value: number

      A number in the range [0,1].

    Returns DeprecatedPromise

setEyeDomeLightingShadingEdgeDistance

  • Controls the shading contrast in eye-dome lighting for point clouds. The value is taken as a number of pixels. Increasing the value will result in overall lighter shading, and decreasing the value will result in overall darker shading. (default: 2)

    Parameters

    • value: number

    Returns DeprecatedPromise

setFaceVisibility

  • Sets the face visibility for the view.

    Parameters

    • faceVisibility: boolean

      indicates whether to draw faces.

    Returns DeprecatedPromise

setGroundPlane

setHardEdgeColor

  • setHardEdgeColor(value: Color): void

setHardEdgeOpacity

  • setHardEdgeOpacity(value: number): void

setHardEdgeThreshold

  • setHardEdgeThreshold(degrees: number): void

setHardEdgeThresholdRampWidth

  • setHardEdgeThresholdRampWidth(degrees: number): void
  • Controls how quickly edges fade as the angle between adjacent faces decreases.

    This value is added to the one set by setHardEdgeThreshold to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

    Setting this value to 0 will cause all edges to be drawn at full opacity.

    See also:

    Parameters

    • degrees: number

    Returns void

setHardEdgesEnabled

  • setHardEdgesEnabled(value?: boolean): void

setInteractiveDrawDelay

  • Sets how long after certain operations, such as setting the camera, to wait before starting a redraw. This delay exists in order to prevent flicker during continuous interaction. The initial value is 200ms.

    Parameters

    • value: number

      The delay in milliseconds

    Returns DeprecatedPromise

setInteractiveDrawLimitIncreaseEnabled

  • setInteractiveDrawLimitIncreaseEnabled(enable: boolean): void
  • Sets whether or not the viewer will periodically attempt to increase the amount drawn during interaction. Setting this to false may improve periodic framerate dips caused by such adjustments.

    Parameters

    • enable: boolean

    Returns void

setLightingEnabled

setLineVisibility

  • Sets the line visibility for the view.

    Parameters

    • lineVisibility: boolean

      indicates whether to draw lines.

    Returns DeprecatedPromise

setPointShape

setPointSize

setPointVisibilityTest

  • setPointVisibilityTest(points: Point3[]): void
  • Sets a list of points whose visibility will be tested every time a frame is drawn by comparing them to the frame's depth buffer. Points that are partially obscured by transparent objects are considered visible.

    The results are passed to the CallbackMap.frameDrawn callback so that UI elements may be updated in sync with rendering.

    See also testPointVisibility.

    Parameters

    • points: Point3[]

      The points to test. An empty array will disable the test.

    Returns void

setProjectionMode

  • setProjectionMode(projectionMode: Projection): void
  • Sets the projection mode.

    Parameters

    Returns void

setSilhouetteColor

  • setSilhouetteColor(value: Color): void

setSilhouetteEnabled

  • setSilhouetteEnabled(value?: boolean): void

setSilhouetteOpacity

  • setSilhouetteOpacity(value: number): void

setSilhouetteThreshold

  • setSilhouetteThreshold(value: number): void
  • Sets the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

    The value is a proportion of the canvas size and not a world-space distance.

    See also:

    Parameters

    • value: number

      The threshold to set.

    Returns void

setSilhouetteThresholdRampWidth

  • setSilhouetteThresholdRampWidth(value: number): void
  • Controls how quickly edges fade as z-distance between pixels decreases.

    This value is added to the one set by setSilhouetteThreshold to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

    Setting this value to 0 will cause all edges to be drawn at full opacity.

    See also:

    Parameters

    • value: number

    Returns void

setSimpleReflectionAttenuation

  • Controls how objects drawn in simple reflections fade as they move further from the ground plane.

    Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

    Attenuation is disabled if farDistance is less than or equal to nearDistance.

    See also:

    Parameters

    • nearDistance: number

      The distance from the ground plane at which objects begin to fade.

    • farDistance: number

      The distance from the ground plane at which objects are completely faded.

    • Optional unit: SimpleReflectionAttenuationUnit

      The unit in which nearDistance and farDistance are specified. If unspecified, SimpleReflectionAttenuationUnit.World will be used.

    Returns void

setSimpleReflectionBlurInterval

setSimpleReflectionBlurSamples

  • setSimpleReflectionBlurSamples(value: number): void

setSimpleReflectionEnabled

  • setSimpleReflectionEnabled(value?: boolean): void

setSimpleReflectionFadeAngle

  • setSimpleReflectionFadeAngle(degrees: number): void
  • Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

    Settings the value to 0 will disable the fading effect.

    Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

    See also:

    Parameters

    • degrees: number

      The angle in degrees.

    Returns void

setSimpleReflectionOpacity

  • setSimpleReflectionOpacity(value: number): void

setSimpleShadowBlurInterval

  • setSimpleShadowBlurInterval(value: number): void

setSimpleShadowBlurSamples

  • setSimpleShadowBlurSamples(value: number): void

setSimpleShadowColor

  • setSimpleShadowColor(color: Color): void

setSimpleShadowEnabled

  • setSimpleShadowEnabled(value?: boolean): void

setSimpleShadowInteractiveUpdateEnabled

  • setSimpleShadowInteractiveUpdateEnabled(value?: boolean): void

setSimpleShadowOpacity

  • setSimpleShadowOpacity(opacity: number): void

setSimpleShadowResolution

  • setSimpleShadowResolution(pixels: number): void

setStatisticsDisplayVisibility

  • setStatisticsDisplayVisibility(visibility: boolean): Promise<void>
  • Sets the display for the default statistic overlay.

    Parameters

    • visibility: boolean

    Returns Promise<void>

setTransparencyMode

  • Sets how transparent objects are blended.

    Parameters

    Returns void

setViewOrientation

  • setViewOrientation(orientation: ViewOrientation, duration?: number, bounding?: Box, preserveModelUp?: boolean): Promise<void>
  • Sets the view to a standard orientation.

    Parameters

    • orientation: ViewOrientation

      The desired view orientation for the camera.

    • Optional duration: number

      The number of milliseconds used to transition to the new camera.

    • Optional bounding: Box

      Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

    • Optional preserveModelUp: boolean

      Indicates whether the camera up will be set according to model up or current camera.

    Returns Promise<void>

setXRayColor

  • Sets the color applied to nodes in x-ray mode. By default, the color is unset.

    See unsetXRayColor.

    Parameters

    • element: ElementType

      the type of geometry to apply the color to

    • color: Color

      the color to apply

    • Optional group: XRayGroup

      the category of nodes that will be affected. If unspecified, XRayGroup.Selected will be used.

    Returns Promise<void>

setXRayOpacity

  • Sets the opacity of unselected items in x-ray mode.

    Parameters

    • opacity: number

      a number between 0 and 1

    • Optional element: ElementType

      the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.

    Returns DeprecatedPromise

setXRayTransparencyMode

startComparison

  • startComparison(nodeIdSet1: NodeId[], nodeIdSet2: NodeId[], config?: ComparisonConfig): void
  • Enables a visual comparison of two sets of nodes. The nodes specified by nodeIdSet1 are filled with one color, the nodes specified by nodeIdSet2 with another color, and overlapping areas are filled with a third color.

    See endComparison.

    Parameters

    • nodeIdSet1: NodeId[]

      the nodes to compare against nodeIdSet2

    • nodeIdSet2: NodeId[]

      the nodes to compare against nodeIdSet1

    • Optional config: ComparisonConfig

      settings controlling the behavior of the comparison

    Returns void

testPointVisibility

  • testPointVisibility(points: Point3[]): Promise<number[]>
  • Tests whether the given points are visible by comparing them to the depth buffer of the most-recently-drawn frame. Points that are partially obscured by transparent objects are considered visible.

    If the test is to be run every time a frame is drawn, setPointVisibilityTest should be used instead for proper synchronization.

    Parameters

    • points: Point3[]

      The points to test.

    Returns Promise<number[]>

    A list of indices of the visible points.

unprojectPoint

  • Unprojects a 2d screen space point to a 3d world space point.

    Parameters

    • point: Point2

      2d screen space

    • z: number

      z value, default 0

    Returns Point3 | null

    point world space point

unsetXRayColor

  • Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.

    See setXRayColor.

    Parameters

    Returns Promise<void>

updateCamera

  • Updates camera properties individually. This method should be used to incrementally update camera properties individually.

    Parameters

    • camera: Camera

      the camera to set.

    Returns Camera

    updated camera object.

updateLight