.. role:: ts-api-decorator

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

.. js:module:: Animation
   :noindex:

.. container:: ts-api-section

   .. js:class:: Sampler

      Describes how the keyframes in a buffer are sampled.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~Animation.Sampler.constructor`



.. container:: api-index-section

   .. rubric:: Properties

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

   * :js:attr:`~Animation.Sampler.buffer`
   * :js:attr:`~Animation.Sampler.interpolationType`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Animation.Sampler.interpolateQuat`
   * :js:meth:`~Animation.Sampler.interpolateScalar`
   * :js:meth:`~Animation.Sampler.interpolateVec3`
   * :js:meth:`~Animation.Sampler.interpolateVec3CubicSpline`





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

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

.. container:: ts-api-section

   .. js:function:: Sampler.constructor( buffer, interpolationType)

      :param buffer: The buffer that will be sampled.
      :type buffer: KeyframeBuffer
      :param interpolationType: The Type of interpolation that will be used
      :type interpolationType: InterpolationType


      Creates a new sampler for a [[KeyframeBuffer]]


      :rtype: Sampler



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: Sampler.buffer

      :type: KeyframeBuffer

      The buffer that will be sampled.



.. container:: ts-api-section

   .. js:attribute:: Sampler.interpolationType

      :type: InterpolationType

      The Type of interpolation that will be used



Methods
=======

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

interpolateQuat
---------------

.. js:method:: Sampler.interpolateQuat( t, out)

   :param t: None
   :type t: number
   :param out: None
   :type out: Quaternion


   Computes an interpolated quaternion for the given frame.


   :rtype: void

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

interpolateScalar
-----------------

.. js:method:: Sampler.interpolateScalar( t)

   :param t: None
   :type t: number


   Computes an interpolated scalar value for the given frame.


   :rtype: number

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

interpolateVec3
---------------

.. js:method:: Sampler.interpolateVec3( t, out)

   :param t: None
   :type t: number
   :param out: None
   :type out: Point3


   Computes an interpolated Vector 3 value for the given frame.


   :rtype: void

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

interpolateVec3CubicSpline
--------------------------

.. js:method:: Sampler.interpolateVec3CubicSpline( k0, k1, t, out)

   :param k0: None
   :type k0: number
   :param k1: None
   :type k1: number
   :param t: None
   :type t: number
   :param out: None
   :type out: Point3


   Performs Cubic Spline Interpolation on the Vector3 values at keyframes beginning at indices k0 and k1


   :rtype: void

