From b6e2d6c71df87c4e5671703a750c32911c9ef481 Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Mon, 23 Oct 2023 13:23:02 +0100 Subject: [PATCH] fix --- src/splat/splat-resource.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/splat/splat-resource.ts b/src/splat/splat-resource.ts index 5b02622..3efde1e 100644 --- a/src/splat/splat-resource.ts +++ b/src/splat/splat-resource.ts @@ -34,6 +34,8 @@ class SplatResource extends ContainerResource { materials: Material[] = []; textures: Texture[] = []; + handle: any; + constructor(device: GraphicsDevice, splatData: SplatData) { super(); @@ -42,7 +44,7 @@ class SplatResource extends ContainerResource { } destroy() { - + this.handle.off(); } instantiateModelEntity(/* options: any */): Entity { @@ -92,7 +94,7 @@ class SplatResource extends ContainerResource { const viewport = [0, 0]; - options.app.on('prerender', () => { + this.handle = options.app.on('prerender', () => { const cameraMat = options.camera.getWorldTransform(); cameraMat.getTranslation(pos); cameraMat.getZ(dir);