# Sampler

class Animation.Sampler()

  Describes how the keyframes in a buffer are sampled.

Constructors

- `constructor()`

Properties

- `buffer`

- `interpolationType`

Methods

- `interpolateQuat()`

- `interpolateScalar()`

- `interpolateVec3()`

- `interpolateVec3CubicSpline()`

## Constructors

Sampler.constructor(buffer, interpolationType)
  Arguments

    - buffer (`KeyframeBuffer()`) – The buffer that will be sampled.

    - interpolationType (`InterpolationType()`) – The Type of interpolation that will be used

  Creates a new sampler for a [[KeyframeBuffer]]

  Return type

    Sampler

## Properties

Sampler.buffer
  Type

    KeyframeBuffer

  The buffer that will be sampled.

Sampler.interpolationType
  Type

    InterpolationType

  The Type of interpolation that will be used

## Methods

### interpolateQuat

Sampler.interpolateQuat(t, out)
  Arguments

    - t (`number()`) – None

    - out (`Quaternion()`) – None

  Computes an interpolated quaternion for the given frame.

  Return type

    void

### interpolateScalar

Sampler.interpolateScalar(t)
  Arguments

    - t (`number()`) – None

  Computes an interpolated scalar value for the given frame.

  Return type

    number

### interpolateVec3

Sampler.interpolateVec3(t, out)
  Arguments

    - t (`number()`) – None

    - out (`Point3()`) – None

  Computes an interpolated Vector 3 value for the given frame.

  Return type

    void

### interpolateVec3CubicSpline

Sampler.interpolateVec3CubicSpline(k0, k1, t, out)
  Arguments

    - k0 (`number()`) – None

    - k1 (`number()`) – None

    - t (`number()`) – None

    - out (`Point3()`) – None

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

  Return type

    void