Class Trajectory
Hierarchy
- Trajectory
Index
Constructors
constructor
Create a new empty Trajectory.
Parameters
Optional segmentLength: number
radius of discretization for Trajectory points
Returns Trajectory
Methods
addSearch playground for add
Append a new point to the Trajectory. NOTE: This implementation has many allocations.
Parameters
point: DeepImmutableObject<Vector3>
point to append to the Trajectory
Returns void
get LengthSearch playground for getLength
Get the length of the Trajectory.
Returns number
length of the Trajectory
resample At Target ResolutionSearch playground for resampleAtTargetResolution
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
serializeSearch playground for serialize
Serialize to JSON.
Returns string
serialized JSON string
tokenizeSearch playground for tokenize
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
Static DeserializeSearch playground for Deserialize
Deserialize from JSON.
Parameters
json: string
serialized JSON string
Returns Trajectory
deserialized Trajectory
A 3D trajectory consisting of an order list of vectors describing a path of motion through 3D space.