You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 15:36:18 +00:00
🆙 Clouds work 100% now
This commit is contained in:
@@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-1
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user