Files
cocos4/cocos/core/geometry/spec.ts
T
jiaxin.lai 4aac1be3f6 add ray_mesh to intersect (#6317)
* stash

* add ray_mesh

* stash

* ceche geometric info at runtime

* add ray_mesh & ray_model

* remove redundant data

* tweaks

* renaming
2020-03-17 16:54:57 +08:00

36 lines
699 B
TypeScript

export enum ERaycastMode {
ALL,
CLOSEST,
ANY,
}
export interface IRaySubMeshResult {
distance: number;
vertexIndex0: number;
vertexIndex1: number;
vertexIndex2: number;
}
export interface IRaySubMeshOptions {
/**
* @zh
* 检测模式:[0,1,2]=>[ALL,CLOSEST,ANY]
*/
mode: ERaycastMode;
/**
* @zh
* 检测的最大距离
*/
distance: number;
result?: IRaySubMeshResult[];
doubleSided?: boolean;
doNotZeroMin?: boolean;
}
export interface IRayMeshOptions extends IRaySubMeshOptions {
subIndices?: number[];
}
export interface IRayModelOptions extends IRayMeshOptions {
doNotTransformRay?: boolean;
}