forked from galacean/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIColliderShape.ts
71 lines (62 loc) · 1.64 KB
/
IColliderShape.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
import { Quaternion, Vector3 } from "@galacean/engine-math";
import { IPhysicsMaterial } from "../IPhysicsMaterial";
/**
* Interface for physics collider shape.
*/
export interface IColliderShape {
/**
* Set local rotation.
* @param rotation - The local rotation
*/
setRotation(rotation: Vector3): void;
/**
* Set local position.
* @param position - The local position
*/
setPosition(position: Vector3): void;
/**
* Set world scale of shape.
* @param scale - The scale
*/
setWorldScale(scale: Vector3): void;
/**
* Sets the contact offset.
* @param offset - contact offset
*/
setContactOffset(offset: number): void;
/**
* Set physics material on shape.
* @param material - The physics material
*/
setMaterial(material: IPhysicsMaterial): void;
/**
* Set trigger or not.
* @param value - True for TriggerShape, false for SimulationShape
*/
setIsTrigger(value: boolean): void;
/**
* Get the distance between a point and the shape.
* @param position - The position in world space
* @param rotation - The rotation in world space
* @param point - The point
* @returns The distance information
*/
pointDistance(position: Vector3, rotation: Quaternion, point: Vector3): IPointDistanceInfo;
/**
* Decrements the reference count of a shape and releases it if the new reference count is zero.
*/
destroy(): void;
}
/**
* Distance information of a point to the shape.
*/
export interface IPointDistanceInfo {
/**
* The distance between the point and the shape.
*/
distance: number;
/**
* The closest point on the shape.
*/
closestPoint: Vector3;
}