dispose method

  1. @override
void dispose()
override

Implementation

@override
dispose() {
  domElement.removeEventListener('pointerdown', _onPointerDown);
  domElement.removeEventListener('pointermove', _onPointerHover);
  domElement.removeEventListener('pointermove', _onPointerMove);
  domElement.removeEventListener('pointerup', _onPointerUp);

  traverse((child) {
    if (child.geometry) child.geometry.dispose();
    if (child.material) child.material.dispose();
  });
}