UNPKG

1.41 kBTypeScriptView Raw
1import type { IValueWithRandom } from "../Options/Interfaces/IValueWithRandom";
2import type { ICoordinates } from "../Core/Interfaces/ICoordinates";
3import { MoveDirection, MoveDirectionAlt } from "../Enums/Directions";
4import type { IVelocity } from "../Core/Interfaces/IVelocity";
5import { RangeValue } from "../Types/RangeValue";
6import { Vector } from "../Core/Particle/Vector";
7export declare class NumberUtils {
8 static clamp(num: number, min: number, max: number): number;
9 static mix(comp1: number, comp2: number, weight1: number, weight2: number): number;
10 static randomInRange(r: RangeValue): number;
11 static getRangeValue(value: RangeValue): number;
12 static getRangeMin(value: RangeValue): number;
13 static getRangeMax(value: RangeValue): number;
14 static setRangeValue(source: RangeValue, value?: number): RangeValue;
15 static getValue(options: IValueWithRandom): number;
16 static getDistances(pointA: ICoordinates, pointB: ICoordinates): {
17 dx: number;
18 dy: number;
19 distance: number;
20 };
21 static getDistance(pointA: ICoordinates, pointB: ICoordinates): number;
22 static getParticleBaseVelocity(direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt): Vector;
23 static rotateVelocity(velocity: IVelocity, angle: number): IVelocity;
24 static collisionVelocity(v1: Vector, v2: Vector, m1: number, m2: number): Vector;
25}