Module
Hylograph.Simulation.Consumers
- Package
- purescript-hylograph-simulation
- Repository
- afcondon/purescript-hylograph-simulation
The tick consumer for a force simulation: what makes a simulation
something hylograph-transitions' Coordinator can tick, beside any
transitions it is ticking.
The consumers for transitions themselves (transitionConsumer,
transitionGroupConsumer) are in Hylograph.Transition.Consumers, in
hylograph-transitions, since 2.0.0: they never needed a simulation.
#simulationConsumer Source
simulationConsumer :: forall row linkRow. Simulation row linkRow -> Number -> Effect Unit -> Milliseconds -> Effect TickResultA tick function for a force simulation.
The simulation's tick is called on each frame. Converged with the
alpha while it is settling, Completed once alpha is below the
threshold.
Do not call FE.start on the simulation: the Coordinator owns the
frame loop. Call FE.create, FE.setNodes, FE.addForce and so on.
sim <- FE.create FE.defaultConfig
FE.setNodes myNodes sim
FE.addForce (FE.ManyBody "charge" FE.defaultManyBody) sim
C.register coord
{ tick: simulationConsumer sim 0.001 (renderNodes nodes)
, onComplete: log "Simulation converged"
}
- Modules
- Hylograph.
Config. Force - Hylograph.
Config. Scene - Hylograph.
ForceEngine - Hylograph.
ForceEngine. Core - Hylograph.
ForceEngine. Demo - Hylograph.
ForceEngine. Events - Hylograph.
ForceEngine. Links - Hylograph.
ForceEngine. Registry - Hylograph.
ForceEngine. Render - Hylograph.
ForceEngine. Setup - Hylograph.
ForceEngine. Setup. WASM - Hylograph.
ForceEngine. Simulation - Hylograph.
ForceEngine. Types - Hylograph.
ForceEngine. WASM - Hylograph.
ForceEngine. WASMEngine - Hylograph.
Scene. Engine - Hylograph.
Scene. Handle - Hylograph.
Scene. Rules - Hylograph.
Scene. Types - Hylograph.
Simulation - Hylograph.
Simulation. Consumers - Hylograph.
Simulation. Emitter - Hylograph.
Simulation. HATS - Hylograph.
Simulation. Scene - Hylograph.
Simulation. Stepped - Hylograph.
Transition. Example