Vec2 specialization of TimedDataContainer

Hierarchy (view full)

Constructors

Properties

data: TimedData<vec2>[] = []

Accessors

  • get size(): number
  • Returns number

    the size of the container, number of contained elements

  • get windowMode(): number
  • Returns number

    the currently set window mode of the container

  • get windowSize(): number
  • Returns number

    the currently set window size of the container, time interval or frame number depending on the windowMode

Methods

  • Returns number

    the velocity aggregated, using absolute distance between the vectors as delta values between the data points

    Tries to overcome the velocity measurement problem caused by data duplications because of the different render and tracking frame rates: Assuming closely even render frame rate, and frequent data duplications on every second frame, calculates the delta between the current data and the one before the previous data Averages these cross computed velocity values. Requires at least 4 data elements to return valid velocity, othervise returns null

    ti - ith time point di - ith data

    t0 t2 t4


    / \ /
    -|--|--|--|--|- d0 d0 d1 d1 d2 ___/ t1 t3

  • adds new data to the container with timestamp updates the data array

    Parameters

    • timestamp: number

      timestamp of the data

    • data: vec2

      custom data

    Returns void

  • sets the window size in time unit or frame number depending on the windowMode

    Parameters

    • windowSize: number

      time unit or frame number

    Returns void

  • Updates the container by removing the outdated elements from the front of the data array. In FRAME windowMode, only the last windowSize elements are kept In TIME mode, the elements older than windowSize are removed from the frint of the array (relative to the current timestamp parameter)

    Parameters

    • timestamp: number

      current timestamp

    Returns void