location_on

three/Object3D/Group/Zappar/UserPlacementAnchorGroup

three/Object3D/Group/Zappar/UserPlacementAnchorGroup

three/Zappar/WorldTracker

Hierarchy (view full)

Accessors

  • get disposed(): boolean
  • Gets the disposed status of the entity.

    Returns boolean

    The disposed status.

  • get elementsResolved(): any[]
  • An array of the elements that this component instance exposes. In the case that this component does not expose any elements of its own, this will be an array of the elements exposed by this component's children.

    Returns any[]

  • get lockedResolved(): boolean
  • Returns true if this component, or any of its parents, are marked as locked.

    Returns boolean

Constructors

Methods

  • Adds a behavior to the component.

    Parameters

    • b: Behavior<Component<any, ConstructorProps>>

      The behavior to add.

    Returns void

  • Parameters

    • c: Component<any, ConstructorProps>

    Returns void

  • Constructs the children of this component.

    Parameters

    • children: ComponentChildren
    • OptionalcontextManager: ContextManager

    Returns void

  • Gets a behavior of a specific type from the component.

    Type Parameters

    • T extends (new (contextManager: ContextManager, instance: Component<any, ConstructorProps>, ...args: any[]) => Behavior<Component<any, ConstructorProps>>)

      The behavior type.

    Parameters

    • type: T

      The type of behavior to get.

    Returns undefined | InstanceType<T>

    The behavior of the specified type, or undefined if no such behavior exists.

  • Gets all behaviors of a specific type from the component.

    Type Parameters

    • T extends (new (contextManager: ContextManager, instance: Component<any, ConstructorProps>, ...args: any[]) => Behavior<Component<any, ConstructorProps>>)

      The behavior type.

    Parameters

    • type: T

      The type of behaviors to get.

    Returns InstanceType<T>[]

    An array of behaviors of the specified type.

  • Get the instance of the ZComponent that constructed this entity.

    If you pass the class of a ZComponent as the type parameter, this function will ensure that it returns an instance of that ZComponent. If this component or behavior was constructed by a different ZComponent class, or by a different entity altogether, the function with throw an error.

    Type Parameters

    • T extends ZComponent<any, T> = ZComponent<any>

    Parameters

    • Optionaltype: ConstructorForComponent<T>

      The ZComponent class that you are expecting to receive

    Returns T

    The instance of the ZComponent that constructed this component or behavior

  • Register a function to be called when an Event is fired, or an Observable's value changes. The function will only be bound to the underlying Event or Observable while this entity is enabled.

    Using this function, rather than attaching your handler directly to the Event or Observable, ensures your handler is automatically released when this entity is disposed.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable to listen to

    • fn: ((...args: Args) => void)

      A function that will be called when the event fires, or the Observable value changes

        • (...args): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Args extends any[]

    Parameters

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Type

    Parameters

    Returns any

  • Removes this component from its parent component.

    Returns void

  • Removes a behavior from the component.

    Parameters

    • b: Behavior<Component<any, ConstructorProps>>

      The behavior to remove.

    Returns void

  • Parameters

    • c: Component<any, ConstructorProps>

    Returns void

  • Unregisters a function that was previously registered to an Event or Observable.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable

    • fn: ((...args: Args) => void)

      The function that was passed in the call to register

        • (...args): void
        • Parameters

          Returns void

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    Returns any

Other

tags: Observable<string[], never>

An array of string 'tags' assocated with this component.

The getComponentsByTag(mgr, tag) function can be used to get an array of components with the supplied tag.

By default, tags are scoped to the ZComponent instance that a component is constructed by. Tags that begin with global: are scoped to the experience as a whole.

0

Properties - Animation

firstPlacedLayerClip: Observable<undefined | string, never> = ...

A layer clip that will be played the first time the content has a placement in space.

10

false

layerclipids

notPlacingLayerClip: Observable<undefined | string, never> = ...

A layer clip that will be played when this component leaves user placement mode.

10

false

layerclipids

placementNotValidLayerClip: Observable<undefined | string, never> = ...

A layer clip that will be played when, during placement mode, the user is not pointing at a valid location to place the content.

10

false

layerclipids

placementValidLayerClip: Observable<undefined | string, never> = ...

A layer clip that will be played when, during placement mode, the user is pointing at a valid location to place the content.

10

false

layerclipids

placingLayerClip: Observable<undefined | string, never> = ...

A layer clip that will be played when this component enters user placement mode.

10

false

layerclipids

Properties - Appearance

castShadow: Observable<boolean, never>

Determines if this object casts shadows.

11

true

receiveShadow: Observable<boolean, never>

Determines if this object receives shadows.

11

true

visible: Observable<boolean, never>

Determines if this object and its children are rendered to the screen.

11

true

Properties - Behavior

enabled: Observable<boolean, never>

If false, this entity and its children will no longer participate in the experience.

Note - to read this value, you may wish to use enabledResolved which will be false if this entity, or any of its parents, have enabled set to false.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost (e.g. detach from any frame handlers).

