UNPKG

soonspacejs

Version:
49 lines (48 loc) 1.78 kB
import { Vector3, Box2, Matrix3, Matrix4, ShapeGeometry, Box3, Sphere, Object3D, Texture, MeshStandardMaterial } from 'three'; export declare function getPolygonGeometryInfo(points: Vector3[]): { geometry: ShapeGeometry; polygonBox: Box2; modelMatrix: Matrix4; planeMatrix: Matrix4; projectionMatrix: Matrix4; position: Vector3; }; /** * 创建平面投影矩阵 * @param points */ export declare function createPlaneMatrix(points: Vector3[]): Matrix3; /** * 创建 uv 变换矩阵 * @remarks * 需要对热力图数据进行y值翻转 * @param points * @returns */ export declare function createUVMatrix(box: Box2): Matrix3; /** * 判断包围合 与 对象的包围盒是否相交 */ export declare function boundingIsIntersected(target: Box3 | Sphere, obj: Object3D): boolean; export declare function createTexture(image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture; export interface SetTextureOptions { /** * 是否使用缓存中的材质 */ cache?: boolean; /** * 是否只更新当前 Mesh 的贴图 * @remarks * 当 Mesh 与 其它 Mesh 共享 材质时,更新纹理会拿所有共享该 材质的 Mesh 都更新,将 independ 设置为 true 可以禁止这种行为,使得只会更新传入的 Mesh 的贴图。 */ independ?: boolean; } /** * 设置贴图 * @param material * @param image * @param cache * @param textureCache * @returns */ export declare function setTexture(material: MeshStandardMaterial, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture;