/
i-physics-shape.ts
74 lines (62 loc) · 2.16 KB
/
i-physics-shape.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* @hidden
*/
import { ILifecycle } from './i-lifecycle'
import { IGroupMask } from './i-group-mask'
import { IVec3Like } from '../../core/math/type-define';
import { Collider, RigidBody, PhysicMaterial, SimplexCollider } from '../../../exports/physics-framework';
import { Mesh } from '../../core';
import { ITerrainAsset } from './i-external';
import { aabb, sphere } from '../../core/geometry';
export interface IBaseShape extends ILifecycle, IGroupMask {
readonly impl: any;
readonly collider: Collider;
readonly attachedRigidBody: RigidBody | null;
initialize (v: Collider): void;
setMaterial: (v: PhysicMaterial | null) => void;
setAsTrigger: (v: boolean) => void;
setCenter: (v: IVec3Like) => void;
// setAttachedBody: (body: RigidBody | null) => void;
getAABB: (v: aabb) => void;
getBoundingSphere: (v: sphere) => void;
}
export interface IBoxShape extends IBaseShape {
setSize: (v: IVec3Like) => void;
}
export interface ISphereShape extends IBaseShape {
setRadius: (v: number) => void;
}
export interface ICapsuleShape extends IBaseShape {
setRadius: (v: number) => void;
setCylinderHeight: (v: number) => void;
setDirection: (v: number) => void;
}
export interface ICylinderShape extends IBaseShape {
setRadius: (v: number) => void;
setHeight: (v: number) => void;
setDirection: (v: number) => void;
}
export interface ISimplexShape extends IBaseShape {
setShapeType: (v: SimplexCollider.ESimplexType) => void;
setVertices: (v: IVec3Like[]) => void;
}
export interface IConeShape extends IBaseShape {
setRadius: (v: number) => void;
setHeight: (v: number) => void;
setDirection: (v: number) => void;
}
export interface ITrimeshShape extends IBaseShape {
setMesh: (v: Mesh | null) => void;
}
export interface ITerrainShape extends IBaseShape {
setTerrain: (v: ITerrainAsset | null) => void;
}
export interface IConeShape extends IBaseShape {
setRadius: (v: number) => void;
setHeight: (v: number) => void;
setDirection: (v: number) => void;
}
export interface IPlaneShape extends IBaseShape {
setNormal: (v: IVec3Like) => void;
setConstant: (v: number) => void;
}