@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
46 lines (45 loc) • 2.55 kB
TypeScript
import { LngLatLike, Vector2Like } from '../../types/GlobalTypes';
import { Triangle } from 'three';
import { degToRad as _degToRad, radToDeg as _radToDeg, smoothstep as _smoothstep, smootherstep as _smootherstep } from 'three/src/math/MathUtils';
export declare const degToRad: typeof _degToRad;
export declare const radToDeg: typeof _radToDeg;
export declare function clamp(val: number, min: number, max: number): number;
export declare const smoothstep: typeof _smoothstep;
export declare const smootherstep: typeof _smootherstep;
export declare function fit(val: number, srcMin: number, srcMax: number, destMin: number, destMax: number): number;
export declare function fit01(val: number, destMin: number, destMax: number): number;
export declare function fitClamp(val: number, srcMin: number, srcMax: number, destMin: number, destMax: number): number;
export declare function mix(num0: number, num1: number, blend: number): number;
export declare const fract: (number: number) => number;
export declare function randFloat(x: number, y?: number): number;
export declare function randVec2(uv: Vector2Like): number;
export declare function rand(number: number | Vector2Like): number;
export declare function round(number: number, stepSize: number): number;
export declare function mod(number: number, _mod: number): number;
export declare function highestEven(number: number): number;
export declare function nearestPower2(num: number): number;
export declare function pow2Inverse(num: number): number;
export declare function geodesicDistance(lnglat1: LngLatLike, lnglat2: LngLatLike): number;
export declare function expandTriangle(triangle: Triangle, margin: number): void;
export declare function lerpFloat(current: number, target: number, blend: number): number;
export declare class CoreMath {
static Easing: import("./Easing").EasingDictionary;
static degToRad: typeof _degToRad;
static radToDeg: typeof _radToDeg;
static clamp: typeof clamp;
static smoothstep: typeof _smoothstep;
static smootherstep: typeof _smootherstep;
static fit01: typeof fit01;
static fit: typeof fit;
static fitClamp: typeof fitClamp;
static mix: typeof mix;
static fract: (number: number) => number;
static rand: typeof rand;
static round: typeof round;
static highestEven: typeof highestEven;
static nearestPower2: typeof nearestPower2;
static pow2Inverse: typeof pow2Inverse;
static randFloat: typeof randFloat;
static randVec2: typeof randVec2;
static lerpFloat: typeof lerpFloat;
}