import * as THREE from 'three' import { System } from '../../src' export class ExampleSystem extends System { box: THREE.Mesh createBox() { const { scene } = this._app this.box = new THREE.Mesh( new THREE.BoxGeometry(1000, 1000, 1000), new THREE.MeshPhysicalMaterial({ color: 'red', roughness: 0.5, metalness: 0.5, clearcoat: 1.0 }) ) scene.add(this.box) } onAdded(): void { this.createBox() } onRemoved(): void { const { scene } = this._app scene.remove(this.box) } onUpdating(deltaTime: number): void { this.box.rotateY(deltaTime * 0.001) } }