import * as THREE from "three"; /** * 焦点 * @description * 可以传入 THREE.Intersection 可以是 Five 的 Intersection */ interface IntersectionLike { /** 焦点坐标 */ point: THREE.Vector3; /** 焦点面片 */ face?: { normal: THREE.Vector3; } | null; } /** * 贴纸 */ declare class Sticker extends THREE.Mesh { static get version(): string; private _needsRender; /** * 贴纸 * @description * 默认加载时, 透明图根据图片类型,如果是 png 默认透明,其他为不透明,且不支持 gif 动画。 * @param width - 贴纸长 * @param height - 贴纸宽 * @param resource - 贴纸图片地址 或者 image / canvas / video 标签 * * @example * ``` * const resource = "https://vr-public.realsee-cdn.cn/release/static/image/release/five/demo/sticker/kagami.jpg"; * five.on("wantsTapGesture", raycaster => { * const [intersection] = five.model.intersectRaycaster(raycaster); * if (intersection) { * const sticker = new Sticker(1, 1, resource); * five.scene.add(sticker); * sticker.locationWithIntersection(intersection); * } * return false; * }); * ``` */ constructor(width: number, height: number, resource: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement); get needsRender(): boolean; set needsRender(value: boolean); /** * 设置贴纸大小 * @param width - 贴纸长 * @param height - 贴纸宽 */ setSize(width: number, height: number): void; /** * 设置贴纸背景是否透明 * @param transparent - 是否透明 */ setTransparent(transparent: boolean): void; /** * 通过焦点快捷设置贴纸位置 * @param intersection - 焦点 * @param offset - 位置值(已通过焦点面的法线位移一定值,防止重叠) */ locationWithIntersection(intersection: IntersectionLike, offset?: number): void; /** * 资源回收 */ dispose(): void; } export { Sticker, IntersectionLike };