Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeviceService

The DeviceService provides the current device state

Hierarchy

  • DeviceService

Index

Constructors

constructor

Properties

Private _defaultLeftBounds

_defaultLeftBounds: Array<number> = [ 0.0, 0.0, 0.5, 1.0 ]

Private _defaultRightBounds

_defaultRightBounds: Array<number> = [ 0.5, 0.0, 0.5, 1.0 ]

Private _deviceOrientation

_deviceOrientation: Quaternion | undefined

Private _deviceOrientationHeadingAccuracy

_deviceOrientationHeadingAccuracy: number | undefined

Private _deviceOrientationListener

_deviceOrientationListener: any

_geolocationDesired

_geolocationDesired: boolean = false

_geolocationOptions

_geolocationOptions: GeolocationOptions | undefined

Private _getReachableAncestorReferenceFrames

_getReachableAncestorReferenceFrames: getReachableAncestorReferenceFrames = getReachableAncestorReferenceFrames

Private _negX90

_negX90: Quaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, -CesiumMath.PI_OVER_TWO)

Private _originPose

_originPose: EntityPose = this.entityService.createEntityPose(this.origin, this.stage)

Protected _parentState

_parentState: DeviceStableState | undefined

Private _scratchArray

_scratchArray: Array<any> = []

Protected _scratchCartesian

_scratchCartesian: Cartesian3 = new Cartesian3

Protected _scratchFrustum

_scratchFrustum: PerspectiveFrustum = new PerspectiveFrustum()

Private _scratchMatrix3

_scratchMatrix3: Matrix3 = new Matrix3

Private _scratchMatrix4

_scratchMatrix4: Matrix4 = new Matrix4

Private _scratchQuaternion

_scratchQuaternion: Quaternion = new Quaternion

Private _scratchQuaternion2

_scratchQuaternion2: Quaternion = new Quaternion

Private _stringIdentifierFromReferenceFrame

_stringIdentifierFromReferenceFrame: stringIdentifierFromReferenceFrame = stringIdentifierFromReferenceFrame

Private _suggestedGeolocationSubscription

_suggestedGeolocationSubscription: object | undefined

Private _updatingFrameState

_updatingFrameState: boolean = false

Private _vrDisplay

_vrDisplay: VRDisplay | undefined

Private _vrDisplays

_vrDisplays: VRDisplay[] | undefined

Private Optional _vrFrameData

_vrFrameData: any

autoSubmitFrame

autoSubmitFrame: boolean = true

If this is true (and we are presenting via webvr api), then vrDisplay.submitFrame is called after the frameState event

defaultUserHeight

defaultUserHeight: number = AVERAGE_EYE_HEIGHT

Protected entityService

entityService: EntityService

frameState

frameState: DeviceFrameState = new DeviceFrameState

Device state for the current frame. This is not updated unless the view is visible.

frameStateEvent

frameStateEvent: Event<DeviceFrameState> = new Event<DeviceFrameState>()

An event that fires every time the device frameState is updated.

origin

origin: Entity = this.entityService.collection.add(new Entity({id: 'ar.device.origin',name: 'Device Origin',position: new ConstantPositionProperty(Cartesian3.ZERO, this.stage),orientation: new ConstantProperty(Quaternion.IDENTITY)}))

An entity representing the origin of the device coordinate system, +Y up.

presentHMDChangeEvent

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

An even that fires when the view starts or stops presenting to an HMD

screenOrientationChangeEvent

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

Protected sessionService

sessionService: SessionService

stage

stage: Entity = this.entityService.collection.add(new Entity({id: 'ar.device.stage',name: 'Device Stage',position: undefined,orientation: undefined}))

A coordinate system representing the physical space in which the user is free to move around, positioned on the surface the user is standing on, where +X is east, +Y is up, and +Z is south (East-Up-South), if geolocation is known. If the stage is not geolocated, then the +X and +Z directions are arbitrary.

suggestedGeolocationSubscriptionChangeEvent

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

user

user: Entity = this.entityService.collection.add(new Entity({id: 'ar.device.user',name: 'Device User',position: undefined,orientation: undefined}))

An entity representing the physical pose of the user, where +X is right, +Y is up, and -Z is forward

Protected viewService

viewService: ViewService

Protected visibilityService

visibilityService: VisibilityService

Accessors

geoHeadingAccuracy

  • get geoHeadingAccuracy(): number | undefined

geoHorizontalAccuracy

  • get geoHorizontalAccuracy(): number | undefined

geoVerticalAccuracy

  • get geoVerticalAccuracy(): number | undefined

geolocationDesired

  • get geolocationDesired(): object

geolocationOptions

isPresentingHMD

  • get isPresentingHMD(): boolean

isPresentingRealityHMD

  • get isPresentingRealityHMD(): boolean
  • Is the current reality presenting to an HMD

    Returns boolean

screenOrientationDegrees

  • get screenOrientationDegrees(): number

strict

  • get strict(): boolean

suggestedGeolocationSubscription

  • get suggestedGeolocationSubscription(): object

suggestedUserHeight

  • get suggestedUserHeight(): number

vrDisplay

  • get vrDisplay(): any

Methods

Private _hasPolyfillWebVRDisplay

  • _hasPolyfillWebVRDisplay(): boolean

Private _setSuggestedGeolocationSubscription

  • _setSuggestedGeolocationSubscription(options?: object): void

Private _setupVRPresentChangeHandler

  • _setupVRPresentChangeHandler(): void

Private _startUpdates

  • _startUpdates(): void

Private _stopUpdates

  • _stopUpdates(): void

Private _tryOrientationUpdates

  • _tryOrientationUpdates(): void

Private _updateDefault

  • _updateDefault(): void

Private _updateDefaultOrigin

  • _updateDefaultOrigin(): void

Private _updateDefaultUser

  • _updateDefaultUser(): void

Private _updateForWebVR

Private _updateFrameState

  • _updateFrameState(): void

Private _updateViewport

  • _updateViewport(): void

cancelAnimationFrame

  • cancelAnimationFrame(id: number): void
  • Cancel an animation frame callback for the current view.

    Parameters

    • id: number

    Returns void

createContextFrameState

exitPresentHMD

  • exitPresentHMD(): Promise<void>

Protected getScreenOrientationDegrees

getSubviewEntity

  • getSubviewEntity(index: number): Entity

Protected onExitPresentHMD

  • onExitPresentHMD(): Promise<void>

Protected onRequestPresentHMD

  • onRequestPresentHMD(): Promise<void>

Protected onUpdateFrameState

  • onUpdateFrameState(): void

requestAnimationFrame

  • requestAnimationFrame(callback: function): any
  • Request an animation frame callback for the current view.

    Parameters

    • callback: function
        • (timestamp: number): void
        • Parameters

          • timestamp: number

          Returns void

    Returns any

requestPresentHMD

  • requestPresentHMD(): Promise<void>

subscribeGeolocation

unsubscribeGeolocation

Generated using TypeDoc