Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Viewer

Viewer class

param

dom id or element

Hierarchy

  • Viewer

Index

Constructors

constructor

  • new Viewer(idOrElement: string | HTMLElement): Viewer

Properties

Private ambientLight

ambientLight: AmbientLight

Private bRadius

bRadius: number

Private backgroundGroup

backgroundGroup: Group

boundingBox

boundingBox: Box3 = new Box3()

Private boundingBoxLength

boundingBoxLength: number = 0

Private boundingBoxMesh

boundingBoxMesh: LineSegments

Private boundingBoxSize

boundingBoxSize: Vector3 = new Vector3()

Private cDist

cDist: number

camera

camera: PerspectiveCamera | OrthographicCamera

Private compositeCamera

compositeCamera: OrthographicCamera

Private compositeMaterial

compositeMaterial: ShaderMaterial

Private compositeScene

compositeScene: Scene

Private compositeUniforms

compositeUniforms: { scale: Uniform; tForeground: Uniform }

Type declaration

  • scale: Uniform
  • tForeground: Uniform

container

container: HTMLElement

Private distVector

distVector: Vector3 = new Vector3()

height

height: number

Private helperGroup

helperGroup: Group

Private holdTarget

holdTarget: WebGLRenderTarget

Private isStill

isStill: boolean

Private lastRenderedPicking

lastRenderedPicking: boolean

Private modelGroup

modelGroup: Group

Private orthographicCamera

orthographicCamera: OrthographicCamera

Private parameters

parameters: ViewerParameters

perspectiveCamera

perspectiveCamera: PerspectiveCamera

Private pickingGroup

pickingGroup: Group

Private pickingTarget

pickingTarget: WebGLRenderTarget

Private renderPending

renderPending: boolean

renderer

renderer: WebGLRenderer

Private rendering

rendering: boolean

rotationGroup

rotationGroup: Group

sampleLevel

sampleLevel: number

Private sampleTarget

sampleTarget: WebGLRenderTarget

scene

scene: Scene

signals

signals: ViewerSignals

Private spotLight

spotLight: SpotLight

stats

stats: Stats

Private stereoCamera

stereoCamera: StereoCamera

Private supportsHalfFloat

supportsHalfFloat: boolean

translationGroup

translationGroup: Group

width

width: number

wrapper

wrapper: HTMLElement

Accessors

cameraDistance

  • get cameraDistance(): number
  • set cameraDistance(d: number): void

Methods

Private __render

  • __render(picking?: boolean, camera: PerspectiveCamera | OrthographicCamera): void
  • Parameters

    • Default value picking: boolean = false
    • camera: PerspectiveCamera | OrthographicCamera

    Returns void

Private __renderModelGroup

  • __renderModelGroup(camera: PerspectiveCamera | OrthographicCamera, renderTarget?: WebGLRenderTarget): void
  • Parameters

    • camera: PerspectiveCamera | OrthographicCamera
    • Optional renderTarget: WebGLRenderTarget

    Returns void

Private __renderPickingGroup

  • __renderPickingGroup(camera: PerspectiveCamera | OrthographicCamera): void

Private __renderStereo

  • __renderStereo(picking?: boolean): void

Private __renderSuperSample

  • __renderSuperSample(camera: PerspectiveCamera | OrthographicCamera): void

Private __setVisibility

  • __setVisibility(model: boolean, picking: boolean, background: boolean, helper: boolean): void
  • Parameters

    • model: boolean
    • picking: boolean
    • background: boolean
    • helper: boolean

    Returns void

Private __updateCamera

  • __updateCamera(): void

Private __updateClipping

  • __updateClipping(): void
  • Intepret clipMode, clipScale and set the camera and fog clipping. Also ensures bRadius and cDist are valid

    Returns void

Private __updateLights

  • __updateLights(): void

Private _initCamera

  • _initCamera(): void

Private _initHelper

  • _initHelper(): void

Private _initParams

  • _initParams(): void

Private _initRenderer

  • _initRenderer(): undefined | false

Private _initScene

  • _initScene(): void

Private _initStats

  • _initStats(): void

Private _updateBoundingBox

  • _updateBoundingBox(geometry?: BufferGeometry, matrix?: Matrix4, instanceMatrix?: Matrix4): void
  • Parameters

    • Optional geometry: BufferGeometry
    • Optional matrix: Matrix4
    • Optional instanceMatrix: Matrix4

    Returns void

absoluteToRelative

  • absoluteToRelative(d: number): number
  • Convert an absolute clip value to a relative one using bRadius.

    0.0 -> 50.0 bRadius -> 0.0

    Parameters

    • d: number

    Returns number

add

addBuffer

animate

  • animate(): void

clear

  • clear(): void

dispose

  • dispose(): void

getImage

  • getImage(picking: boolean): Promise<unknown>

getPickingPixels

  • getPickingPixels(): Uint8Array | Float32Array

handleResize

  • handleResize(): void

makeImage

pick

  • pick(x: number, y: number): { instance: any; picker: any; pid: number }
  • Parameters

    • x: number
    • y: number

    Returns { instance: any; picker: any; pid: number }

    • instance: any
    • picker: any
    • pid: number

relativeToAbsolute

  • relativeToAbsolute(d: number): number
  • Convert a relative clip value to an absolute one using bRadius

    0.0 -> bRadius 50.0 -> 0.0

    Parameters

    • d: number

    Returns number

remove

  • remove(buffer: Buffer): void

render

  • render(picking?: boolean): void

requestRender

  • requestRender(): void

setBackground

  • setBackground(color?: Color | number | string): void

setCamera

  • setCamera(type: CameraType, fov?: undefined | number, eyeSep?: undefined | number): void

setClip

  • setClip(near: number, far: number, dist: number, clipMode?: undefined | string, clipScale?: undefined | string): void
  • Parameters

    • near: number
    • far: number
    • dist: number
    • Optional clipMode: undefined | string
    • Optional clipScale: undefined | string

    Returns void

setFog

  • setFog(color?: Color | number | string, near?: undefined | number, far?: undefined | number): void
  • Parameters

    • Optional color: Color | number | string
    • Optional near: undefined | number
    • Optional far: undefined | number

    Returns void

setLight

  • setLight(color: Color | number | string, intensity: number, ambientColor: Color | number | string, ambientIntensity: number): void
  • Parameters

    • color: Color | number | string
    • intensity: number
    • ambientColor: Color | number | string
    • ambientIntensity: number

    Returns void

setSampling

  • setSampling(level: number): void

setSize

  • setSize(width: number, height: number): void

updateBoundingBox

  • updateBoundingBox(): void

updateHelper

  • updateHelper(): void

updateInfo

  • updateInfo(reset?: undefined | false | true): void

updateZoom

  • updateZoom(): void

Object literals

Private info

info: object

memory

memory: object

geometries

geometries: number = 0

programs

programs: number = 0

textures

textures: number = 0

render

render: object

calls

calls: number = 0

faces

faces: number = 0

points

points: number = 0

vertices

vertices: number = 0

Generated using TypeDoc