You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆙 Clouds work 100% now
This commit is contained in:
@@ -624,8 +624,8 @@ export class RoomPlane implements IRoomPlane
|
||||
this._landscapeOffsetY,
|
||||
this._animationCanvasWidth,
|
||||
this._animationCanvasHeight,
|
||||
this._leftSide.length,
|
||||
this._rightSide.length,
|
||||
this._textureMaxX,
|
||||
this._textureMaxY,
|
||||
timeSinceStartMs
|
||||
);
|
||||
}
|
||||
|
||||
+13
-1
@@ -5,11 +5,16 @@ import { AnimationItem } from './AnimationItem';
|
||||
|
||||
export class PlaneVisualizationAnimationLayer
|
||||
{
|
||||
private static RANDOM_SEED: number = 131071;
|
||||
|
||||
private _isDisposed: boolean = false;
|
||||
private _items: AnimationItem[] = [];
|
||||
private _randomState: number;
|
||||
|
||||
constructor(items: IAssetPlaneVisualizationAnimatedLayerItem[], assets: IGraphicAssetCollection)
|
||||
{
|
||||
this._randomState = PlaneVisualizationAnimationLayer.RANDOM_SEED;
|
||||
|
||||
if(items && assets)
|
||||
{
|
||||
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
|
||||
{
|
||||
let result = 0;
|
||||
@@ -53,7 +65,7 @@ export class PlaneVisualizationAnimationLayer
|
||||
if(randomValue)
|
||||
{
|
||||
const random = parseFloat(randomValue);
|
||||
if(!isNaN(random)) result += (Math.random() * random);
|
||||
if(!isNaN(random)) result += (this.seededRandom() * random);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user