@egjs/view3d
Version:
Fast & Customizable glTF 3D model viewer, packed with full of features!
39 lines (38 loc) • 2.94 kB
TypeScript
import * as THREE from "three";
import View3D from "./View3D";
import { NoBoolean, TypedArray } from "./type/utils";
import { Model } from "./core";
export declare const isNumber: (val: any) => val is number;
export declare const isString: (val: any) => val is string;
export declare const isElement: (val: any) => val is Element;
export declare const getNullableElement: (el: string | HTMLElement, parent?: HTMLElement) => HTMLElement;
export declare const getElement: (el: string | HTMLElement, parent?: HTMLElement) => HTMLElement;
export declare const findCanvas: (root: HTMLElement, selector: string) => HTMLCanvasElement;
export declare const isCSSSelector: (val: any) => boolean;
export declare const range: (end: number) => number[];
export declare const toRadian: (x: number) => number;
export declare const toDegree: (x: number) => number;
export declare const clamp: (x: number, min: number, max: number) => number;
export declare const lerp: (a: number, b: number, t: number) => number;
export declare const circulate: (val: number, min: number, max: number) => number;
export declare const merge: (target: object, ...srcs: object[]) => object;
export declare const getBoxPoints: (box: THREE.Box3) => THREE.Vector3[];
export declare const toPowerOfTwo: (val: number) => number;
export declare const getPrimaryAxisIndex: (basis: THREE.Vector3[], viewDir: THREE.Vector3) => number;
export declare const getRotationAngle: (center: THREE.Vector2, v1: THREE.Vector2, v2: THREE.Vector2) => number;
export declare const getObjectOption: <T extends boolean | object>(val: T) => NoBoolean<T>;
export declare const toBooleanString: (val: boolean) => "true" | "false";
export declare const getRotatedPosition: (distance: number, yawDeg: number, pitchDeg: number) => THREE.Vector3;
export declare const directionToYawPitch: (direction: THREE.Vector3) => {
yaw: number;
pitch: number;
};
export declare const createLoadingContext: (view3D: View3D, src: string) => import(".").LoadingItem;
export declare const getAttributeScale: (attrib: THREE.BufferAttribute | THREE.InterleavedBufferAttribute) => number;
export declare const getSkinnedVertex: (posIdx: number, mesh: THREE.SkinnedMesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]>, positionScale: number, skinWeightScale: number) => THREE.Vector3;
export declare const isSignedArrayBuffer: (buffer: TypedArray) => boolean;
export declare const checkHalfFloatAvailable: (renderer: THREE.WebGLRenderer) => boolean;
export declare const getFaceVertices: (model: Model, meshIndex: number, faceIndex: number) => THREE.Vector3[];
export declare const getAnimatedFace: (model: Model, meshIndex: number, faceIndex: number) => THREE.Vector3[];
export declare const subclip: (sourceClip: THREE.AnimationClip, name: string, startTime: number, endTime: number) => THREE.AnimationClip;
export declare const parseAsBboxRatio: (arr: (string | number)[], bbox: THREE.Box3) => THREE.Vector3;