.. role:: ts-api-decorator

######
Camera
######

.. js:module:: Operators
   :noindex:

.. container:: ts-api-section

   .. js:module:: Operators.Camera




.. toctree::
   :titlesonly:
   :hidden:

   /api_ref/viewing/interfaces/Operators.Camera.BimConfigs
   /api_ref/viewing/classes/Operators.Camera.CameraKeyboardWalkOperator
   /api_ref/viewing/classes/Operators.Camera.CameraNavigationOperator
   /api_ref/viewing/classes/Operators.Camera.CameraOrbitOperator
   /api_ref/viewing/classes/Operators.Camera.CameraPanOperator
   /api_ref/viewing/classes/Operators.Camera.CameraTurntableOperator
   /api_ref/viewing/classes/Operators.Camera.CameraWalkModeOperator
   /api_ref/viewing/classes/Operators.Camera.CameraWalkOperator
   /api_ref/viewing/classes/Operators.Camera.CameraWindowZoomOperator
   /api_ref/viewing/classes/Operators.Camera.CameraZoomOperator
   /api_ref/viewing/classes/Operators.Camera.DoorCache

.. container:: api-index-section

   .. rubric:: Classes

   .. rst-class:: api-index-list-item api-kind-class api-parent-kind-namespace

   * :js:class:`~Operators.Camera.CameraKeyboardWalkOperator`
   * :js:class:`~Operators.Camera.CameraNavigationOperator`
   * :js:class:`~Operators.Camera.CameraOrbitOperator`
   * :js:class:`~Operators.Camera.CameraPanOperator`
   * :js:class:`~Operators.Camera.CameraTurntableOperator`
   * :js:class:`~Operators.Camera.CameraWalkModeOperator`
   * :js:class:`~Operators.Camera.CameraWalkOperator`
   * :js:class:`~Operators.Camera.CameraWindowZoomOperator`
   * :js:class:`~Operators.Camera.CameraZoomOperator`
   * :js:class:`~Operators.Camera.DoorCache`



.. container:: api-index-section

   .. rubric:: Interfaces

   .. rst-class:: api-index-list-item api-kind-interface api-parent-kind-namespace

   * :js:class:`~Operators.Camera.BimConfigs`



.. container:: api-index-section

   .. rubric:: Type Aliases

   .. rst-class:: api-index-list-item api-kind-typealias api-parent-kind-namespace

   * :ref:`Operators.Camera.CameraRotateFunction`



.. container:: api-index-section

   .. rubric:: Variables

   .. rst-class:: api-index-list-item api-kind-variable api-parent-kind-namespace

   * :js:data:`~Operators.Camera.MAX_ANGLE`
   * :js:data:`~Operators.Camera.MAX_TILT`
   * :js:data:`~Operators.Camera.MIN_ANGLE`
   * :js:data:`~Operators.Camera.MIN_TILT`



.. container:: api-index-section

   .. rubric:: Functions

   .. rst-class:: api-index-list-item api-kind-function api-parent-kind-namespace

   * :js:func:`~Operators.Camera.applyGravity`
   * :js:func:`~Operators.Camera.buildCollisionRayConfig`
   * :js:func:`~Operators.Camera.clamp`
   * :js:func:`~Operators.Camera.getDownAxis`
   * :js:func:`~Operators.Camera.normalizeDirections`
   * :js:func:`~Operators.Camera.removeOpposing`
   * :js:func:`~Operators.Camera.testWallCollision`





------------

Type Aliases
============

.. rst-class:: ts-api-section

.. _Operators.Camera.CameraRotateFunction:

CameraRotateFunction
--------------------

Variables
=========

.. container:: ts-api-section

   .. js:data:: Camera.MAX_ANGLE

      :type: 150





.. container:: ts-api-section

   .. js:data:: Camera.MAX_TILT

      :type: 45





.. container:: ts-api-section

   .. js:data:: Camera.MIN_ANGLE

      :type: 30





.. container:: ts-api-section

   .. js:data:: Camera.MIN_TILT

      :type: -45





Functions
=========

.. rst-class:: ts-api-section

applyGravity
------------

.. js:function:: applyGravity( view, pointObject, downVector, maxFallDistance)

   :param view: The ``View`` of the scene.
   :type view: View
   :param pointObject: The point object to fall.
   :type pointObject: Point3
   :param downVector: The vector used to determine the direction of fall.
   :type downVector: Point3
   :param maxFallDistance: If the fall distance would exceed this value, then gravity is not applied at all.
   :type maxFallDistance: null | number


   This returns the final position of a point object when gravity is applied.
   If there are no floors to collide with, null is returned.

   It is the caller's responsibility to interpolate smooth motion if desired.


   :rtype: Promise <Point3 | null>

.. rst-class:: ts-api-section

buildCollisionRayConfig
-----------------------

.. js:function:: buildCollisionRayConfig( bimMask, maxWorldDistance)

   :param bimMask: Restricts the objects the selection ray can select to the BIM types present in the mask.
   :type bimMask: BimMask
   :param maxWorldDistance: If non-null, this limits the distance the selection ray can travel to hit an object.
   :type maxWorldDistance: null | number




   :returns: A ray pick config object suitable for BIM collision tests.


   :rtype: PickConfig

.. rst-class:: ts-api-section

clamp
-----

.. js:function:: clamp( value, min, max)

   :param value: None
   :type value: number
   :param min: None
   :type min: number
   :param max: None
   :type max: number


   :rtype: number

.. rst-class:: ts-api-section

getDownAxis
-----------

.. js:function:: getDownAxis( model)

   :param model: None
   :type model: Model


   Returns the vector pointing down in the scene.


   :rtype: Point3

.. rst-class:: ts-api-section

normalizeDirections
-------------------

.. js:function:: normalizeDirections( directions)

   :param directions: None
   :type directions: Set <WalkDirection>


   Normalizes a set of directions such that it does not contain
   opposing directions. If opposing directions do exist, then they
   cancel each other and are removed from the set.


   :rtype: void

.. rst-class:: ts-api-section

removeOpposing
--------------

.. js:function:: removeOpposing( set, x, y)

   :param set: The set to inspect and alter.
   :type set: Set <T>
   :param x: The value that cancels with ``y``.
   :type x: T
   :param y: The value that cancels with ``x``.
   :type y: T


   If the input set contains both ``x`` and ``y``, then both ``x`` and ``y`` are removed from the set.
   Otherwise this function does nothing.


   :rtype: void

.. rst-class:: ts-api-section

testWallCollision
-----------------

.. js:function:: testWallCollision( view, position, movementVector, maxCollisionDistance)

   :param view: None
   :type view: View
   :param position: None
   :type position: Point3
   :param movementVector: None
   :type movementVector: Point3
   :param maxCollisionDistance: None
   :type maxCollisionDistance: number


   Returns the point of collision or null if there is none.


   :rtype: Promise <FaceSelectionItem | null>

