You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

74 lines
1.8 KiB

import { Object3D } from 'three'
import LineSegmentManager, { LineManageWrap } from '@/core/manager/LineSegmentManager.ts'
import InstancePointManager, { PointManageWrap } from '@/core/manager/InstancePointManager.ts'
import * as THREE from 'three'
//
// /**
// * 点数据接口, 用于平衡 Object3D 一致的取数方式
// */
// export interface PointData {
// uuid: string
// name: string
// color?: THREE.Color;
// visible: boolean
//
// userData: UserData
// position: THREE.Vector3
// rotation: THREE.Euler
// scale: THREE.Vector3
//
// meshIndex: number
// }
//
// /**
// * 线段数据接口, 用于平衡 Object3D 一致的取数方式
// */
// export interface LineSegmentData {
// uuid: string;
// name: string;
// color?: THREE.Color;
// visible?: boolean;
// userData: UserData;
//
// position: THREE.Vector3
// rotation: THREE.Euler
// scale: THREE.Vector3
//
// start: THREE.Vector3;
// end: THREE.Vector3;
// }
/**
* 平面的基本定义
*/
export const BasePlane = {
LEFT: 0b000010,
RIGHT: 0b000001,
FRONT: 0b001000,
BEHIND: 0b000100,
TOP: 0b100000,
BOTTOM: 0b010000,
TRANSVERSE: 0b10000000,
LONGITUDINAL: 0b01000000,
THROW: 0b00100000,
toArray: () => {
return [BasePlane.LEFT, BasePlane.BEHIND, BasePlane.RIGHT, BasePlane.FRONT, BasePlane.BOTTOM, BasePlane.TOP, BasePlane.TRANSVERSE, BasePlane.LONGITUDINAL, BasePlane.THROW]
}
}
export interface LineManageReference {
manager: LineSegmentManager
id: string
}
export interface PointManagerReference {
manager: InstancePointManager
id: string
}
export type Object3DLike = Object3D | LineManageWrap | PointManageWrap
/**
* 坐标的范指型, 可以是 THREE.Vector3 或者三元数组
*/
export type Vector3Like = THREE.Vector3 | number[]