The virtual Micrio camera

Author

Marcel Duin [email protected]

Copyright

Q42 Internet BV, Micrio, 2015 - 2023

Link

https://micr.io/ , https://q42.nl/en/

Hierarchy

  • Camera

Properties

center: Coords = ...

Current center screen coordinates and scale

Methods

  • Get the current image view rectangle

    Returns

    The current screen viewport

    Returns View

  • Set the screen viewport

    Parameters

    • view: View

      The viewport

    • noLimit: boolean = false

      Don't restrict the boundaries

    Returns void

  • Gets the static image XY coordinates of a screen coordinate

    Returns

    The relative image XY coordinates

    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

  • 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

  • Gets the static screen XY coordinates of an image coordinate

    Returns

    The screen XY coordinates in pixels

    Parameters

    • x: number

      The image X coordinate

    • y: number

      The image Y coordinate

    • abs: boolean = false

      Use absolute browser window coordinates

    Returns Float64Array

  • Get the current image scale

    Returns number

  • Get a custom matrix for 360 placed embeds

    Returns

    The resulting 4x4 matrix

    Parameters

    • x: number

      The X coordinate

    • y: number

      The Y coordinate

    • Optional scale: number

      The object scale

    • Optional radius: number

      The object radius (default 10)

    • Optional rotX: number

      The object X rotation in radians

    • Optional rotY: number

      The object Y rotation in radians

    • Optional rotZ: number

      The object Z rotation in radians

    • Optional transY: number

      Optional Y translation in 3d space

    Returns Float32Array

  • Set the current image scale

    Parameters

    • s: number

      The scale

    Returns void

  • Get the scale when the image would cover the screen

    Returns number

  • Get the minimum scale

    Returns

    The minimum scale

    Returns number

  • Sets the minimum scale

    Parameters

    • s: number

      The minimum scale to set

    Returns void

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

    Returns boolean

  • Returns true when the camera is fully zoomed out

    Returns boolean

  • Limit camera navigation boundaries

    Parameters

    • limit: View

      The viewport limit

    Returns void

  • Limit camera navigation boundaries

    Parameters

    • x: number = 0

      The viewport width to limit to

    • y: number = 0

      The viewport height to limit to

    Returns void

  • Fly to a specific view

    Returns

    Promise when the animation is done

    Parameters

    • view: View

      The viewport to fly to

    • opts: {
          duration?: number;
          speed?: number;
          progress?: number;
          prevView?: View;
          isJump?: boolean;
          limit?: boolean;
      } = {}

      Optional settings

      • Optional duration?: number

        A forced duration in ms of the animation

      • Optional speed?: number

        A non-default camera speed

      • Optional progress?: number

        Set the starting animation progress percentage

      • Optional prevView?: View

        Base the progress override on this starting view

      • Optional isJump?: boolean

        Zoom out and in during the animation

      • Optional limit?: boolean

        Limit the target viewport

    Returns Promise<void>

  • Fly to a full view of the image

    Returns

    Promise when the animation is done

    Parameters

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    Returns Promise<void>

  • Fly to a screen-covering view of the image

    Returns

    Promise when the animation is done

    Parameters

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    Returns Promise<void>

  • Fly to the specific coordinates

    Returns

    Promise when the animation is done

    Parameters

    • coords: Coords

      The X, Y and scale coordinates to fly to

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    • limited: boolean = false

      Limit the camera to the image boundaries

    Returns Promise<void>

  • Do a "jump" animation to the specific view

    Returns

    Promise when the animation is done

    Parameters

    • view: View

      The viewport to fly to

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

  • Do a zooming animation

    Returns

    Promise when the zoom animation is done

    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>

  • Zoom out a factor

    Returns

    Promise when the zoom animation is done

    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>

  • Zoom out a factor

    Returns

    Promise when the zoom animation is done

    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>

  • 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

    Returns void

  • Stop any animation

    Returns void

  • Pause any animation

    Returns void

  • Pause any animation

    Returns void

  • Get the current direction facing in 360 mode in radians

    Returns number

  • Sets the 360 viewing direction in radians

    Parameters

    • yaw: number

      The direction in radians

    • Optional pitch: number

      Optional pitch in radians

    Returns void

  • Get the current direction pitch

    Returns

    The current pitch in radians

    Returns number

  • Set the relative View to render to

    Parameters

    • v: View
    • direct: boolean = false
    • noDispatch: boolean = false

    Returns void

Generated using TypeDoc