@galacean/engine-core 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/dist/main.js +13726 -13611
- package/dist/main.js.map +1 -1
- package/dist/module.js +13243 -13213
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/index.d.ts +0 -1
- package/types/2d/sprite/SpriteMask.d.ts +2 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +0 -1
- package/types/2d/text/TextRenderer.d.ts +0 -1
- package/types/BasicResources.d.ts +2 -1
- package/types/Camera.d.ts +1 -3
- package/types/Engine.d.ts +0 -3
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +3 -0
- package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +1 -0
- package/types/Renderer.d.ts +0 -2
- package/types/Transform.d.ts +17 -7
- package/types/animation/Animator.d.ts +27 -5
- package/types/animation/AnimatorController.d.ts +12 -2
- package/types/animation/AnimatorState.d.ts +0 -1
- package/types/animation/AnimatorStateMachine.d.ts +10 -6
- package/types/animation/AnimatorStateTransition.d.ts +13 -5
- package/types/animation/AnimatorStateTransitionCollection.d.ts +1 -0
- package/types/asset/AssetType.d.ts +3 -1
- package/types/asset/ResourceManager.d.ts +3 -1
- package/types/asset/request.d.ts +10 -3
- package/types/audio/AudioClip.d.ts +24 -0
- package/types/audio/AudioManager.d.ts +1 -0
- package/types/audio/AudioSource.d.ts +72 -0
- package/types/audio/index.d.ts +3 -0
- package/types/base/Constant.d.ts +22 -22
- package/types/{2d/enums → enums}/SpriteMaskLayer.d.ts +3 -1
- package/types/index.d.ts +3 -0
- package/types/lighting/DirectLight.d.ts +5 -0
- package/types/lighting/Light.d.ts +4 -1
- package/types/material/PBRMaterial.d.ts +65 -0
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/DynamicCollider.d.ts +25 -2
- package/types/physics/PhysicsMaterial.d.ts +1 -1
- package/types/physics/joint/FixedJoint.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +9 -6
- package/types/physics/joint/Joint.d.ts +25 -7
- package/types/physics/joint/JointLimits.d.ts +34 -10
- package/types/physics/joint/JointMotor.d.ts +27 -8
- package/types/physics/joint/SpringJoint.d.ts +2 -6
- package/types/physics/shape/BoxColliderShape.d.ts +1 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
- package/types/physics/shape/ColliderShape.d.ts +2 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
- package/dist/miniprogram.js +0 -34721
package/types/base/Constant.d.ts
CHANGED
|
@@ -3,37 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare enum DataType {
|
|
5
5
|
/** Float */
|
|
6
|
-
FLOAT = 5126
|
|
6
|
+
FLOAT = 5126,// gl.FLOAT
|
|
7
7
|
/** Floating-point two-dimensional vector */
|
|
8
|
-
FLOAT_VEC2 = 35664
|
|
8
|
+
FLOAT_VEC2 = 35664,// gl.FLOAT_VEC2
|
|
9
9
|
/** Floating-point three-dimensional vector */
|
|
10
|
-
FLOAT_VEC3 = 35665
|
|
10
|
+
FLOAT_VEC3 = 35665,// gl.FLOAT_VEC3
|
|
11
11
|
/** Floating-point four-dimensional vector */
|
|
12
|
-
FLOAT_VEC4 = 35666
|
|
12
|
+
FLOAT_VEC4 = 35666,// gl.FLOAT_VEC4
|
|
13
13
|
/** Integer */
|
|
14
|
-
INT = 5124
|
|
14
|
+
INT = 5124,// gl.INT
|
|
15
15
|
/** Integer two-dimensional vector */
|
|
16
|
-
INT_VEC2 = 35667
|
|
16
|
+
INT_VEC2 = 35667,// gl.INT_VEC2
|
|
17
17
|
/** Integer three-dimensional vector */
|
|
18
|
-
INT_VEC3 = 35668
|
|
18
|
+
INT_VEC3 = 35668,// gl.INT_VEC3
|
|
19
19
|
/** Integer four-dimensional vector */
|
|
20
|
-
INT_VEC4 = 35669
|
|
20
|
+
INT_VEC4 = 35669,// gl.INT_VEC4
|
|
21
21
|
/** Boolean */
|
|
22
|
-
BOOL = 35670
|
|
22
|
+
BOOL = 35670,// gl.BOOL
|
|
23
23
|
/** Boolean two-dimensional vector */
|
|
24
|
-
BOOL_VEC2 = 35671
|
|
24
|
+
BOOL_VEC2 = 35671,// gl.BOOL_VEC2
|
|
25
25
|
/** Boolean three-dimensional vector */
|
|
26
|
-
BOOL_VEC3 = 35672
|
|
26
|
+
BOOL_VEC3 = 35672,// gl.BOOL_VEC3
|
|
27
27
|
/** Boolean four-dimensional vector */
|
|
28
|
-
BOOL_VEC4 = 35673
|
|
28
|
+
BOOL_VEC4 = 35673,// gl.BOOL_VEC4
|
|
29
29
|
/** Second-order matrix */
|
|
30
|
-
FLOAT_MAT2 = 35674
|
|
30
|
+
FLOAT_MAT2 = 35674,// gl.FLOAT_MAT2
|
|
31
31
|
/** Third-order matrix */
|
|
32
|
-
FLOAT_MAT3 = 35675
|
|
32
|
+
FLOAT_MAT3 = 35675,// gl.FLOAT_MAT3
|
|
33
33
|
/** Fourth-order matrix */
|
|
34
|
-
FLOAT_MAT4 = 35676
|
|
34
|
+
FLOAT_MAT4 = 35676,// gl.FLOAT_MAT4
|
|
35
35
|
/** Float array */
|
|
36
|
-
FLOAT_ARRAY = 35677
|
|
36
|
+
FLOAT_ARRAY = 35677,// gl.FLOAT_ARRAY
|
|
37
37
|
/** Floating-point two-dimensional vector array */
|
|
38
38
|
FLOAT_VEC2_ARRAY = 100000,
|
|
39
39
|
/** Floating-point three-dimensional vector array */
|
|
@@ -59,17 +59,17 @@ export declare enum DataType {
|
|
|
59
59
|
/** Cube map texture sampler array */
|
|
60
60
|
SAMPLER_CUBE_ARRAY = 100011,
|
|
61
61
|
/** 2D sampler */
|
|
62
|
-
SAMPLER_2D = 35678
|
|
62
|
+
SAMPLER_2D = 35678,// gl.SAMPLER_2D
|
|
63
63
|
/** Cube map Texture sampler */
|
|
64
|
-
SAMPLER_CUBE = 35680
|
|
64
|
+
SAMPLER_CUBE = 35680,// gl.SAMPLER_CUBE
|
|
65
65
|
/** Byte */
|
|
66
|
-
BYTE = 5120
|
|
66
|
+
BYTE = 5120,// gl.BYTE
|
|
67
67
|
/** Unsigned byte */
|
|
68
|
-
UNSIGNED_BYTE = 5121
|
|
68
|
+
UNSIGNED_BYTE = 5121,// gl.UNSIGNED_BYTE
|
|
69
69
|
/** Short */
|
|
70
|
-
SHORT = 5122
|
|
70
|
+
SHORT = 5122,// gl.SHORT
|
|
71
71
|
/** Unsigned short */
|
|
72
|
-
UNSIGNED_SHORT = 5123
|
|
72
|
+
UNSIGNED_SHORT = 5123,// gl.UNSIGNED_SHORT
|
|
73
73
|
/** Unsigned int */
|
|
74
74
|
UNSIGNED_INT = 5125
|
|
75
75
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { BoolUpdateFlag } from "./BoolUpdateFlag";
|
|
|
16
16
|
export type { EngineSettings } from "./EngineSettings";
|
|
17
17
|
export type { EngineConfiguration } from "./Engine";
|
|
18
18
|
export { request } from "./asset/request";
|
|
19
|
+
export type { RequestConfig } from "./asset/request";
|
|
19
20
|
export { Loader } from "./asset/Loader";
|
|
20
21
|
export { ContentRestorer } from "./asset/ContentRestorer";
|
|
21
22
|
export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
|
|
@@ -36,6 +37,7 @@ export { ReplacementFailureStrategy } from "./enums/ReplacementFailureStrategy";
|
|
|
36
37
|
export { Downsampling } from "./enums/Downsampling";
|
|
37
38
|
export { ColorSpace } from "./enums/ColorSpace";
|
|
38
39
|
export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
|
|
40
|
+
export { SpriteMaskLayer } from "./enums/SpriteMaskLayer";
|
|
39
41
|
export { XRManager } from "./xr/XRManager";
|
|
40
42
|
export * from "./utils/index";
|
|
41
43
|
export * from "./input/index";
|
|
@@ -58,5 +60,6 @@ export * from "./clone/CloneManager";
|
|
|
58
60
|
export * from "./renderingHardwareInterface/index";
|
|
59
61
|
export * from "./physics/index";
|
|
60
62
|
export * from "./Utils";
|
|
63
|
+
export * from "./audio/index";
|
|
61
64
|
export { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
|
|
62
65
|
export * from "./postProcess";
|
|
@@ -7,6 +7,11 @@ export declare class DirectLight extends Light {
|
|
|
7
7
|
private static _cullingMaskProperty;
|
|
8
8
|
private static _colorProperty;
|
|
9
9
|
private static _directionProperty;
|
|
10
|
+
/**
|
|
11
|
+
* The offset distance in the opposite direction of light direction when generating shadows.
|
|
12
|
+
* @remarks Increasing this value can avoid the holes in the shadow caused by low polygon models.
|
|
13
|
+
*/
|
|
14
|
+
shadowNearPlaneOffset: number;
|
|
10
15
|
private _reverseDirection;
|
|
11
16
|
/**
|
|
12
17
|
* Get direction.
|
|
@@ -19,7 +19,10 @@ export declare abstract class Light extends Component {
|
|
|
19
19
|
shadowBias: number;
|
|
20
20
|
/** Shadow mapping normal-based bias. */
|
|
21
21
|
shadowNormalBias: number;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* Please use `shadowNearPlaneOffset` instead.
|
|
25
|
+
*/
|
|
23
26
|
shadowNearPlane: number;
|
|
24
27
|
private _shadowStrength;
|
|
25
28
|
private _color;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Vector2, Color } from "@galacean/engine-math";
|
|
1
2
|
import { Engine } from "../Engine";
|
|
2
3
|
import { Texture2D } from "../texture/Texture2D";
|
|
3
4
|
import { PBRBaseMaterial } from "./PBRBaseMaterial";
|
|
@@ -12,6 +13,15 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
12
13
|
private static _anisotropyInfoProp;
|
|
13
14
|
private static _anisotropyTextureProp;
|
|
14
15
|
private _anisotropyRotation;
|
|
16
|
+
private static _iridescenceInfoProp;
|
|
17
|
+
private static _iridescenceThicknessTextureProp;
|
|
18
|
+
private static _iridescenceTextureProp;
|
|
19
|
+
private _iridescenceRange;
|
|
20
|
+
private _sheenEnabled;
|
|
21
|
+
private static _sheenColorProp;
|
|
22
|
+
private static _sheenRoughnessProp;
|
|
23
|
+
private static _sheenTextureProp;
|
|
24
|
+
private static _sheenRoughnessTextureProp;
|
|
15
25
|
/**
|
|
16
26
|
* Index Of Refraction.
|
|
17
27
|
* @defaultValue `1.5`
|
|
@@ -56,11 +66,66 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
56
66
|
*/
|
|
57
67
|
get anisotropyTexture(): Texture2D;
|
|
58
68
|
set anisotropyTexture(value: Texture2D);
|
|
69
|
+
/**
|
|
70
|
+
* The iridescence intensity factor, from 0.0 to 1.0.
|
|
71
|
+
* @defaultValue `0.0`
|
|
72
|
+
*/
|
|
73
|
+
get iridescence(): number;
|
|
74
|
+
set iridescence(value: number);
|
|
75
|
+
/**
|
|
76
|
+
* The iridescence intensity texture, sampling red channel, and multiply 'iridescence'.
|
|
77
|
+
*/
|
|
78
|
+
get iridescenceTexture(): Texture2D;
|
|
79
|
+
set iridescenceTexture(value: Texture2D);
|
|
80
|
+
/**
|
|
81
|
+
* The index of refraction of the dielectric thin-film layer, greater than or equal to 1.0.
|
|
82
|
+
* @defaultValue `1.3`
|
|
83
|
+
*/
|
|
84
|
+
get iridescenceIOR(): number;
|
|
85
|
+
set iridescenceIOR(value: number);
|
|
86
|
+
/**
|
|
87
|
+
* The range of iridescence thickness, x is minimum, y is maximum.
|
|
88
|
+
* @defaultValue `[100, 400]`
|
|
89
|
+
*/
|
|
90
|
+
get iridescenceThicknessRange(): Vector2;
|
|
91
|
+
set iridescenceThicknessRange(value: Vector2);
|
|
92
|
+
/**
|
|
93
|
+
* The thickness texture of the thin-film layer, sampling green channel.
|
|
94
|
+
* @remarks
|
|
95
|
+
* If iridescenceThicknessTexture is defined, iridescence thickness between the 'iridescenceThicknessRange'.
|
|
96
|
+
* If iridescenceThicknessTexture is not defined, iridescence thickness will use only 'iridescenceThicknessRange.y'.
|
|
97
|
+
*/
|
|
98
|
+
get iridescenceThicknessTexture(): Texture2D;
|
|
99
|
+
set iridescenceThicknessTexture(value: Texture2D);
|
|
100
|
+
/**
|
|
101
|
+
* Sheen color.
|
|
102
|
+
* @defaultValue `[0,0,0]`
|
|
103
|
+
*/
|
|
104
|
+
get sheenColor(): Color;
|
|
105
|
+
set sheenColor(value: Color);
|
|
106
|
+
/**
|
|
107
|
+
* Sheen roughness, from 0.0 to 1.0.
|
|
108
|
+
* @defaultValue `0.0`
|
|
109
|
+
*/
|
|
110
|
+
get sheenRoughness(): number;
|
|
111
|
+
set sheenRoughness(value: number);
|
|
112
|
+
/**
|
|
113
|
+
* Sheen color texture, multiply ‘sheenColor’.
|
|
114
|
+
*/
|
|
115
|
+
get sheenColorTexture(): Texture2D;
|
|
116
|
+
set sheenColorTexture(value: Texture2D);
|
|
117
|
+
/**
|
|
118
|
+
* Sheen roughness texture.
|
|
119
|
+
* @remarks Use alpha channel, and multiply 'sheenRoughness'.
|
|
120
|
+
*/
|
|
121
|
+
get sheenRoughnessTexture(): Texture2D;
|
|
122
|
+
set sheenRoughnessTexture(value: Texture2D);
|
|
59
123
|
/**
|
|
60
124
|
* Create a pbr metallic-roughness workflow material instance.
|
|
61
125
|
* @param engine - Engine to which the material belongs
|
|
62
126
|
*/
|
|
63
127
|
constructor(engine: Engine);
|
|
128
|
+
private _onIridescenceRangeChanged;
|
|
64
129
|
/**
|
|
65
130
|
* @inheritdoc
|
|
66
131
|
*/
|
|
@@ -11,7 +11,8 @@ export declare class CharacterController extends Collider {
|
|
|
11
11
|
private _upDirection;
|
|
12
12
|
private _slopeLimit;
|
|
13
13
|
/**
|
|
14
|
-
* The step offset for the controller.
|
|
14
|
+
* The step offset for the controller, the value must be greater than or equal to 0.
|
|
15
|
+
* @remarks Character can overcome obstacle less than the height(stepOffset + contractOffset of the shape).
|
|
15
16
|
*/
|
|
16
17
|
get stepOffset(): number;
|
|
17
18
|
set stepOffset(value: number);
|
|
@@ -26,7 +27,8 @@ export declare class CharacterController extends Collider {
|
|
|
26
27
|
get upDirection(): Vector3;
|
|
27
28
|
set upDirection(value: Vector3);
|
|
28
29
|
/**
|
|
29
|
-
* The slope limit for the controller.
|
|
30
|
+
* The slope limit for the controller, the value is the cosine value of the maximum slope angle.
|
|
31
|
+
* @defaultValue 0.707(the cosine value of 45 degrees)
|
|
30
32
|
*/
|
|
31
33
|
get slopeLimit(): number;
|
|
32
34
|
set slopeLimit(value: number);
|
|
@@ -43,10 +45,7 @@ export declare class CharacterController extends Collider {
|
|
|
43
45
|
* @param shape - Collider shape
|
|
44
46
|
*/
|
|
45
47
|
addShape(shape: ColliderShape): void;
|
|
46
|
-
|
|
47
|
-
* Remove all shape attached.
|
|
48
|
-
*/
|
|
49
|
-
clearShapes(): void;
|
|
48
|
+
protected _syncNative(): void;
|
|
50
49
|
private _syncWorldPositionFromPhysicalSpace;
|
|
51
50
|
private _setUpDirection;
|
|
52
51
|
}
|
|
@@ -27,5 +27,7 @@ export declare class Collider extends Component implements ICustomClone {
|
|
|
27
27
|
* Remove all shape attached.
|
|
28
28
|
*/
|
|
29
29
|
clearShapes(): void;
|
|
30
|
-
protected
|
|
30
|
+
protected _syncNative(): void;
|
|
31
|
+
protected _addNativeShape(shape: ColliderShape): void;
|
|
32
|
+
protected _removeNativeShape(shape: ColliderShape): void;
|
|
31
33
|
}
|
|
@@ -18,6 +18,8 @@ export declare class DynamicCollider extends Collider {
|
|
|
18
18
|
private _constraints;
|
|
19
19
|
private _collisionDetectionMode;
|
|
20
20
|
private _sleepThreshold;
|
|
21
|
+
private _automaticCenterOfMass;
|
|
22
|
+
private _automaticInertiaTensor;
|
|
21
23
|
/**
|
|
22
24
|
* The linear damping of the dynamic collider.
|
|
23
25
|
*/
|
|
@@ -43,13 +45,27 @@ export declare class DynamicCollider extends Collider {
|
|
|
43
45
|
*/
|
|
44
46
|
get mass(): number;
|
|
45
47
|
set mass(value: number);
|
|
48
|
+
/**
|
|
49
|
+
* Whether or not to calculate the center of mass automatically, if true, the center of mass will be calculated based on the associated shapes.
|
|
50
|
+
* @remarks Affected by the position, rotation of the shapes.
|
|
51
|
+
*/
|
|
52
|
+
get automaticCenterOfMass(): boolean;
|
|
53
|
+
set automaticCenterOfMass(value: boolean);
|
|
46
54
|
/**
|
|
47
55
|
* The center of mass relative to the transform's origin.
|
|
56
|
+
* @remarks The center of mass is automatically calculated, if you want to set it manually, please set automaticCenterOfMass to false.
|
|
48
57
|
*/
|
|
49
58
|
get centerOfMass(): Vector3;
|
|
50
59
|
set centerOfMass(value: Vector3);
|
|
60
|
+
/**
|
|
61
|
+
* Whether or not to calculate the inertia tensor automatically, if true, the inertia tensor will be calculated based on the associated shapes and mass.
|
|
62
|
+
* @remarks Affected by the position, rotation of the shapes and the mass of the collider.
|
|
63
|
+
*/
|
|
64
|
+
get automaticInertiaTensor(): boolean;
|
|
65
|
+
set automaticInertiaTensor(value: boolean);
|
|
51
66
|
/**
|
|
52
67
|
* The diagonal inertia tensor of mass relative to the center of mass.
|
|
68
|
+
* @remarks The inertia tensor is automatically calculated, if you want to set it manually, please set automaticInertiaTensor to false.
|
|
53
69
|
*/
|
|
54
70
|
get inertiaTensor(): Vector3;
|
|
55
71
|
set inertiaTensor(value: Vector3);
|
|
@@ -118,14 +134,21 @@ export declare class DynamicCollider extends Collider {
|
|
|
118
134
|
* Forces a collider to sleep at least one frame.
|
|
119
135
|
*/
|
|
120
136
|
sleep(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Returns whether the collider is sleeping.
|
|
139
|
+
* @returns True if the collider is sleeping, false otherwise.
|
|
140
|
+
*/
|
|
141
|
+
isSleeping(): boolean;
|
|
121
142
|
/**
|
|
122
143
|
* Forces a collider to wake up.
|
|
123
144
|
*/
|
|
124
145
|
wakeUp(): void;
|
|
146
|
+
protected _syncNative(): void;
|
|
147
|
+
private _setMassAndUpdateInertia;
|
|
125
148
|
private _setLinearVelocity;
|
|
126
149
|
private _setAngularVelocity;
|
|
127
|
-
private
|
|
128
|
-
private
|
|
150
|
+
private _handleCenterOfMassChanged;
|
|
151
|
+
private _handleInertiaTensorChanged;
|
|
129
152
|
}
|
|
130
153
|
/**
|
|
131
154
|
* The collision detection mode constants.
|
|
@@ -2,6 +2,7 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Joint } from "./Joint";
|
|
3
3
|
import { JointLimits } from "./JointLimits";
|
|
4
4
|
import { JointMotor } from "./JointMotor";
|
|
5
|
+
import { Entity } from "../../Entity";
|
|
5
6
|
/**
|
|
6
7
|
* A joint which behaves in a similar way to a hinge or axle.
|
|
7
8
|
*/
|
|
@@ -9,18 +10,15 @@ export declare class HingeJoint extends Joint {
|
|
|
9
10
|
private _axis;
|
|
10
11
|
private _hingeFlags;
|
|
11
12
|
private _useSpring;
|
|
12
|
-
private
|
|
13
|
+
private _jointMotor;
|
|
13
14
|
private _limits;
|
|
15
|
+
private _angle;
|
|
16
|
+
private _velocity;
|
|
14
17
|
/**
|
|
15
18
|
* The anchor rotation.
|
|
16
19
|
*/
|
|
17
20
|
get axis(): Vector3;
|
|
18
21
|
set axis(value: Vector3);
|
|
19
|
-
/**
|
|
20
|
-
* The swing offset.
|
|
21
|
-
*/
|
|
22
|
-
get swingOffset(): Vector3;
|
|
23
|
-
set swingOffset(value: Vector3);
|
|
24
22
|
/**
|
|
25
23
|
* The current angle in degrees of the joint relative to its rest position.
|
|
26
24
|
*/
|
|
@@ -54,4 +52,9 @@ export declare class HingeJoint extends Joint {
|
|
|
54
52
|
*/
|
|
55
53
|
get limits(): JointLimits;
|
|
56
54
|
set limits(value: JointLimits);
|
|
55
|
+
constructor(entity: Entity);
|
|
56
|
+
protected _createJoint(): void;
|
|
57
|
+
protected _syncNative(): void;
|
|
58
|
+
private _onMotorChanged;
|
|
59
|
+
private _onLimitsChanged;
|
|
57
60
|
}
|
|
@@ -3,43 +3,55 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
3
3
|
import { Component } from "../../Component";
|
|
4
4
|
import { Entity } from "../../Entity";
|
|
5
5
|
import { Collider } from "../Collider";
|
|
6
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
7
6
|
/**
|
|
8
7
|
* A base class providing common functionality for joints.
|
|
9
8
|
* @decorator `@dependentComponents(Collider, DependentMode.CheckOnly)`
|
|
10
9
|
*/
|
|
11
|
-
export declare class Joint extends Component
|
|
10
|
+
export declare abstract class Joint extends Component {
|
|
11
|
+
private static _tempVector3;
|
|
12
12
|
protected _colliderInfo: JointColliderInfo;
|
|
13
13
|
protected _connectedColliderInfo: JointColliderInfo;
|
|
14
14
|
protected _nativeJoint: IJoint;
|
|
15
15
|
private _force;
|
|
16
16
|
private _torque;
|
|
17
|
+
private _automaticConnectedAnchor;
|
|
17
18
|
/**
|
|
18
19
|
* The connected collider.
|
|
19
20
|
*/
|
|
20
21
|
get connectedCollider(): Collider;
|
|
21
22
|
set connectedCollider(value: Collider);
|
|
23
|
+
/**
|
|
24
|
+
* The connected anchor position.
|
|
25
|
+
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
26
|
+
*/
|
|
27
|
+
get anchor(): Vector3;
|
|
28
|
+
set anchor(value: Vector3);
|
|
22
29
|
/**
|
|
23
30
|
* The connected anchor position.
|
|
24
31
|
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
25
32
|
*/
|
|
26
33
|
get connectedAnchor(): Vector3;
|
|
27
34
|
set connectedAnchor(value: Vector3);
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not to calculate the connectedAnchor automatically, if true, the connectedAnchor will be calculated automatically to match the global position of the anchor property.
|
|
37
|
+
*/
|
|
38
|
+
get automaticConnectedAnchor(): boolean;
|
|
39
|
+
set automaticConnectedAnchor(value: boolean);
|
|
28
40
|
/**
|
|
29
41
|
* The scale to apply to the inverse mass of collider 0 for resolving this constraint.
|
|
30
42
|
*/
|
|
31
43
|
get connectedMassScale(): number;
|
|
32
44
|
set connectedMassScale(value: number);
|
|
33
|
-
/**
|
|
34
|
-
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
35
|
-
*/
|
|
36
|
-
get connectedInertiaScale(): number;
|
|
37
|
-
set connectedInertiaScale(value: number);
|
|
38
45
|
/**
|
|
39
46
|
* The scale to apply to the inverse mass of collider 1 for resolving this constraint.
|
|
40
47
|
*/
|
|
41
48
|
get massScale(): number;
|
|
42
49
|
set massScale(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
52
|
+
*/
|
|
53
|
+
get connectedInertiaScale(): number;
|
|
54
|
+
set connectedInertiaScale(value: number);
|
|
43
55
|
/**
|
|
44
56
|
* The scale to apply to the inverse inertia of collider1 for resolving this constraint.
|
|
45
57
|
*/
|
|
@@ -56,4 +68,10 @@ export declare class Joint extends Component implements ICustomClone {
|
|
|
56
68
|
get breakTorque(): number;
|
|
57
69
|
set breakTorque(value: number);
|
|
58
70
|
constructor(entity: Entity);
|
|
71
|
+
protected abstract _createJoint(): void;
|
|
72
|
+
protected _syncNative(): void;
|
|
73
|
+
private _calculateConnectedAnchor;
|
|
74
|
+
private _onSelfTransformChanged;
|
|
75
|
+
private _onConnectedTransformChanged;
|
|
76
|
+
private _updateActualAnchor;
|
|
59
77
|
}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
+
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
1
2
|
/**
|
|
2
3
|
* JointLimits is used to limit the joints angle.
|
|
3
4
|
*/
|
|
4
5
|
export declare class JointLimits {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
_updateFlagManager: UpdateFlagManager;
|
|
8
|
+
private _max;
|
|
9
|
+
private _min;
|
|
10
|
+
private _contactDistance;
|
|
11
|
+
private _stiffness;
|
|
12
|
+
private _damping;
|
|
13
|
+
/**
|
|
14
|
+
* The upper angular limit (in radians) of the joint.
|
|
15
|
+
*/
|
|
16
|
+
get max(): number;
|
|
17
|
+
set max(value: number);
|
|
18
|
+
/**
|
|
19
|
+
* The lower angular limit (in radians) of the joint.
|
|
20
|
+
*/
|
|
21
|
+
get min(): number;
|
|
22
|
+
set min(value: number);
|
|
23
|
+
/**
|
|
24
|
+
* Distance inside the limit value at which the limit will be considered to be active by the solver.
|
|
25
|
+
* Default is the lesser of 0.1 radians, and 0.49 * (upperLimit - lowerLimit)
|
|
26
|
+
*/
|
|
27
|
+
get contactDistance(): number;
|
|
28
|
+
set contactDistance(value: number);
|
|
29
|
+
/**
|
|
30
|
+
* The spring forces used to reach the target position.
|
|
31
|
+
*/
|
|
32
|
+
get stiffness(): number;
|
|
33
|
+
set stiffness(value: number);
|
|
34
|
+
/**
|
|
35
|
+
* The damper force uses to dampen the spring.
|
|
36
|
+
*/
|
|
37
|
+
get damping(): number;
|
|
38
|
+
set damping(value: number);
|
|
15
39
|
}
|
|
@@ -1,13 +1,32 @@
|
|
|
1
|
+
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
1
2
|
/**
|
|
2
3
|
* The JointMotor is used to motorize a joint.
|
|
3
4
|
*/
|
|
4
5
|
export declare class JointMotor {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
_updateFlagManager: UpdateFlagManager;
|
|
8
|
+
private _targetVelocity;
|
|
9
|
+
private _forceLimit;
|
|
10
|
+
private _gearRatio;
|
|
11
|
+
private _freeSpin;
|
|
12
|
+
/**
|
|
13
|
+
* The motor will apply a force up to force to achieve targetVelocity.
|
|
14
|
+
*/
|
|
15
|
+
get targetVelocity(): number;
|
|
16
|
+
set targetVelocity(value: number);
|
|
17
|
+
/**
|
|
18
|
+
* The force limit.
|
|
19
|
+
*/
|
|
20
|
+
get forceLimit(): number;
|
|
21
|
+
set forceLimit(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* Gear ration for the motor
|
|
24
|
+
*/
|
|
25
|
+
get gearRatio(): number;
|
|
26
|
+
set gearRatio(value: number);
|
|
27
|
+
/**
|
|
28
|
+
* If freeSpin is enabled the motor will only accelerate but never slow down.
|
|
29
|
+
*/
|
|
30
|
+
get freeSpin(): boolean;
|
|
31
|
+
set freeSpin(value: boolean);
|
|
13
32
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Vector3 } from "@galacean/engine-math";
|
|
2
1
|
import { Joint } from "./Joint";
|
|
3
2
|
/**
|
|
4
3
|
* A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
|
|
@@ -9,11 +8,6 @@ export declare class SpringJoint extends Joint {
|
|
|
9
8
|
private _tolerance;
|
|
10
9
|
private _stiffness;
|
|
11
10
|
private _damping;
|
|
12
|
-
/**
|
|
13
|
-
* The swing offset.
|
|
14
|
-
*/
|
|
15
|
-
get swingOffset(): Vector3;
|
|
16
|
-
set swingOffset(value: Vector3);
|
|
17
11
|
/**
|
|
18
12
|
* The minimum distance.
|
|
19
13
|
*/
|
|
@@ -39,4 +33,6 @@ export declare class SpringJoint extends Joint {
|
|
|
39
33
|
*/
|
|
40
34
|
get damping(): number;
|
|
41
35
|
set damping(value: number);
|
|
36
|
+
protected _createJoint(): void;
|
|
37
|
+
protected _syncNative(): void;
|
|
42
38
|
}
|
|
@@ -22,7 +22,7 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
22
22
|
*/
|
|
23
23
|
get id(): number;
|
|
24
24
|
/**
|
|
25
|
-
* Contact offset for this shape.
|
|
25
|
+
* Contact offset for this shape, the value must be greater than or equal to 0.
|
|
26
26
|
*/
|
|
27
27
|
get contactOffset(): number;
|
|
28
28
|
set contactOffset(value: number);
|
|
@@ -47,6 +47,7 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
47
47
|
get isTrigger(): boolean;
|
|
48
48
|
set isTrigger(value: boolean);
|
|
49
49
|
protected constructor();
|
|
50
|
+
protected _syncNative(): void;
|
|
50
51
|
private _setPosition;
|
|
51
52
|
private _setRotation;
|
|
52
53
|
}
|