@galacean/engine-design 1.3.24 → 1.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-design",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"types": "types/index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@galacean/engine-math": "1.
|
|
20
|
+
"@galacean/engine-math": "1.4.0-alpha.1"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"b:types": "tsc"
|
|
@@ -16,44 +16,79 @@ export interface IDynamicCollider extends ICollider {
|
|
|
16
16
|
* @param outRotation - The global rotation
|
|
17
17
|
*/
|
|
18
18
|
getWorldTransform(outPosition: Vector3, outRotation: Quaternion): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get the linear damping coefficient.
|
|
21
|
+
*/
|
|
22
|
+
getLinearDamping(): number;
|
|
19
23
|
/**
|
|
20
24
|
* Sets the linear damping coefficient.
|
|
21
|
-
* @param value - Linear damping coefficient
|
|
25
|
+
* @param value - Linear damping coefficient
|
|
22
26
|
*/
|
|
23
27
|
setLinearDamping(value: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get the angular damping coefficient.
|
|
30
|
+
*/
|
|
31
|
+
getAngularDamping(): number;
|
|
24
32
|
/**
|
|
25
33
|
* Sets the angular damping coefficient.
|
|
26
|
-
* @param value - Angular damping coefficient
|
|
34
|
+
* @param value - Angular damping coefficient
|
|
27
35
|
*/
|
|
28
36
|
setAngularDamping(value: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get the linear velocity of the actor.
|
|
39
|
+
* @param out - The linear velocity of the actor
|
|
40
|
+
*/
|
|
41
|
+
getLinearVelocity(out: Vector3): Vector3;
|
|
29
42
|
/**
|
|
30
43
|
* Sets the linear velocity of the actor.
|
|
31
|
-
* @param value - New linear velocity of actor
|
|
44
|
+
* @param value - New linear velocity of actor
|
|
32
45
|
*/
|
|
33
46
|
setLinearVelocity(value: Vector3): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get the angular velocity of the actor.
|
|
49
|
+
* @param out - The angular velocity of the actor
|
|
50
|
+
*/
|
|
51
|
+
getAngularVelocity(out: Vector3): Vector3;
|
|
34
52
|
/**
|
|
35
53
|
* Sets the angular velocity of the actor.
|
|
36
|
-
* @param value - New angular velocity of actor
|
|
54
|
+
* @param value - New angular velocity of actor
|
|
37
55
|
*/
|
|
38
56
|
setAngularVelocity(value: Vector3): void;
|
|
39
57
|
/**
|
|
40
58
|
* Sets the mass of a dynamic actor.
|
|
41
|
-
* @param value - New mass value for the actor
|
|
59
|
+
* @param value - New mass value for the actor
|
|
42
60
|
*/
|
|
43
61
|
setMass(value: number): void;
|
|
44
62
|
/**
|
|
45
|
-
* Sets the
|
|
46
|
-
* @param value - Mass frame offset transform relative to the actor frame
|
|
63
|
+
* Sets the center of mass relative to the actor.
|
|
64
|
+
* @param value - Mass frame offset transform relative to the actor frame
|
|
47
65
|
*/
|
|
48
66
|
setCenterOfMass(value: Vector3): void;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the center of mass relative to the actor.
|
|
69
|
+
* @param out - The center of mass of the actor
|
|
70
|
+
*/
|
|
71
|
+
getCenterOfMass(out: Vector3): Vector3;
|
|
49
72
|
/**
|
|
50
73
|
* Sets the inertia tensor, using a parameter specified in mass space coordinates.
|
|
51
|
-
* @param value - New mass space inertia tensor for the actor
|
|
74
|
+
* @param value - New mass space inertia tensor for the actor
|
|
52
75
|
*/
|
|
53
76
|
setInertiaTensor(value: Vector3): void;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the inertia tensor of the actor.
|
|
79
|
+
* @param out - The mass space inertia tensor of the actor
|
|
80
|
+
*/
|
|
81
|
+
getInertiaTensor(out: Vector3): Vector3;
|
|
82
|
+
/**
|
|
83
|
+
* Sets the mass of a dynamic actor and automatically updates its inertia tensor.
|
|
84
|
+
* @param mass - New mass value for the actor
|
|
85
|
+
* @remarks This differs from setMass() by automatically updating
|
|
86
|
+
* the inertia tensor and center of mass based on the new mass value.
|
|
87
|
+
*/
|
|
88
|
+
setMassAndUpdateInertia(mass: number): void;
|
|
54
89
|
/**
|
|
55
90
|
* Set the maximum angular velocity permitted for this actor.
|
|
56
|
-
* @param value - Max allowable angular velocity for actor
|
|
91
|
+
* @param value - Max allowable angular velocity for actor
|
|
57
92
|
*/
|
|
58
93
|
setMaxAngularVelocity(value: number): void;
|
|
59
94
|
/**
|
|
@@ -63,12 +98,12 @@ export interface IDynamicCollider extends ICollider {
|
|
|
63
98
|
setMaxDepenetrationVelocity(value: number): void;
|
|
64
99
|
/**
|
|
65
100
|
* Sets the mass-normalized kinetic energy threshold below which an actor may go to sleep.
|
|
66
|
-
* @param value - Energy below which an actor may go to sleep
|
|
101
|
+
* @param value - Energy below which an actor may go to sleep
|
|
67
102
|
*/
|
|
68
103
|
setSleepThreshold(value: number): void;
|
|
69
104
|
/**
|
|
70
105
|
* Sets the solver iteration counts for the body.
|
|
71
|
-
* @param value - Number of position iterations the solver should perform for this body
|
|
106
|
+
* @param value - Number of position iterations the solver should perform for this body
|
|
72
107
|
*/
|
|
73
108
|
setSolverIterations(value: number): void;
|
|
74
109
|
/**
|
|
@@ -83,7 +118,7 @@ export interface IDynamicCollider extends ICollider {
|
|
|
83
118
|
setIsKinematic(value: boolean): void;
|
|
84
119
|
/**
|
|
85
120
|
* Raises or clears a particular rigid dynamic lock flag.
|
|
86
|
-
* @param flags - the flag to raise(set) or clear
|
|
121
|
+
* @param flags - the flag to raise(set) or clear
|
|
87
122
|
*/
|
|
88
123
|
setConstraints(flags: number): void;
|
|
89
124
|
/**
|
|
@@ -106,6 +141,10 @@ export interface IDynamicCollider extends ICollider {
|
|
|
106
141
|
* Forces a collider to sleep at least one frame.
|
|
107
142
|
*/
|
|
108
143
|
sleep(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Returns whether the collider is sleeping.
|
|
146
|
+
*/
|
|
147
|
+
isSleeping(): boolean;
|
|
109
148
|
/**
|
|
110
149
|
* Forces a collider to wake up.
|
|
111
150
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
2
2
|
import { ICharacterController } from "./ICharacterController";
|
|
3
3
|
import { ICollider } from "./ICollider";
|
|
4
|
-
import { IColliderShape } from "./shape";
|
|
5
4
|
/**
|
|
6
5
|
* Interface for physics manager.
|
|
7
6
|
*/
|
|
@@ -11,16 +10,6 @@ export interface IPhysicsScene {
|
|
|
11
10
|
* @param gravity - Physics gravity
|
|
12
11
|
*/
|
|
13
12
|
setGravity(gravity: Vector3): void;
|
|
14
|
-
/**
|
|
15
|
-
* Add IColliderShape into the manager.
|
|
16
|
-
* @param colliderShape - The Collider Shape.
|
|
17
|
-
*/
|
|
18
|
-
addColliderShape(colliderShape: IColliderShape): void;
|
|
19
|
-
/**
|
|
20
|
-
* Remove IColliderShape.
|
|
21
|
-
* @param colliderShape - The Collider Shape.
|
|
22
|
-
*/
|
|
23
|
-
removeColliderShape(colliderShape: IColliderShape): void;
|
|
24
13
|
/**
|
|
25
14
|
* Add ICollider into the manager.
|
|
26
15
|
* @param collider - StaticCollider or DynamicCollider.
|
|
@@ -8,10 +8,6 @@ export interface IHingeJoint extends IJoint {
|
|
|
8
8
|
* The anchor rotation.
|
|
9
9
|
*/
|
|
10
10
|
setAxis(value: Vector3): void;
|
|
11
|
-
/**
|
|
12
|
-
* The swing offset.
|
|
13
|
-
*/
|
|
14
|
-
setSwingOffset(value: Vector3): void;
|
|
15
11
|
/**
|
|
16
12
|
* The current angle in degrees of the joint relative to its rest position.
|
|
17
13
|
*/
|
|
@@ -14,20 +14,24 @@ export interface IJoint {
|
|
|
14
14
|
*/
|
|
15
15
|
setConnectedAnchor(value: Vector3): void;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* The anchor position.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
setAnchor(value: Vector3): void;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* The scale to apply to the inverse mass of collider1 for resolving this constraint.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
setConnectedMassScale(value: number): void;
|
|
24
24
|
/**
|
|
25
|
-
* The scale to apply to the inverse mass of
|
|
25
|
+
* The scale to apply to the inverse mass of collider0 for resolving this constraint.
|
|
26
26
|
*/
|
|
27
27
|
setMassScale(value: number): void;
|
|
28
28
|
/**
|
|
29
29
|
* The scale to apply to the inverse inertia of collider1 for resolving this constraint.
|
|
30
30
|
*/
|
|
31
|
+
setConnectedInertiaScale(value: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
34
|
+
*/
|
|
31
35
|
setInertiaScale(value: number): void;
|
|
32
36
|
/**
|
|
33
37
|
* The maximum force the joint can apply before breaking.
|
|
@@ -37,4 +41,8 @@ export interface IJoint {
|
|
|
37
41
|
* The maximum torque the joint can apply before breaking.
|
|
38
42
|
*/
|
|
39
43
|
setBreakTorque(value: number): void;
|
|
44
|
+
/**
|
|
45
|
+
* Destroy the joint.
|
|
46
|
+
*/
|
|
47
|
+
destroy(): void;
|
|
40
48
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { IJoint } from "./IJoint";
|
|
2
|
-
import { Vector3 } from "@galacean/engine-math";
|
|
3
2
|
/**
|
|
4
3
|
* a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects
|
|
5
4
|
*/
|
|
6
5
|
export interface ISpringJoint extends IJoint {
|
|
7
|
-
/**
|
|
8
|
-
* The swing offset.
|
|
9
|
-
*/
|
|
10
|
-
setSwingOffset(value: Vector3): void;
|
|
11
6
|
/**
|
|
12
7
|
* Set the allowed minimum distance for the joint.
|
|
13
8
|
* @param distance the minimum distance
|