.. role:: clio-readonly
   :class: clio-flag clio-flag-readonly


#######
Sampler
#######

.. js:class:: Animation.Sampler

   Describes how the keyframes in a buffer are sampled.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Animation.Sampler.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~Animation.Sampler.buffer`
   * :js:data:`~Animation.Sampler.interpolationType`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Animation.Sampler.interpolateQuat`
   * :js:meth:`~Animation.Sampler.interpolateScalar`
   * :js:meth:`~Animation.Sampler.interpolateVec3`
   * :js:meth:`~Animation.Sampler.interpolateVec3CubicSpline`
   
   




Constructors
============

.. js:method:: Animation.Sampler.constructor

   .. rst-class:: sig-pretty-signature
   
      | Sampler(**buffer**\ : :js:class:`KeyframeBuffer <Animation.KeyframeBuffer>`\ , **interpolationType**\ : :js:data:`InterpolationType <Animation.InterpolationType>`\ ): :js:class:`Sampler <Animation.Sampler>`
   
   Creates a new sampler for a [[KeyframeBuffer]]
   
   **Parameters**
   
      **buffer**\ : :js:class:`KeyframeBuffer <Animation.KeyframeBuffer>`
   
         The buffer that will be sampled.
   
   
      **interpolationType**\ : :js:data:`InterpolationType <Animation.InterpolationType>`
   
         The Type of interpolation that will be used
   
   
   
   **Returns**\ : :js:class:`Sampler <Animation.Sampler>`
   





Properties
==========

.. js:data:: Animation.Sampler.buffer

   .. rst-class:: clio-flags
   
      :clio-readonly:`readonly`
   
   .. rst-class:: sig-pretty-signature
   
      | buffer: :js:class:`KeyframeBuffer <Animation.KeyframeBuffer>`
   
   The buffer that will be sampled.
   



.. js:data:: Animation.Sampler.interpolationType

   .. rst-class:: sig-pretty-signature
   
      | interpolationType: :js:data:`InterpolationType <Animation.InterpolationType>`
   
   The Type of interpolation that will be used
   





Methods
=======

.. js:method:: Animation.Sampler.interpolateQuat

   .. rst-class:: sig-pretty-signature
   
      | interpolateQuat(**t**\ : *number*\ , **out**\ : *Quaternion*\ ): *void*
   
   Computes an interpolated quaternion for the given frame.
   
   **Parameters**
   
      **t**\ : *number*
   
      **out**\ : *Quaternion*
   
   
   **Returns**\ : *void*
   



.. js:method:: Animation.Sampler.interpolateScalar

   .. rst-class:: sig-pretty-signature
   
      | interpolateScalar(**t**\ : *number*\ ): *number*
   
   Computes an interpolated scalar value for the given frame.
   
   **Parameters**
   
      **t**\ : *number*
   
   
   **Returns**\ : *number*
   



.. js:method:: Animation.Sampler.interpolateVec3

   .. rst-class:: sig-pretty-signature
   
      | interpolateVec3(**t**\ : *number*\ , **out**\ : :js:class:`~Point3`\ ): *void*
   
   Computes an interpolated Vector 3 value for the given frame.
   
   **Parameters**
   
      **t**\ : *number*
   
      **out**\ : :js:class:`~Point3`
   
   
   **Returns**\ : *void*
   



.. js:method:: Animation.Sampler.interpolateVec3CubicSpline

   .. rst-class:: sig-pretty-signature
   
      | interpolateVec3CubicSpline(**k0**\ : *number*\ , **k1**\ : *number*\ , **t**\ : *number*\ , **out**\ : :js:class:`~Point3`\ ): *void*
   
   Performs Cubic Spline Interpolation on the Vector3 values at keyframes beginning at indices k0 and k1
   
   **Parameters**
   
      **k0**\ : *number*
   
      **k1**\ : *number*
   
      **t**\ : *number*
   
      **out**\ : :js:class:`~Point3`
   
   
   **Returns**\ : *void*
   





