Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewService

Manages the view state

Hierarchy

  • ViewService

Index

Constructors

constructor

Properties

Private _current

Private _currentViewportJSON

_currentViewportJSON: string

Private _frustums

_frustums: PerspectiveFrustum[] = []

Private _subviewEntities

_subviewEntities: Entity[] = []

Private _subviews

_subviews: Subview[] = []

acquireEvent

acquireEvent: Event<void> = new Event<void>()

An event that is raised when ownership of the view has been acquired by this application

containingElementPromise

containingElementPromise: Promise

A promise which resolves to the containing HTMLElement for this view. This value is undefined in non-DOM environments.

Private contextService

contextService: ContextService

desiredViewportMap

desiredViewportMap: unknown = new WeakMap<SessionPort, Viewport>()

Manager-only. A map of sessions to their desired viewports.

element

element: HTMLDivElement

An HTMLDivElement which matches the root viewport. This is provide for convenience to attach other elements to (such as a webGL canvas element). Attached elements will automatically inherit the same size and position as this element (via CSS). This value is undefined in non-DOM environments.

Private focusService

focusService: FocusService

releaseEvent

releaseEvent: Event<void> = new Event<void>()

An event that is raised when ownership of the view has been released from this application

Private sessionService

sessionService: SessionService

viewportChangeEvent

viewportChangeEvent: Event<object> = new Event<{ previous: Viewport }>()

An event that is raised when the root viewport has changed

Methods

Private _update

  • _update(): void

getSubviews

  • getSubviews(referenceFrame?: Entity): Subview[]

getViewport

isOwner

  • isOwner(): void
  • Returns true if this application has control over the view.

    Returns void

releaseOwnership

  • releaseOwnership(): void
  • Release control over the view.

    Returns void

requestOwnership

  • requestOwnership(): void
  • Request control over the view. The manager is likely to reject this request if this application is not in focus. When running on an HMD, this request will always fail. If the current reality view does not support custom views, this request will fail. The manager may revoke ownership at any time (even without this application calling releaseOwnership)

    Returns void

setDesiredViewport

  • setDesiredViewport(viewport: Viewport): void
  • Set the desired root viewport

    Parameters

    Returns void

Generated using TypeDoc