true

10

Properties - Design Time

previewPlacement: Observable<boolean, never> = ...

Use this property to preview the appearance of placement mode during design time.

50

false

Properties - Functionality

placeOnGround: Observable<boolean, never> = ...

If true, placement will be possible on a 'ground' plane detected in the world around the user.

40

false

placeOnPlanes: Observable<boolean, never> = ...

If true, placement will be possible on planes detected in the world around the user.

40

true

showContentDuringPlacement: Observable<boolean, never> = ...

If true, a the children of this component will be shown during placement mode. Otherwise it will be hidden.

40

true

startInPlacementMode: Observable<boolean, never> = ...

If true, this component will be in a mode that allows the user to choose a placement location when the experience starts. If false, the content will be placed at the center of the first detected plane after the experience starts.

40

false

visualizePlanesDuringPlacement: Observable<boolean, never> = ...

If true, a visual representation of any planes detected in the world around the user will be shown on-screen.

40

true

Properties - Long Press

longPressInstruction: Observable<string, never> = ...

If true, the long press instruction message will be shown when the user has completed placement

20

"Tap and hold to move"

longPressToMove: Observable<LongPressMode, never> = ...

Determines if the user can long press on the screen to enter placement mode. There are two modes available: 'hold' allows the user to move the anchor while the keep their finger held on the screen, while 'toggle' enters placement mode allowing the user to release their finger.

20

"none"

showLongPressInstructionOnPlace: Observable<boolean, never> = ...

If true, the long press instruction message will be shown when the user has completed placement

20

false

Properties - Other

anchor?: WorldAnchor
behaviors: Behavior<Component<any, ConstructorProps>>[]

The behaviors attached to this component.

children: Component<any, ConstructorProps>[]

The children of this component.

contextManager: ContextManager
customAnchor?: CustomAnchor
element: Group
enabledResolved: Observable<boolean, never>

This will have value false if this entity, or any of its parents, have enabled set to false.

To change the enabled status of this entity, use the enabled property instead.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost.

Disabled entities will typically remain visible (if they have a visible appearance).

locked?: boolean

If true, this component can't be selected at design time in the 3D preview.

lookAt: Observable<undefined | [number, number, number], never>
onClick: Event<[ThreePointerPresentEvent]>
onDispose: Event<[]>

An event that is fired as the last act of this entity being destroyed.

onFirstPlaced: Event<[]> = ...
onIntersectionEnter: Event<[IntersectionPresentEvent]>
onIntersectionLeave: Event<[IntersectionEvent]>
onNotPlacing: Event<[]> = ...
onPlacementNotValid: Event<[]> = ...
onPlacementValid: Event<[]> = ...
onPlacing: Event<[]> = ...
onPointerDown: Event<[ThreePointerPresentEvent]>
onPointerEnter: Event<[ThreePointerPresentEvent]>
onPointerLeave: Event<[ThreePointerEvent]>
onPointerMove: Event<[ThreePointerPresentEvent]>
onPointerUp: Event<[ThreePointerPresentEvent]>
parent?: Component<any, ConstructorProps>

The parent of this component.

placementMode: Observable<boolean, never> = ...
placementValid: Observable<boolean, never> = ...
position: Observable<[x: number, y: number, z: number], never>
ready: Observable<boolean, never> = ...
rotation: Observable<[x: number, y: number, z: number], never>
scale: Observable<[x: number, y: number, z: number], never>

Properties - Placement Button

placeButtonHorizontalAlignment: Observable<HorizontalAlignment, never> = ...

The horiztonal alignment of the restart placement button

20

"center"

placeButtonText: Observable<string, never> = ...

Set to a text string to display on the place button.

20

""

placeButtonVerticalAlignment: Observable<VerticalAlignment, never> = ...

The vertical alignment of the restart placement button

20

"bottom"

showPlaceButton: Observable<boolean, never> = ...

If true, a button will be shown during placement mode for the user to confirm their chosen position.

20

true

showPlaceButtonIcon: Observable<boolean, never> = ...

If true, a tick icon will be displayed in the place button.

20

true

Properties - Placement UI

placeUIClassList: Observable<string[], never> = ...

20

["zcomponent-zappar-three-place-ui"]

Properties - Restart Placement Button

restartPlacementButtonHorizontalAlignment: Observable<HorizontalAlignment, never> = ...

The horiztonal alignment of the restart placement button

20

"left"

restartPlacementButtonText: Observable<string, never> = ...

Set to a text string to display on the restart placement button.

20

""

restartPlacementButtonVerticalAlignment: Observable<VerticalAlignment, never> = ...

The vertical alignment of the restart placement button

20

"bottom"

showRestartPlacementButton: Observable<boolean, never> = ...

If true, a button will be shown to allow the user to return to placement mode.

20

true

showRestartPlacementButtonIcon: Observable<boolean, never> = ...

If true, an icon will be displayed in the restart placement button.

20

true