Move to Renderer V2

This commit is contained in:
duckietm
2024-04-03 09:27:56 +02:00
parent 110c3ad393
commit b3134ce50b
4080 changed files with 115593 additions and 66375 deletions
@@ -0,0 +1,56 @@
import { Texture } from 'pixi.js';
import { IsometricImageFurniVisualization } from './IsometricImageFurniVisualization';
export class FurnitureDynamicThumbnailVisualization extends IsometricImageFurniVisualization
{
private _cachedUrl: string;
constructor()
{
super();
this._cachedUrl = null;
this._hasOutline = true;
}
protected updateModel(scale: number): boolean
{
if(this.object)
{
const thumbnailUrl = this.getThumbnailURL();
if(this._cachedUrl !== thumbnailUrl)
{
this._cachedUrl = thumbnailUrl;
if(this._cachedUrl && (this._cachedUrl !== ''))
{
const image = new Image();
image.src = thumbnailUrl;
image.crossOrigin = '*';
image.onload = () =>
{
const texture = Texture.from(image);
texture.source.scaleMode = 'linear';
this.setThumbnailImages(texture);
};
}
else
{
this.setThumbnailImages(null);
}
}
}
return super.updateModel(scale);
}
protected getThumbnailURL(): string
{
throw (new Error('This method must be overridden!'));
}
}