The virtual Micrio camera

Marcel Duin marcel@micr.io

Properties

center: Coords = ...

Current center screen coordinates and scale

Methods

  • Returns whether the current camera movement is kinetic / rubber banding

    Returns boolean

  • Fly to the specific coordinates

    Parameters

    Returns Promise<void>

    Promise when the animation is done

  • Fly to a screen-covering view of the image

    Parameters

    Returns Promise<void>

    Promise when the animation is done

  • Fly to a full view of the image

    Parameters

    Returns Promise<void>

    Promise when the animation is done

  • Fly to a specific view

    Parameters

    • view: View

      The viewport to fly to

    • opts: AnimationOptions & {
          area?: View;
          isJump?: boolean;
          limitZoom?: boolean;
          noTrueNorth?: boolean;
          omniIndex?: number;
          prevView?: View;
          progress?: number;
      } = {}

      Optional animation settings

    Returns Promise<void>

    Promise when the animation is done

  • Gets the static image XY coordinates of a screen coordinate

    Parameters

    • x: number

      The screen X coordinate in pixels

    • y: number

      The screen Y coordinate in pixels

    • absolute: boolean = false

      Use absolute browser window coordinates

    • noLimit: boolean = false

      Allow to go out of image bounds

    Returns Float64Array

    The relative image XY coordinates

  • Get whether the image always fills the screen or not

    Returns boolean

  • Get the scale when the image would cover the screen

    Returns number

  • Get the current direction facing in 360 mode in radians

    Returns number

  • Get a custom matrix for 360 placed embeds

    Parameters

    • x: number

      The X coordinate

    • y: number

      The Y coordinate

    • Optionalscale: number

      The object scale

    • Optionalradius: number

      The object radius (default 10)

    • OptionalrotX: number

      The object X rotation in radians

    • OptionalrotY: number

      The object Y rotation in radians

    • OptionalrotZ: number

      The object Z rotation in radians

    • OptionaltransY: number

      Optional Y translation in 3d space

    • OptionalscaleX: number

      Optional X scaling

    • OptionalscaleY: number

      Optional Y scaling

    Returns Float32Array

    The resulting 4x4 matrix

  • Get the minimum scale

    Returns number

    The minimum scale

  • [Omni] Get the corresponding frame number to current rotation

    Parameters

    • Optionalrot: number

    Returns number

  • [Omni] Get the current rotation in degrees

    Returns number

  • Get the current direction pitch

    Returns number

    The current pitch in radians

  • Get the current image scale

    Returns number

  • Get the current image view rectangle

    Returns View

    The current screen viewport

  • Gets the static screen XY coordinates of an image coordinate

    Parameters

    • x: number

      The image X coordinate

    • y: number

      The image Y coordinate

    • abs: boolean = false

      Use absolute browser window coordinates

    • Optionalradius: number
    • Optionalrotation: number
    • OptionalnoTrueNorth: boolean

    Returns Float64Array

    The screen XY coordinates in pixels

  • Returns true when the camera is zoomed in to the max

    Returns boolean

  • Returns true when the camera is fully zoomed out

    Parameters

    • full: boolean = false

      When using a custom .minSize, use this in the calculation

    Returns boolean

  • Pan relative pixels

    Parameters

    • x: number

      The horizontal number of pixels to pan

    • y: number

      The vertical number of pixels to pan

    • duration: number = 0

      An optional duration

    • opts: {
          noLimit?: boolean;
          render?: boolean;
      } = {}
      • OptionalnoLimit?: boolean
      • Optionalrender?: boolean

    Returns void

  • Pause any animation

    Returns void

  • Pause any animation

    Returns void

  • Limit camera navigation boundaries

    Parameters

    • xPerc: number = 0

      The horizontal arc to limit to, percentage (1 = 360°)

    • yPerc: number = 0

      The vertical arc to limit to, percentage (1 = 180°)

    Returns void

  • Set the relative Models.Camera.View to render to, animates by default

    Parameters

    • v: View
    • opts: {
          direct?: boolean;
          noDispatch?: boolean;
          noRender?: boolean;
      } = {}
      • Optionaldirect?: boolean

        Directly set the area without animation

      • OptionalnoDispatch?: boolean

        Don't emit the updates back to JS

      • OptionalnoRender?: boolean

        Don't trigger a frame draw

    Returns void

  • Sets current coordinates as the center of the screen

    Parameters

    • x: number

      The X Coordinate

    • y: number

      The Y Coordinate

    • scale: number = ...

      The scale to set

    Returns void

  • Set the coverLimit of the image to always fill the screen

    Parameters

    • b: boolean

      Limit the image to cover view

    Returns void

  • Sets the 360 viewing direction in radians

    Parameters

    • yaw: number

      The direction in radians

    • Optionalpitch: number

      Optional pitch in radians

    Returns void

  • Limit camera navigation boundaries

    Parameters

    • l: View

      The viewport limit

    Returns void

  • Sets the minimum scale

    Parameters

    • s: number

      The minimum scale to set

    Returns void

  • Sets the minimum screen size you can zoom out to -- this makes you able to zoom out with margins Note: This does not work with albums!

    Parameters

    • s: number

      The minimum screen size [0-1]

    Returns void

  • Returns void

  • For in-image 360 embeds

    Parameters

    • rotX: number = 0
    • rotY: number = 0
    • rotZ: number = 0

    Returns void

  • Set the current image scale

    Parameters

    • s: number

      The scale

    Returns void

  • Set the screen viewport

    Parameters

    • v: View

      The viewport

    • opts: {
          area?: View;
          correctNorth?: boolean;
          noLimit?: boolean;
          noRender?: boolean;
      } = {}

      Options

      • Optionalarea?: View

        Custom sub-area

      • OptionalcorrectNorth?: boolean

        [360] Correct the view to trueNorth

      • OptionalnoLimit?: boolean

        Don't restrict the boundaries

      • OptionalnoRender?: boolean

        Don't render

    Returns void

  • Stop any animation

    Returns void

  • Do a zooming animation

    Parameters

    • delta: number

      The amount to zoom

    • duration: number = 0

      A forced duration in ms of the animation

    • x: number = undefined

      Screen pixel X-coordinate as zoom focus

    • y: number = undefined

      Screen pixel Y-coordinate as zoom focus

    • speed: number = 1

      A non-default camera speed

    • noLimit: boolean = false

      Can zoom outside of the image boundaries

    Returns Promise<void>

    Promise when the zoom animation is done

  • Zoom out a factor

    Parameters

    • factor: number = 1

      The amount to zoom in

    • duration: number = 250

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

    Promise when the zoom animation is done

  • Zoom out a factor

    Parameters

    • factor: number = 1

      The amount to zoom out

    • duration: number = 250

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

    Promise when the zoom animation is done