🆙 Clouds work 100% now

This commit is contained in:
duckietm
2026-02-05 11:06:59 +01:00
parent 120a502a7d
commit 91c20c49e7
2 changed files with 15 additions and 3 deletions
@@ -624,8 +624,8 @@ export class RoomPlane implements IRoomPlane
this._landscapeOffsetY, this._landscapeOffsetY,
this._animationCanvasWidth, this._animationCanvasWidth,
this._animationCanvasHeight, this._animationCanvasHeight,
this._leftSide.length, this._textureMaxX,
this._rightSide.length, this._textureMaxY,
timeSinceStartMs timeSinceStartMs
); );
} }
@@ -5,11 +5,16 @@ import { AnimationItem } from './AnimationItem';
export class PlaneVisualizationAnimationLayer export class PlaneVisualizationAnimationLayer
{ {
private static RANDOM_SEED: number = 131071;
private _isDisposed: boolean = false; private _isDisposed: boolean = false;
private _items: AnimationItem[] = []; private _items: AnimationItem[] = [];
private _randomState: number;
constructor(items: IAssetPlaneVisualizationAnimatedLayerItem[], assets: IGraphicAssetCollection) constructor(items: IAssetPlaneVisualizationAnimatedLayerItem[], assets: IGraphicAssetCollection)
{ {
this._randomState = PlaneVisualizationAnimationLayer.RANDOM_SEED;
if(items && assets) if(items && assets)
{ {
for(const item of items) for(const item of items)
@@ -34,6 +39,13 @@ export class PlaneVisualizationAnimationLayer
} }
} }
private seededRandom(): number
{
this._randomState = ((this._randomState * 1103515245 + 12345) & 0x7fffffff);
return (this._randomState % 10000) / 10000;
}
private parseCoordinate(value: string, randomValue: string): number private parseCoordinate(value: string, randomValue: string): number
{ {
let result = 0; let result = 0;
@@ -53,7 +65,7 @@ export class PlaneVisualizationAnimationLayer
if(randomValue) if(randomValue)
{ {
const random = parseFloat(randomValue); const random = parseFloat(randomValue);
if(!isNaN(random)) result += (Math.random() * random); if(!isNaN(random)) result += (this.seededRandom() * random);
} }
return result; return result;