Renderer

Renderer is the general renderer class that renders Particles, Constraints and Walls. Overall, this is a simplistic renderer intended for quick visualization. It is encouraged to write a custom renderer for more complex/efficient scenes.

Constructor

new Renderer()

Methods

clear()

Clears the frame

renderFrame()

Renders a single frame of the solver

updateContext(context)

Updates the HTMLCanvas context of each sub-renderer

Parameters:
NameTypeDescription
contextcontext

updateRendererParticles(list)

Updates the particles in the particleRenderer. Must be called every time the list of particles is reassigned.

Parameters:
NameTypeDescription
listArray.<Particle>