Options
All
  • Public
  • Public/Protected
  • All
Menu

A 3D trajectory consisting of an order list of vectors describing a path of motion through 3D space.

Hierarchy

  • Trajectory

Index

Constructors

  • new Trajectory(segmentLength?: number): Trajectory
  • Create a new empty Trajectory.

    Parameters

    • Optional segmentLength: number

      radius of discretization for Trajectory points

    Returns Trajectory

Methods

  • Append a new point to the Trajectory. NOTE: This implementation has many allocations.

    Parameters

    Returns void

  • getLength(): number
  • Get the length of the Trajectory.

    Returns number

    length of the Trajectory

  • resampleAtTargetResolution(targetResolution: number): Trajectory
  • Create a new Trajectory with a segment length chosen to make it probable that the new Trajectory will have a specified number of segments. This operation is imprecise.

    Parameters

    • targetResolution: number

      number of segments desired

    Returns Trajectory

    new Trajectory with approximately the requested number of segments

  • serialize(): string
  • Serialize to JSON.

    Returns string

    serialized JSON string

  • tokenize(tokens: DeepImmutableArray<Vector3>): number[]
  • Convert Trajectory segments into tokenized representation. This representation is an array of numbers where each nth number is the index of the token which is most similar to the nth segment of the Trajectory.

    Parameters

    • tokens: DeepImmutableArray<Vector3>

      list of vectors which serve as discrete tokens

    Returns number[]

    list of indices of most similar token per segment

  • Deserialize from JSON.

    Parameters

    • json: string

      serialized JSON string

    Returns Trajectory

    deserialized Trajectory

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme