Skip to content

KineticsPort

export interface KineticsPort extends ActivityPort {
compute(dt: number, vector: Readonly<number[]>): void;
readonly state: SimulationState;
}

A port for multidimensional motion computation. The Simulator calls compute() at each fixed timestep to update state toward the target vector.

MemberDescription
compute(dt, vector)Advances position and velocity one step toward the target vector
stateReturns the current SimulationState (absolute position, relative displacement, velocity, activity level)
isActive()Returns true if activity level exceeds threshold (from ActivityPort)

Inherits from ActivityPort. Default implementation is the Kinetics class. Internally, it calls EnginePort.compute() for each dimension. Implementing CloneableKineticsPort allows creating copies with the same configuration.