PhysicsPort
Interface
Section titled “Interface”export interface PhysicsPort { apply(state: SimulationState): void;}PURPOSE
Section titled “PURPOSE”A port that receives SimulationState and reflects the computation results to the DOM and other outputs.
The Simulator calls apply() after each fixed timestep computation.
| Method | Description |
|---|---|
apply(state) | Writes state (position, velocity, etc.) to external targets (DOM, etc.) |
In SimulationContext, PhysicsPort can be specified as a single port or an array.
When multiple PhysicsPorts are provided, all apply() calls receive the same state.