@dcl-sdk/utils
Version:
A collection of helpers to make it easier to build a Decentraland scene using the SDK 7.
19 lines (18 loc) • 1.42 kB
TypeScript
import { Entity, IEngine } from '@dcl/sdk/ecs';
import { Vector3 } from '@dcl/sdk/math';
export type Paths = ReturnType<typeof createPaths>;
export type OnFinishCallback = () => void;
export type OnPointReachedCallback = (pointIndex: number, point: Vector3, nextPoint: Vector3) => void;
declare function createPaths(targetEngine: IEngine): {
startStraightPath(entity: Entity, points: Vector3[], duration: number, faceDirection?: boolean, onFinishCallback?: OnFinishCallback, onPointReachedCallback?: OnPointReachedCallback): void;
startSmoothPath(entity: Entity, points: Vector3[], duration: number, segmentCount: number, faceDirection?: boolean, onFinishCallback?: OnFinishCallback, onPointReachedCallback?: OnPointReachedCallback): void;
stopPath(entity: Entity): void;
getOnFinishCallback(entity: Entity): OnFinishCallback | undefined;
};
export declare const paths: {
startStraightPath(entity: Entity, points: Vector3[], duration: number, faceDirection?: boolean, onFinishCallback?: OnFinishCallback, onPointReachedCallback?: OnPointReachedCallback): void;
startSmoothPath(entity: Entity, points: Vector3[], duration: number, segmentCount: number, faceDirection?: boolean, onFinishCallback?: OnFinishCallback, onPointReachedCallback?: OnPointReachedCallback): void;
stopPath(entity: Entity): void;
getOnFinishCallback(entity: Entity): OnFinishCallback | undefined;
};
export {};