Communicator.Camera

 Camera

Object representing a viewpoint from which the scene can be rendered. More information about using Camera can be found here.

Methods

copy

  • Creates a copy of the camera.

    Returns Camera

    new object initialized with the current values of this camera

dolly

  • Move the camera along a delta

    Parameters

    Returns void

equals

  • equals(cam: Camera): boolean
  • Returns checks for equality with another camera

    Parameters

    • cam: Camera

      the camera to compare against

    Returns boolean

forJson    [deprecated]

  • forJson(): Object
  • deprecated

    Use toJson instead.

    Returns Object

getCameraPlaneIntersectionPoint

  • Finds the intersection point with the camera plane

    Parameters

    Returns Point3 | null

getFullMatrix

  • Returns the camera's projection matrix multiplied by its view matrix.

    Parameters

    Returns Matrix

getHeight

  • getHeight(): number
  • gets the camera height

    Returns number

    the camera width

getMatrixFromCamera    [deprecated]

  • getMatrixFromCamera(): Matrix
  • Returns the transpose of the camera's view matrix without the translation component and with the x- and z- axes flipped. See getViewMatrix.

    deprecated

    Returns Matrix

getNearLimit

  • getNearLimit(): number
  • gets the camera near clipping limit

    Returns number

    the camera near clipping limit

getPosition

  • gets the camera position

    Returns Point3

    the camera position

getProjection

  • gets the camera projection

    Returns Projection

    the camera projection

getProjectionMatrix

  • Returns the camera's projection matrix.

    Parameters

    Returns Matrix

getTarget

  • gets the camera target

    Returns Point3

    the camera target

getUp

  • gets the camera up vector

    Returns Point3

    the camera up vector

getViewMatrix

  • Returns the camera's view matrix. This matrix places the camera at <0,0,0>, with the negative z-axis pointing toward the camera's target and the y-axis in the direction of the camera's up-vector.

    Parameters

    Returns Matrix

getWidth

  • getWidth(): number
  • gets the camera width

    Returns number

    the camera width

setHeight

  • setHeight(height: number): void
  • Sets the camera height

    Parameters

    • height: number

      the new camera height

    Returns void

setNearLimit

  • setNearLimit(nearLimit: number): void
  • Sets the camera near clipping limit

    Parameters

    • nearLimit: number

      the new camera near clipping limit

    Returns void

setPosition

  • setPosition(position: Point3): void
  • Sets the camera position

    Parameters

    • position: Point3

      the new camera position

    Returns void

setProjection

  • Sets the camera projection

    Parameters

    • projection: Projection

      the new camera Projection

    Returns void

setTarget

  • setTarget(target: Point3): void
  • Sets the camera target

    Parameters

    • target: Point3

      the new camera target

    Returns void

setUp

  • Sets the camera up vector

    Parameters

    • up: Point3

      the new camera up vector

    Returns void

setWidth

  • setWidth(width: number): void
  • Sets the camera width

    Parameters

    • width: number

      the new camera width

    Returns void

toJson

  • toJson(): Object
  • Creates an object ready for JSON serialization.

    Returns Object

    The prepared object.

transform

Static construct    [deprecated]

Static create

  • Creates a new camera object with the given parameters.

    Parameters

    • pos: Point3

      the camera position.

    • tar: Point3

      the camera target.

    • up: Point3

      the camera up vector.

    • projection: Projection

      the camera projection mode.

    • width: number

      camea view width.

    • height: number

      camera view height.

    • Optional nearLimit: number

      the camera near limit.

    Returns Camera

    a new camera object.

Static fromJson

  • fromJson(objData: any): Camera
  • Creates a new Camera from an object given by toJson.

    Parameters

    • objData: any

      An object given by toJson.

    Returns Camera

    The prepared object.