UNPKG

@dcl-sdk/utils

Version:

A collection of helpers to make it easier to build a Decentraland scene using the SDK 7.

29 lines (28 loc) 1.48 kB
import { Entity } from '@dcl/sdk/ecs'; import { Vector3, Quaternion } from '@dcl/sdk/math'; export declare function remap(value: number, min1: number, max1: number, min2: number, max2: number): number; export declare function getWorldPosition(entity: Entity): Vector3; export declare function getWorldRotation(entity: Entity): Quaternion; export declare enum InterpolationType { LINEAR = "linear", EASEINQUAD = "easeinquad", EASEOUTQUAD = "easeoutquad", EASEQUAD = "easequad", EASEINSINE = "easeinsine", EASEOUTSINE = "easeoutsine", EASESINE = "easeinoutsine", EASEINEXPO = "easeinexpo", EASEOUTEXPO = "easeoutexpo", EASEEXPO = "easeinoutexpo", EASEINELASTIC = "easeinelastic", EASEOUTELASTIC = "easeoutelastic", EASEELASTIC = "easeinoutelastic", EASEINBOUNCE = "easeinbounce", EASEOUTEBOUNCE = "easeoutbounce", EASEBOUNCE = "easeinoutbounce" } export declare function interpolate(type: InterpolationType, t: number): number; export declare function createCatmullRomSpline(points: Vector3[], nbPoints: number, closed?: boolean): Vector3[]; export declare function areAABBIntersecting(aMin: Vector3, aMax: Vector3, bMin: Vector3, bMax: Vector3): boolean; export declare function areSpheresIntersecting(aPos: Vector3, aRadius: number, bPos: Vector3, bRadius: number): boolean; export declare function areAABBSphereIntersecting(boxMin: Vector3, boxMax: Vector3, spherePos: Vector3, sphereRadius: number): boolean;