Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Scene

Visual representation of a Space.

Scene methods allow you to

  • Create items
  • Create Scene properties
  • Get items placed in the Scene

Index

Variables

index: number
returns

index of this Scene.

name: string
returns

name of this Scene.

Functions

  • Creates a new CameraItem in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns CameraItem

    created CameraItem.

  • Creates a new Capsule in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Capsule

    created Capsule.

  • Creates a new Capsule in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Capsule

    created Capsule.

  • Creates a new Cone in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cone

    created Cone.

  • Creates a new ConeFrustum in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns ConeFrustum

    created ConeFrustum.

  • createCuboid(posX: number, posY: number, posZ: number): Cuboid
  • createCuboid(pos: Vector3): Cuboid
  • Creates a new Cuboid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Cuboid

    created Cuboid.

  • Creates a new Cuboid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cuboid

    created Cuboid.

  • Creates a new Cylinder in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cylinder

    created Cylinder.

  • Creates a new Ellipsoid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Ellipsoid

    created Ellipsoid.

  • Creates a new Ellipsoid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Ellipsoid

    created Ellipsoid.

  • Creates a new Frustum in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Frustum

    created Frustum.

  • Creates a new Frustum4 in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Frustum4

    created Frustum4.

  • Creates a new HemiEllipsoid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns HemiEllipsoid

    created HemiEllipsoid.

  • Creates a new HemiEllipsoid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns HemiEllipsoid

    created HemiEllipsoid.

  • Creates a new SemiTorus in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns SemiTorus

    created SemiTorus.

  • Creates a new SemiTorus in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns SemiTorus

    created SemiTorus.

  • Creates a TextItem in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    • text: string

      label to display.

    Returns TextItem

    created TextItem.

  • Creates a new TextBillboard in this Scene.

    The _TextBillboard_ is a combination of a parent Cuboid with child TextItem

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cuboid

    the parent Cuboid.

  • createTorus(posX: number, posY: number, posZ: number): Torus
  • createTorus(pos: Vector3): Torus
  • Creates a new Torus in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Torus

    created Torus.

  • Creates a new Torus in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Torus

    created Torus.

  • Creates a new Tube in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Tube

    created Tube.

  • deleteItems(): void
  • Deletes all items in this Scene.

    Returns void

  • Finds an item by its id or name.

    Parameters

    • id: string

      name or id to search for.

    Returns BaseItem

    found item. Returns null if none is found.

    See BaseItem.name

    See BaseItem.id

  • Returns BaseItem[]

    all items in this Scene.

  • getItemsWithTag(tag: string): BaseItem[]
  • Returns all items with matching tag.

    Parameters

    • tag: string

      tag to find in item.

    Returns BaseItem[]

    items with tag.

    See BaseItem.addTag

  • getProperty(key: string): string
  • Gets a custom property from this object. Returns null if the property can not be found.

    Parameters

    • key: string

      name of property to search.

    Returns string

  • onPropertyChanged(id: string, handler: ((t: string) => void)): void
  • Handles property value changes in this object.

    Parameters

    • id: string

      property to listen to.

    • handler: ((t: string) => void)

      function that's called when property value is changed.

        • (t: string): void
        • Parameters

          • t: string

          Returns void

    Returns void

  • setProperty(key: string, value: any): void
  • Sets a custom property to this object.

    Properties are saved as strings.

    Parameters

    • key: string

      property name.

    • value: any

      property value.

    Returns void