Class: Renderer

Renderer(simulator)

Renderer class for managing the WebGL rendering of the 3D scene. Uses Three.js for rendering and interaction.

Constructor

new Renderer(simulator)

Creates an instance of Renderer. Initializes the renderer with the provided simulator.
Parameters:
Name Type Description
simulator Simulator The simulator instance containing scene, canvas, and sizes.
Source:

Methods

dispose()

Disposes of the WebGLRenderer instance and cleans up event listeners. Ensures that all GPU resources are properly released to avoid memory leaks.
Source:

resize()

Adjusts the renderer size and pixel ratio when the window is resized.
Source:

update()

Renders the scene from the perspective of the camera.
Source: