@galacean/engine-core 0.0.0-experimental-1.3-xr.10 → 0.0.0-experimental-1.4-small-language.0

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.
Files changed (105) hide show
  1. package/dist/main.js +17182 -15529
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +16241 -14706
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -3
  6. package/types/2d/assembler/ISpriteAssembler.d.ts +11 -1
  7. package/types/2d/assembler/ISpriteRenderer.d.ts +16 -0
  8. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +13 -1
  9. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +15 -1
  10. package/types/2d/assembler/TiledSpriteAssembler.d.ts +17 -1
  11. package/types/2d/enums/SpriteModifyFlags.d.ts +9 -0
  12. package/types/2d/index.d.ts +12 -5
  13. package/types/2d/sprite/Sprite.d.ts +2 -2
  14. package/types/2d/sprite/SpriteMask.d.ts +4 -2
  15. package/types/2d/sprite/SpriteRenderer.d.ts +5 -4
  16. package/types/2d/sprite/index.d.ts +1 -1
  17. package/types/2d/text/ITextRenderer.d.ts +8 -0
  18. package/types/2d/text/TextRenderer.d.ts +26 -5
  19. package/types/2d/text/index.d.ts +3 -1
  20. package/types/BasicResources.d.ts +2 -1
  21. package/types/Camera.d.ts +7 -3
  22. package/types/ComponentsManager.d.ts +4 -0
  23. package/types/Engine.d.ts +12 -3
  24. package/types/Entity.d.ts +18 -4
  25. package/types/Polyfill.d.ts +1 -0
  26. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
  27. package/types/RenderPipeline/Blitter.d.ts +28 -0
  28. package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +1 -0
  29. package/types/RenderPipeline/index.d.ts +3 -1
  30. package/types/Renderer.d.ts +15 -3
  31. package/types/Scene.d.ts +4 -1
  32. package/types/Script.d.ts +42 -18
  33. package/types/Transform.d.ts +17 -7
  34. package/types/animation/Animator.d.ts +27 -5
  35. package/types/animation/AnimatorController.d.ts +12 -2
  36. package/types/animation/AnimatorState.d.ts +0 -1
  37. package/types/animation/AnimatorStateMachine.d.ts +10 -6
  38. package/types/animation/AnimatorStateTransition.d.ts +13 -5
  39. package/types/animation/AnimatorStateTransitionCollection.d.ts +1 -0
  40. package/types/asset/AssetPromise.d.ts +30 -5
  41. package/types/asset/AssetType.d.ts +8 -2
  42. package/types/asset/Loader.d.ts +0 -2
  43. package/types/asset/ResourceManager.d.ts +4 -1
  44. package/types/asset/request.d.ts +10 -3
  45. package/types/audio/AudioClip.d.ts +24 -0
  46. package/types/audio/AudioManager.d.ts +1 -0
  47. package/types/audio/AudioSource.d.ts +72 -0
  48. package/types/audio/index.d.ts +3 -0
  49. package/types/base/Constant.d.ts +22 -22
  50. package/types/enums/CameraModifyFlags.d.ts +17 -0
  51. package/types/enums/EntityModifyFlags.d.ts +9 -0
  52. package/types/{2d/enums → enums}/SpriteMaskLayer.d.ts +3 -1
  53. package/types/index.d.ts +6 -1
  54. package/types/input/index.d.ts +5 -2
  55. package/types/input/pointer/Pointer.d.ts +8 -2
  56. package/types/input/pointer/PointerEventData.d.ts +12 -0
  57. package/types/input/pointer/PointerManager.d.ts +9 -1
  58. package/types/input/pointer/emitter/IHitResult.d.ts +1 -0
  59. package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +1 -0
  60. package/types/input/pointer/emitter/PointerEventEmitter.d.ts +30 -0
  61. package/types/lighting/DirectLight.d.ts +5 -0
  62. package/types/lighting/Light.d.ts +4 -1
  63. package/types/material/BaseMaterial.d.ts +4 -2
  64. package/types/material/Material.d.ts +1 -0
  65. package/types/material/PBRMaterial.d.ts +130 -0
  66. package/types/material/enums/Refraction.d.ts +9 -0
  67. package/types/material/index.d.ts +1 -0
  68. package/types/material/utils/PrefilteredDFG.d.ts +7 -0
  69. package/types/particle/ParticleGenerator.d.ts +1 -0
  70. package/types/particle/modules/MainModule.d.ts +1 -2
  71. package/types/physics/CharacterController.d.ts +5 -6
  72. package/types/physics/Collider.d.ts +3 -1
  73. package/types/physics/Collision.d.ts +18 -0
  74. package/types/physics/ContactPoint.d.ts +14 -0
  75. package/types/physics/DynamicCollider.d.ts +35 -4
  76. package/types/physics/HitResult.d.ts +1 -1
  77. package/types/physics/PhysicsMaterial.d.ts +5 -1
  78. package/types/physics/index.d.ts +2 -0
  79. package/types/physics/joint/FixedJoint.d.ts +1 -0
  80. package/types/physics/joint/HingeJoint.d.ts +11 -7
  81. package/types/physics/joint/Joint.d.ts +32 -10
  82. package/types/physics/joint/JointLimits.d.ts +34 -10
  83. package/types/physics/joint/JointMotor.d.ts +27 -8
  84. package/types/physics/joint/SpringJoint.d.ts +2 -6
  85. package/types/physics/shape/BoxColliderShape.d.ts +1 -0
  86. package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
  87. package/types/physics/shape/ColliderShape.d.ts +11 -3
  88. package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
  89. package/types/physics/shape/SphereColliderShape.d.ts +1 -1
  90. package/types/postProcess/PostProcess.d.ts +64 -0
  91. package/types/postProcess/PostProcessEffect.d.ts +26 -0
  92. package/types/postProcess/PostProcessEffectParameter.d.ts +119 -0
  93. package/types/postProcess/PostProcessManager.d.ts +37 -1
  94. package/types/postProcess/PostProcessPass.d.ts +50 -0
  95. package/types/postProcess/PostProcessUberPass.d.ts +25 -0
  96. package/types/postProcess/effects/BloomEffect.d.ts +22 -66
  97. package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
  98. package/types/postProcess/index.d.ts +6 -2
  99. package/types/shader/Shader.d.ts +1 -1
  100. package/types/shader/index.d.ts +1 -0
  101. package/types/shaderlib/ShaderLib.d.ts +2 -0
  102. package/types/shaderlib/pbr/index.d.ts +2 -0
  103. package/types/ui/IUICanvas.d.ts +1 -0
  104. package/types/ui/UIUtils.d.ts +11 -0
  105. package/dist/miniprogram.js +0 -34626
@@ -4,6 +4,8 @@ import { Collider } from "./Collider";
4
4
  * A dynamic collider can act with self-defined movement or physical force.
5
5
  */
6
6
  export declare class DynamicCollider extends Collider {
7
+ private static _tempVector3;
8
+ private static _tempQuat;
7
9
  private _linearDamping;
8
10
  private _angularDamping;
9
11
  private _linearVelocity;
@@ -14,10 +16,13 @@ export declare class DynamicCollider extends Collider {
14
16
  private _maxAngularVelocity;
15
17
  private _maxDepenetrationVelocity;
16
18
  private _solverIterations;
19
+ private _useGravity;
17
20
  private _isKinematic;
18
21
  private _constraints;
19
22
  private _collisionDetectionMode;
20
23
  private _sleepThreshold;
24
+ private _automaticCenterOfMass;
25
+ private _automaticInertiaTensor;
21
26
  /**
22
27
  * The linear damping of the dynamic collider.
23
28
  */
@@ -34,7 +39,7 @@ export declare class DynamicCollider extends Collider {
34
39
  get linearVelocity(): Vector3;
35
40
  set linearVelocity(value: Vector3);
36
41
  /**
37
- * The angular velocity vector of the dynamic collider measured in radians per second.
42
+ * The angular velocity vector of the dynamic collider measured in degrees per second.
38
43
  */
39
44
  get angularVelocity(): Vector3;
40
45
  set angularVelocity(value: Vector3);
@@ -43,18 +48,32 @@ export declare class DynamicCollider extends Collider {
43
48
  */
44
49
  get mass(): number;
45
50
  set mass(value: number);
51
+ /**
52
+ * Whether or not to calculate the center of mass automatically, if true, the center of mass will be calculated based on the associated shapes.
53
+ * @remarks Affected by the position, rotation of the shapes.
54
+ */
55
+ get automaticCenterOfMass(): boolean;
56
+ set automaticCenterOfMass(value: boolean);
46
57
  /**
47
58
  * The center of mass relative to the transform's origin.
59
+ * @remarks The center of mass is automatically calculated, if you want to set it manually, please set automaticCenterOfMass to false.
48
60
  */
49
61
  get centerOfMass(): Vector3;
50
62
  set centerOfMass(value: Vector3);
63
+ /**
64
+ * Whether or not to calculate the inertia tensor automatically, if true, the inertia tensor will be calculated based on the associated shapes and mass.
65
+ * @remarks Affected by the position, rotation of the shapes and the mass of the collider.
66
+ */
67
+ get automaticInertiaTensor(): boolean;
68
+ set automaticInertiaTensor(value: boolean);
51
69
  /**
52
70
  * The diagonal inertia tensor of mass relative to the center of mass.
71
+ * @remarks The inertia tensor is automatically calculated, if you want to set it manually, please set automaticInertiaTensor to false.
53
72
  */
54
73
  get inertiaTensor(): Vector3;
55
74
  set inertiaTensor(value: Vector3);
56
75
  /**
57
- * The maximum angular velocity of the collider measured in radians per second. (Default 7) range { 0, infinity }.
76
+ * The maximum angular velocity of the collider measured in degrees per second.
58
77
  */
59
78
  get maxAngularVelocity(): number;
60
79
  set maxAngularVelocity(value: number);
@@ -73,6 +92,11 @@ export declare class DynamicCollider extends Collider {
73
92
  */
74
93
  get solverIterations(): number;
75
94
  set solverIterations(value: number);
95
+ /**
96
+ * Controls whether gravity affects the dynamic collider.
97
+ */
98
+ get useGravity(): boolean;
99
+ set useGravity(value: boolean);
76
100
  /**
77
101
  * Controls whether physics affects the dynamic collider.
78
102
  */
@@ -118,14 +142,21 @@ export declare class DynamicCollider extends Collider {
118
142
  * Forces a collider to sleep at least one frame.
119
143
  */
120
144
  sleep(): void;
145
+ /**
146
+ * Returns whether the collider is sleeping.
147
+ * @returns True if the collider is sleeping, false otherwise.
148
+ */
149
+ isSleeping(): boolean;
121
150
  /**
122
151
  * Forces a collider to wake up.
123
152
  */
124
153
  wakeUp(): void;
154
+ protected _syncNative(): void;
155
+ private _setMassAndUpdateInertia;
125
156
  private _setLinearVelocity;
126
157
  private _setAngularVelocity;
127
- private _setCenterOfMass;
128
- private _setInertiaTensor;
158
+ private _handleCenterOfMassChanged;
159
+ private _handleInertiaTensorChanged;
129
160
  }
130
161
  /**
131
162
  * The collision detection mode constants.
@@ -1,5 +1,5 @@
1
- import { Entity } from "../Entity";
2
1
  import { Vector3 } from "@galacean/engine-math";
2
+ import { Entity } from "../Entity";
3
3
  import { ColliderShape } from "./shape";
4
4
  /**
5
5
  * Structure used to get information back from a raycast or a sweep.
@@ -11,7 +11,7 @@ export declare class PhysicsMaterial {
11
11
  private _destroyed;
12
12
  constructor();
13
13
  /**
14
- * The coefficient of bounciness.
14
+ * The coefficient of bounciness, ranging from 0 to 1.
15
15
  */
16
16
  get bounciness(): number;
17
17
  set bounciness(value: number);
@@ -35,4 +35,8 @@ export declare class PhysicsMaterial {
35
35
  */
36
36
  get frictionCombine(): PhysicsMaterialCombineMode;
37
37
  set frictionCombine(value: PhysicsMaterialCombineMode);
38
+ /**
39
+ * Destroy the material when the material is no be used by any shape.
40
+ */
41
+ destroy(): void;
38
42
  }
@@ -5,6 +5,8 @@ export { HitResult } from "./HitResult";
5
5
  export { PhysicsMaterial } from "./PhysicsMaterial";
6
6
  export { PhysicsScene } from "./PhysicsScene";
7
7
  export { StaticCollider } from "./StaticCollider";
8
+ export { Collision } from "./Collision";
9
+ export { ContactPoint } from "./ContactPoint";
8
10
  export * from "./enums";
9
11
  export * from "./joint";
10
12
  export * from "./shape";
@@ -1,3 +1,4 @@
1
1
  import { Joint } from "./Joint";
2
2
  export declare class FixedJoint extends Joint {
3
+ protected _createJoint(): void;
3
4
  }
@@ -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 _jointMonitor;
13
+ private _jointMotor;
13
14
  private _limits;
15
+ private _angle;
16
+ private _velocity;
14
17
  /**
15
- * The anchor rotation.
18
+ * The Direction of the axis around which the hingeJoint.
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,10 @@ 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;
60
+ private _onAxisChanged;
57
61
  }
@@ -3,45 +3,59 @@ 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 implements ICustomClone {
10
+ export declare abstract class Joint extends Component {
11
+ private static _tempVector3;
12
+ private static _tempQuat;
13
+ private static _tempMatrix;
12
14
  protected _colliderInfo: JointColliderInfo;
13
15
  protected _connectedColliderInfo: JointColliderInfo;
14
16
  protected _nativeJoint: IJoint;
15
17
  private _force;
16
18
  private _torque;
19
+ private _automaticConnectedAnchor;
17
20
  /**
18
21
  * The connected collider.
19
22
  */
20
23
  get connectedCollider(): Collider;
21
24
  set connectedCollider(value: Collider);
25
+ /**
26
+ * The anchor position.
27
+ */
28
+ get anchor(): Vector3;
29
+ set anchor(value: Vector3);
22
30
  /**
23
31
  * The connected anchor position.
24
32
  * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
33
+ * The connectedAnchor is automatically calculated, if you want to set it manually, please set automaticConnectedAnchor to false
25
34
  */
26
35
  get connectedAnchor(): Vector3;
27
36
  set connectedAnchor(value: Vector3);
28
37
  /**
29
- * The scale to apply to the inverse mass of collider 0 for resolving this constraint.
38
+ * 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.
30
39
  */
31
- get connectedMassScale(): number;
32
- set connectedMassScale(value: number);
40
+ get automaticConnectedAnchor(): boolean;
41
+ set automaticConnectedAnchor(value: boolean);
33
42
  /**
34
- * The scale to apply to the inverse inertia of collider0 for resolving this constraint.
43
+ * The scale to apply to the mass of collider 0 for resolving this constraint.
35
44
  */
36
- get connectedInertiaScale(): number;
37
- set connectedInertiaScale(value: number);
45
+ get connectedMassScale(): number;
46
+ set connectedMassScale(value: number);
38
47
  /**
39
- * The scale to apply to the inverse mass of collider 1 for resolving this constraint.
48
+ * The scale to apply to the mass of collider 1 for resolving this constraint.
40
49
  */
41
50
  get massScale(): number;
42
51
  set massScale(value: number);
43
52
  /**
44
- * The scale to apply to the inverse inertia of collider1 for resolving this constraint.
53
+ * The scale to apply to the inertia of collider0 for resolving this constraint.
54
+ */
55
+ get connectedInertiaScale(): number;
56
+ set connectedInertiaScale(value: number);
57
+ /**
58
+ * The scale to apply to the inertia of collider1 for resolving this constraint.
45
59
  */
46
60
  get inertiaScale(): number;
47
61
  set inertiaScale(value: number);
@@ -56,4 +70,12 @@ export declare class Joint extends Component implements ICustomClone {
56
70
  get breakTorque(): number;
57
71
  set breakTorque(value: number);
58
72
  constructor(entity: Entity);
73
+ protected abstract _createJoint(): void;
74
+ protected _syncNative(): void;
75
+ private _calculateConnectedAnchor;
76
+ private _handleConnectedAnchorChanged;
77
+ private _onSelfTransformChanged;
78
+ private _onConnectedTransformChanged;
79
+ private _updateRotation;
80
+ private _updateActualAnchor;
59
81
  }
@@ -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
- /** The upper angular limit (in degrees) of the joint. */
6
- max: number;
7
- /** The lower angular limit (in degrees) of the joint. */
8
- min: number;
9
- /** Distance inside the limit value at which the limit will be considered to be active by the solver. */
10
- contactDistance: number;
11
- /** The spring forces used to reach the target position. */
12
- stiffness: number;
13
- /** The damper force uses to dampen the spring. */
14
- damping: number;
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 degrees) of the joint.
15
+ */
16
+ get max(): number;
17
+ set max(value: number);
18
+ /**
19
+ * The lower angular limit (in degrees) 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
- /** The motor will apply a force up to force to achieve targetVelocity. */
6
- targetVelocity: number;
7
- /** The force limit.*/
8
- forceLimit: number;
9
- /** Gear ration for the motor */
10
- gearRation: number;
11
- /** If freeSpin is enabled the motor will only accelerate but never slow down. */
12
- freeSpin: boolean;
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
  }
@@ -11,5 +11,6 @@ export declare class BoxColliderShape extends ColliderShape {
11
11
  get size(): Vector3;
12
12
  set size(value: Vector3);
13
13
  constructor();
14
+ protected _syncNative(): void;
14
15
  private _setSize;
15
16
  }
@@ -23,4 +23,5 @@ export declare class CapsuleColliderShape extends ColliderShape {
23
23
  get upAxis(): ColliderShapeUpAxis;
24
24
  set upAxis(value: ColliderShapeUpAxis);
25
25
  constructor();
26
+ protected _syncNative(): void;
26
27
  }
@@ -22,17 +22,17 @@ 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);
29
29
  /**
30
- * Physical material.
30
+ * Physical material, material can't be null.
31
31
  */
32
32
  get material(): PhysicsMaterial;
33
33
  set material(value: PhysicsMaterial);
34
34
  /**
35
- * The local rotation of this ColliderShape.
35
+ * The local rotation of this ColliderShape, in degrees.
36
36
  */
37
37
  get rotation(): Vector3;
38
38
  set rotation(value: Vector3);
@@ -47,6 +47,14 @@ export declare abstract class ColliderShape implements ICustomClone {
47
47
  get isTrigger(): boolean;
48
48
  set isTrigger(value: boolean);
49
49
  protected constructor();
50
+ /**
51
+ * Get the distance and the closest point on the shape from a point.
52
+ * @param point - Location in world space you want to find the closest point to
53
+ * @param outClosestPoint - The closest point on the shape in world space
54
+ * @returns The distance between the point and the shape
55
+ */
56
+ getClosestPoint(point: Vector3, outClosestPoint: Vector3): number;
57
+ protected _syncNative(): void;
50
58
  private _setPosition;
51
59
  private _setRotation;
52
60
  }
@@ -1,7 +1,9 @@
1
+ import { Vector3 } from "@galacean/engine-math";
1
2
  import { ColliderShape } from "./ColliderShape";
2
3
  /**
3
4
  * Physical collider shape plane.
4
5
  */
5
6
  export declare class PlaneColliderShape extends ColliderShape {
6
7
  constructor();
8
+ getClosestPoint(point: Vector3, closestPoint: Vector3): number;
7
9
  }
@@ -10,5 +10,5 @@ export declare class SphereColliderShape extends ColliderShape {
10
10
  get radius(): number;
11
11
  set radius(value: number);
12
12
  constructor();
13
- _cloneTo(target: SphereColliderShape): void;
13
+ protected _syncNative(): void;
14
14
  }
@@ -0,0 +1,64 @@
1
+ import { Component } from "../Component";
2
+ import { Layer } from "../Layer";
3
+ import { PostProcessEffect } from "./PostProcessEffect";
4
+ /**
5
+ * Post Process component can be used for global or local post-processing.
6
+ */
7
+ export declare class PostProcess extends Component {
8
+ /**
9
+ * The layer to which the PostProcess belongs.
10
+ */
11
+ layer: Layer;
12
+ /**
13
+ * The outer distance to start blending from, only takes effect when the `isGlobal` is false.
14
+ */
15
+ blendDistance: number;
16
+ private _priority;
17
+ private _isGlobal;
18
+ /**
19
+ * Whether the PostProcess is global.
20
+ * @remarks
21
+ * Specifies whether to apply the PostProcess to the entire Scene or in Colliders.
22
+ * Only support local PostProcess in physics enabled Scenes.
23
+ */
24
+ get isGlobal(): boolean;
25
+ set isGlobal(value: boolean);
26
+ /**
27
+ * A value which determines which PostProcess is being used when PostProcess have an equal amount of influence on the Scene.
28
+ * @remarks
29
+ * PostProcess with a higher priority will override lower ones.
30
+ */
31
+ get priority(): number;
32
+ set priority(value: number);
33
+ /**
34
+ * Get the PostProcessEffect by type.
35
+ * @param type - The type of PostProcessEffect
36
+ * @returns The PostProcessEffect found
37
+ */
38
+ getEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
39
+ /**
40
+ * Add a PostProcessEffect to the PostProcess.
41
+ * @remarks Only one effect of the same type can be added to the PostProcess.
42
+ * @param type - The type of PostProcessEffect
43
+ * @returns The PostProcessEffect added
44
+ */
45
+ addEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
46
+ /**
47
+ * Remove a PostProcessEffect from the PostProcess.
48
+ * @param type - The type of PostProcessEffect
49
+ * @returns The PostProcessEffect removed
50
+ */
51
+ removeEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
52
+ /**
53
+ * @inheritdoc
54
+ */
55
+ _onEnableInScene(): void;
56
+ /**
57
+ * @inheritdoc
58
+ */
59
+ _onDisableInScene(): void;
60
+ /**
61
+ * @inheritdoc
62
+ */
63
+ _onDestroy(): void;
64
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The base class for post process effect.
3
+ */
4
+ export declare class PostProcessEffect {
5
+ private _enabled;
6
+ private _parameters;
7
+ private _parameterInitialized;
8
+ /**
9
+ * Indicates whether the post process effect is enabled.
10
+ */
11
+ get enabled(): boolean;
12
+ set enabled(value: boolean);
13
+ /**
14
+ * Whether the post process effect is valid.
15
+ * @remarks
16
+ * This method can be overridden to control the effect's real validity.
17
+ */
18
+ isValid(): boolean;
19
+ /**
20
+ * Get all parameters of the post process effect.
21
+ * @remarks
22
+ * Only get the parameters that are initialized in the constructor.
23
+ * It will don't take effect if you add a new parameter after the post process effect is created, such as `effect.** = new PostProcessEffectParameter(1)`
24
+ */
25
+ private _getParameters;
26
+ }
@@ -0,0 +1,119 @@
1
+ import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
2
+ import { Texture } from "../texture";
3
+ /**
4
+ * Represents a parameter of a post process effect.
5
+ * @remarks
6
+ * The parameter will be mixed to a final value and be used in post process manager.
7
+ */
8
+ export declare abstract class PostProcessEffectParameter<T> {
9
+ /**
10
+ * Whether the parameter is enabled.
11
+ */
12
+ enabled: boolean;
13
+ protected _needLerp: boolean;
14
+ protected _value: T;
15
+ /**
16
+ * The value of the parameter.
17
+ */
18
+ get value(): T;
19
+ set value(value: T);
20
+ constructor(value: T, needLerp?: boolean);
21
+ }
22
+ /**
23
+ * Represents a float parameter of a post process effect.
24
+ */
25
+ export declare class PostProcessEffectFloatParameter extends PostProcessEffectParameter<number> {
26
+ readonly min: number;
27
+ readonly max: number;
28
+ get value(): number;
29
+ set value(v: number);
30
+ /**
31
+ * Create a new float parameter.
32
+ * @param value - The default value of the parameter
33
+ * @param _min - The minimum value of the parameter, default is Number.NEGATIVE_INFINITY
34
+ * @param _max - The maximum value of the parameter, default is Number.POSITIVE_INFINITY
35
+ * @param needLerp - Whether the parameter needs to be lerp, default is true
36
+ */
37
+ constructor(value: number, min?: number, max?: number, needLerp?: boolean);
38
+ _lerp(to: number, factor: number): void;
39
+ }
40
+ /**
41
+ * Represents a boolean parameter of a post process effect.
42
+ */
43
+ export declare class PostProcessEffectBoolParameter extends PostProcessEffectParameter<boolean> {
44
+ /**
45
+ * Create a new boolean parameter.
46
+ * @param value - The default value of the parameter
47
+ */
48
+ constructor(value: boolean);
49
+ }
50
+ /**
51
+ * Represents a texture parameter of a post process effect.
52
+ */
53
+ export declare class PostProcessEffectTextureParameter extends PostProcessEffectParameter<Texture> {
54
+ /**
55
+ * Create a new texture parameter.
56
+ * @param value - The default texture of the parameter
57
+ */
58
+ constructor(value: Texture);
59
+ }
60
+ /**
61
+ * Represents a color parameter of a post process effect.
62
+ */
63
+ export declare class PostProcessEffectColorParameter extends PostProcessEffectParameter<Color> {
64
+ /**
65
+ * Create a new color parameter.
66
+ * @param value - The default color of the parameter
67
+ * @param needLerp - Whether the parameter needs to be lerp, default is true
68
+ */
69
+ constructor(value: Color, needLerp?: boolean);
70
+ _lerp(to: Color, factor: number): void;
71
+ }
72
+ /**
73
+ * Represents a vector2 parameter of a post process effect.
74
+ */
75
+ export declare class PostProcessEffectVector2Parameter extends PostProcessEffectParameter<Vector2> {
76
+ /**
77
+ * Create a new vector2 parameter.
78
+ * @param value - The default vector2 of the parameter
79
+ * @param needLerp - Whether the parameter needs to be lerp, default is true
80
+ */
81
+ constructor(value: Vector2, needLerp?: boolean);
82
+ _lerp(to: Vector2, factor: number): void;
83
+ }
84
+ /**
85
+ * Represents a vector3 parameter of a post process effect.
86
+ */
87
+ export declare class PostProcessEffectVector3Parameter extends PostProcessEffectParameter<Vector3> {
88
+ /**
89
+ * Create a new vector3 parameter.
90
+ * @param value - The default vector3 of the parameter
91
+ * @param needLerp - Whether the parameter needs to be lerp, default is true
92
+ */
93
+ constructor(value: Vector3, needLerp?: boolean);
94
+ _lerp(to: Vector3, factor: number): void;
95
+ }
96
+ /**
97
+ * Represents a vector4 parameter of a post process effect.
98
+ */
99
+ export declare class PostProcessEffectVector4Parameter extends PostProcessEffectParameter<Vector4> {
100
+ /**
101
+ * Create a new vector4 parameter.
102
+ * @param value - The default vector4 of the parameter
103
+ * @param needLerp - Whether the parameter needs to be lerp, default is true
104
+ */
105
+ constructor(value: Vector4, needLerp?: boolean);
106
+ _lerp(to: Vector4, factor: number): void;
107
+ }
108
+ /**
109
+ * Represents a enum parameter of a post process effect.
110
+ */
111
+ export declare class PostProcessEffectEnumParameter<T> extends PostProcessEffectParameter<T> {
112
+ readonly enumType: Record<string, number | string>;
113
+ /**
114
+ * Create a new enum parameter.
115
+ * @param enumType - The type of the enum
116
+ * @param value - The default enum value of the parameter
117
+ */
118
+ constructor(enumType: Record<string, number | string>, value: T);
119
+ }