@galacean/engine-core 1.1.0-beta.9 → 1.2.0-alpha.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 (132) hide show
  1. package/dist/main.js +18336 -17474
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +18336 -17474
  4. package/dist/module.js +18335 -17476
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/atlas/types.d.ts +3 -0
  8. package/types/2d/enums/SpriteModifyFlags.d.ts +2 -1
  9. package/types/Camera.d.ts +1 -1
  10. package/types/Canvas.d.ts +14 -5
  11. package/types/Component.d.ts +2 -0
  12. package/types/ComponentsManager.d.ts +3 -0
  13. package/types/DisorderedArray.d.ts +1 -0
  14. package/types/Engine.d.ts +6 -2
  15. package/types/Entity.d.ts +1 -0
  16. package/types/RenderPipeline/BasicRenderPipeline.d.ts +3 -1
  17. package/types/RenderPipeline/RenderQueue.d.ts +0 -7
  18. package/types/Scene.d.ts +9 -2
  19. package/types/Utils.d.ts +1 -0
  20. package/types/animation/AnimationClip.d.ts +32 -4
  21. package/types/animation/AnimationClipCurveBinding.d.ts +12 -2
  22. package/types/animation/AnimatorControllerLayer.d.ts +3 -0
  23. package/types/animation/AnimatorLayerMask.d.ts +45 -0
  24. package/types/animation/Keyframe.d.ts +1 -1
  25. package/types/animation/LayerPathMask.d.ts +16 -0
  26. package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
  27. package/types/animation/animationCurve/index.d.ts +1 -0
  28. package/types/animation/index.d.ts +1 -0
  29. package/types/asset/AssetPromise.d.ts +10 -4
  30. package/types/asset/ReferResource.d.ts +3 -2
  31. package/types/asset/ResourceManager.d.ts +0 -1
  32. package/types/index.d.ts +3 -1
  33. package/types/lighting/Light.d.ts +0 -1
  34. package/types/lighting/LightManager.d.ts +0 -1
  35. package/types/material/PBRMaterial.d.ts +23 -0
  36. package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
  37. package/types/particle/modules/EmissionModule.d.ts +0 -1
  38. package/types/particle/modules/MainModule.d.ts +0 -1
  39. package/types/particle/modules/ParticleGradient.d.ts +38 -18
  40. package/types/renderingHardwareInterface/index.d.ts +0 -1
  41. package/types/shader/Shader.d.ts +16 -3
  42. package/types/xr/XRManager.d.ts +3 -29
  43. package/types/RenderPipeline/RenderElementX.d.ts +0 -12
  44. package/types/SafeLoopArray.d.ts +0 -37
  45. package/types/Ticker.d.ts +0 -30
  46. package/types/graphic/PrimitiveVertexBinding.d.ts +0 -1
  47. package/types/particle/ParticleData.d.ts +0 -1
  48. package/types/particle/ParticleMesh.d.ts +0 -289
  49. package/types/particle/ParticleShaderDeclaration.d.ts +0 -1
  50. package/types/particle/ParticleShaderMacro.d.ts +0 -1
  51. package/types/particle/ParticleShaderProperty.d.ts +0 -1
  52. package/types/particle/ParticleSystem.d.ts +0 -41
  53. package/types/particle/ParticleVertexElements.d.ts +0 -1
  54. package/types/particle/ParticleVertexUtils.d.ts +0 -1
  55. package/types/particle/enum/ParticleAnimationRowMode.d.ts +0 -9
  56. package/types/particle/enum/ParticleAnimationType.d.ts +0 -9
  57. package/types/particle/enum/ParticleCurveMode.d.ts +0 -13
  58. package/types/particle/enum/ParticleGradientMode.d.ts +0 -13
  59. package/types/particle/enum/ParticleRenderMode.d.ts +0 -17
  60. package/types/particle/enum/ParticleScaleMode.d.ts +0 -11
  61. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +0 -9
  62. package/types/particle/enum/ParticleShapeType.d.ts +0 -15
  63. package/types/particle/enum/ParticleSimulationSpace.d.ts +0 -9
  64. package/types/particle/enum/index.d.ts +0 -9
  65. package/types/particle/module/Burst.d.ts +0 -38
  66. package/types/particle/module/ColorGradient.d.ts +0 -75
  67. package/types/particle/module/ColorOverLifetimeModule.d.ts +0 -20
  68. package/types/particle/module/EmissionModule.d.ts +0 -63
  69. package/types/particle/module/FrameOverTime.d.ts +0 -73
  70. package/types/particle/module/ParticleCurve.d.ts +0 -37
  71. package/types/particle/module/RotationOverLifetimeModule.d.ts +0 -21
  72. package/types/particle/module/RotationVelocityGradient.d.ts +0 -184
  73. package/types/particle/module/SizeGradient.d.ts +0 -151
  74. package/types/particle/module/SizeOverLifetimeModule.d.ts +0 -21
  75. package/types/particle/module/StartFrame.d.ts +0 -46
  76. package/types/particle/module/TextureSheetAnimationModule.d.ts +0 -37
  77. package/types/particle/module/VelocityGradient.d.ts +0 -110
  78. package/types/particle/module/VelocityOverLifetimeModule.d.ts +0 -22
  79. package/types/particle/module/index.d.ts +0 -15
  80. package/types/particle/module/shape/BaseShape.d.ts +0 -26
  81. package/types/particle/module/shape/BoxShape.d.ts +0 -20
  82. package/types/particle/module/shape/CircleShape.d.ts +0 -27
  83. package/types/particle/module/shape/ConeShape.d.ts +0 -35
  84. package/types/particle/module/shape/HemisphereShape.d.ts +0 -23
  85. package/types/particle/module/shape/ShapeUtils.d.ts +0 -1
  86. package/types/particle/module/shape/SphereShape.d.ts +0 -23
  87. package/types/particle/module/shape/index.d.ts +0 -5
  88. package/types/particle/modules/ShapeModule.d.ts +0 -9
  89. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  90. package/types/particle/moudules/Burst.d.ts +0 -25
  91. package/types/particle/moudules/Emission.d.ts +0 -47
  92. package/types/particle/moudules/EmissionModule.d.ts +0 -49
  93. package/types/particle/moudules/MainModule.d.ts +0 -59
  94. package/types/particle/moudules/ParticleCurve.d.ts +0 -27
  95. package/types/particle/moudules/ParticleGradient.d.ts +0 -28
  96. package/types/particle/moudules/ShapeModule.d.ts +0 -7
  97. package/types/particle/moudules/shape/BaseShape.d.ts +0 -28
  98. package/types/particle/moudules/shape/BoxShape.d.ts +0 -20
  99. package/types/particle/moudules/shape/CircleShape.d.ts +0 -27
  100. package/types/particle/moudules/shape/ConeShape.d.ts +0 -35
  101. package/types/particle/moudules/shape/HemisphereShape.d.ts +0 -23
  102. package/types/particle/moudules/shape/ShapeUtils.d.ts +0 -1
  103. package/types/particle/moudules/shape/SphereShape.d.ts +0 -23
  104. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  105. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +0 -15
  106. package/types/particle/moudules/shape/index.d.ts +0 -5
  107. package/types/shadow/PipelinePass.d.ts +0 -16
  108. package/types/utils/BoolUpdateFlag.d.ts +0 -12
  109. package/types/utils/DisorderedArray.d.ts +0 -18
  110. package/types/utils/UpdateFlag.d.ts +0 -20
  111. package/types/utils/UpdateFlagManager.d.ts +0 -1
  112. package/types/utils/Utils.d.ts +0 -31
  113. package/types/xr/component/XRPoseDriver.d.ts +0 -10
  114. package/types/xr/data/XRCamera.d.ts +0 -6
  115. package/types/xr/data/XRDevice.d.ts +0 -9
  116. package/types/xr/data/XRHandle.d.ts +0 -10
  117. package/types/xr/enum/EnumXRButton.d.ts +0 -5
  118. package/types/xr/enum/EnumXRDevicePhase.d.ts +0 -4
  119. package/types/xr/enum/EnumXRFeature.d.ts +0 -9
  120. package/types/xr/enum/EnumXRInputSource.d.ts +0 -8
  121. package/types/xr/enum/EnumXRMode.d.ts +0 -7
  122. package/types/xr/enum/EnumXRSubsystem.d.ts +0 -4
  123. package/types/xr/enum/EnumXRTrackingMode.d.ts +0 -7
  124. package/types/xr/feature/XRCameraManager.d.ts +0 -21
  125. package/types/xr/feature/XRFeature.d.ts +0 -29
  126. package/types/xr/feature/XRImageTrackManager.d.ts +0 -10
  127. package/types/xr/feature/XRInputManager.d.ts +0 -16
  128. package/types/xr/index.d.ts +0 -18
  129. package/types/xr/provider/XRProvider.d.ts +0 -19
  130. package/types/xr/subsystem/XRInputSubsystem.d.ts +0 -5
  131. package/types/xr/subsystem/XRSubsystem.d.ts +0 -30
  132. /package/types/{animation/internal/AnimationCurveOwnerLayerData.d.ts → enums/CameraType.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.1.0-beta.9",
3
+ "version": "1.2.0-alpha.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "1.1.0-beta.9"
18
+ "@galacean/engine-math": "1.2.0-alpha.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.1.0-beta.9"
21
+ "@galacean/engine-design": "1.2.0-alpha.0"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -1,3 +1,4 @@
1
+ import { AssetType } from "../../asset/AssetType";
1
2
  import { TextureFilterMode, TextureFormat, TextureWrapMode } from "../../texture";
2
3
  /**
3
4
  * The original data type of the atlas.
@@ -16,6 +17,8 @@ export interface AtlasConfig {
16
17
  atlasItems: {
17
18
  /** The url of the sub atlas. */
18
19
  img: string;
20
+ /** Image type. */
21
+ type: AssetType;
19
22
  /** Sprites contained in the sub atlas. */
20
23
  sprites: AtlasSprite[];
21
24
  }[];
@@ -9,5 +9,6 @@ export declare enum SpriteModifyFlags {
9
9
  atlasRegionOffset = 16,
10
10
  region = 32,
11
11
  pivot = 64,
12
- border = 128
12
+ border = 128,
13
+ destroy = 256
13
14
  }
package/types/Camera.d.ts CHANGED
@@ -55,7 +55,6 @@ export declare class Camera extends Component {
55
55
  private _viewport;
56
56
  private _pixelViewport;
57
57
  private _inverseProjectionMatrix;
58
- private _lastAspectSize;
59
58
  private _invViewProjMat;
60
59
  /**
61
60
  * Shader data.
@@ -249,4 +248,5 @@ export declare class Camera extends Component {
249
248
  * The inverse of the projection matrix.
250
249
  */
251
250
  private _getInverseProjectionMatrix;
251
+ private _onPixelViewportChanged;
252
252
  }
package/types/Canvas.d.ts CHANGED
@@ -1,9 +1,18 @@
1
1
  /**
2
2
  * Canvas.
3
3
  */
4
- export interface Canvas {
5
- /** The width of the canvas. */
6
- width: number;
7
- /** The height of the canvas. */
8
- height: number;
4
+ export declare abstract class Canvas {
5
+ private _width;
6
+ private _height;
7
+ /**
8
+ * The width of the canvas.
9
+ */
10
+ get width(): number;
11
+ set width(value: number);
12
+ /**
13
+ *The height of the canvas.
14
+ */
15
+ get height(): number;
16
+ set height(value: number);
17
+ protected abstract _onSizeChanged(width: number, height: number): void;
9
18
  }
@@ -1,3 +1,4 @@
1
+ import { IReferable } from "./asset/IReferable";
1
2
  import { EngineObject } from "./base";
2
3
  import { Entity } from "./Entity";
3
4
  import { Scene } from "./Scene";
@@ -22,4 +23,5 @@ export declare class Component extends EngineObject {
22
23
  */
23
24
  get scene(): Scene;
24
25
  constructor(entity: Entity);
26
+ protected _addResourceReferCount(resource: IReferable, count: number): void;
25
27
  }
@@ -16,6 +16,9 @@ export declare class ComponentsManager {
16
16
  private _onUpdateAnimations;
17
17
  private _onUpdateRenderers;
18
18
  private _componentsContainerPool;
19
+ addCamera(camera: Camera): void;
20
+ removeCamera(camera: Camera): void;
21
+ sortCameras(): void;
19
22
  addRenderer(renderer: Renderer): void;
20
23
  removeRenderer(renderer: Renderer): void;
21
24
  addOnStartScript(script: Script): void;
@@ -19,6 +19,7 @@ export declare class DisorderedArray<T> {
19
19
  deleteByIndex(index: number): T;
20
20
  forEach(callbackFn: (element: T) => void, swapFn: (element: T, index: number) => void): void;
21
21
  forEachAndClean(callbackFn: (e: T) => void): void;
22
+ sort(compareFn: (a: T, b: T) => number): void;
22
23
  garbageCollection(): void;
23
24
  private _startLoop;
24
25
  private _endLoop;
package/types/Engine.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IPhysics, IShaderLab } from "@galacean/engine-design";
1
+ import { IHardwareRenderer, IPhysics, IShaderLab, IXRDevice } from "@galacean/engine-design";
2
2
  import { Canvas } from "./Canvas";
3
3
  import { EngineSettings } from "./EngineSettings";
4
4
  import { Entity } from "./Entity";
@@ -8,13 +8,15 @@ import { EventDispatcher, Time } from "./base";
8
8
  import { ColorSpace } from "./enums/ColorSpace";
9
9
  import { InputManager } from "./input";
10
10
  import { PhysicsScene } from "./physics/PhysicsScene";
11
- import { IHardwareRenderer } from "./renderingHardwareInterface";
11
+ import { XRManager } from "./xr/XRManager";
12
12
  /**
13
13
  * Engine.
14
14
  */
15
15
  export declare class Engine extends EventDispatcher {
16
16
  /** Input manager of Engine. */
17
17
  readonly inputManager: InputManager;
18
+ /** XR manager of Engine. */
19
+ readonly xrManager: XRManager;
18
20
  private _settings;
19
21
  private _resourceManager;
20
22
  private _sceneManager;
@@ -130,6 +132,8 @@ export declare class Engine extends EventDispatcher {
130
132
  export interface EngineConfiguration {
131
133
  /** Physics. */
132
134
  physics?: IPhysics;
135
+ /** XR Device. */
136
+ xrDevice?: IXRDevice;
133
137
  /** Color space. */
134
138
  colorSpace?: ColorSpace;
135
139
  /** Shader lab */
package/types/Entity.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare class Entity extends EngineObject {
15
15
  layer: Layer;
16
16
  /** Transform component. */
17
17
  readonly transform: Transform;
18
+ private _templateResource;
18
19
  private _parent;
19
20
  private _activeChangedComponents;
20
21
  /**
@@ -1,5 +1,6 @@
1
1
  import { Camera } from "../Camera";
2
2
  import { Layer } from "../Layer";
3
+ import { CameraClearFlags } from "../enums/CameraClearFlags";
3
4
  import { Material } from "../material";
4
5
  import { RenderTarget, TextureCubeFace } from "../texture";
5
6
  import { RenderContext } from "./RenderContext";
@@ -52,8 +53,9 @@ export declare class BasicRenderPipeline {
52
53
  * @param context - Render context
53
54
  * @param cubeFace - Render surface of cube texture
54
55
  * @param mipLevel - Set mip level the data want to write
56
+ * @param ignoreClear - Ignore clear flag
55
57
  */
56
- render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number): void;
58
+ render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number, ignoreClear?: CameraClearFlags): void;
57
59
  private _drawRenderPass;
58
60
  /**
59
61
  * Push render data to render queue.
@@ -28,11 +28,4 @@ export declare class RenderQueue {
28
28
  * Sort the elements.
29
29
  */
30
30
  sort(compareFunc: Function): void;
31
- /**
32
- * @remarks
33
- * Modified based on v8.
34
- * https://github.com/v8/v8/blob/7.2-lkgr/src/js/array.js
35
- */
36
- private _quickSort;
37
- private _insertionSort;
38
31
  }
package/types/Scene.d.ts CHANGED
@@ -4,6 +4,7 @@ import { Engine } from "./Engine";
4
4
  import { Entity } from "./Entity";
5
5
  import { EngineObject } from "./base";
6
6
  import { FogMode } from "./enums/FogMode";
7
+ import { DirectLight } from "./lighting";
7
8
  import { AmbientLight } from "./lighting/AmbientLight";
8
9
  import { PhysicsScene } from "./physics/PhysicsScene";
9
10
  import { ShaderData } from "./shader/ShaderData";
@@ -15,8 +16,6 @@ import { ShadowResolution } from "./shadow/enum/ShadowResolution";
15
16
  export declare class Scene extends EngineObject {
16
17
  private static _fogColorProperty;
17
18
  private static _fogParamsProperty;
18
- private static _sunlightColorProperty;
19
- private static _sunlightDirectionProperty;
20
19
  /** Scene name. */
21
20
  name: string;
22
21
  /** Physics. */
@@ -42,6 +41,7 @@ export declare class Scene extends EngineObject {
42
41
  private _fogDensity;
43
42
  private _fogParams;
44
43
  private _isActive;
44
+ private _sun;
45
45
  /**
46
46
  * Whether the scene is active.
47
47
  */
@@ -103,6 +103,12 @@ export declare class Scene extends EngineObject {
103
103
  * Root entity collection.
104
104
  */
105
105
  get rootEntities(): Readonly<Entity[]>;
106
+ /**
107
+ * Sun light source.
108
+ * @remarks If set this to null, scene will use the brightest directional light.
109
+ */
110
+ get sun(): DirectLight | null;
111
+ set sun(light: DirectLight | null);
106
112
  /**
107
113
  * Create scene.
108
114
  * @param engine - Engine
@@ -152,4 +158,5 @@ export declare class Scene extends EngineObject {
152
158
  private _addToRootEntityList;
153
159
  private _computeLinearFogParams;
154
160
  private _computeExponentialFogParams;
161
+ private _getSunlight;
155
162
  }
package/types/Utils.d.ts CHANGED
@@ -28,4 +28,5 @@ export declare class Utils {
28
28
  static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
29
29
  private static _stringToPath;
30
30
  private static _formatRelativePath;
31
+ private static _insertionSort;
31
32
  }
@@ -46,12 +46,40 @@ export declare class AnimationClip extends EngineObject {
46
46
  clearEvents(): void;
47
47
  /**
48
48
  * Add curve binding for the clip.
49
- * @param relativePath - Path to the game object this curve applies to. The relativePath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
50
- * @param type- The class type of the component that is animated
51
- * @param propertyName - The name or path to the property being animated
49
+ * @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
50
+ * @param componentType - The class type of the component that is animated
51
+ * @param propertyPath - The path to the property being animated, support "a.b" and "a.b[x]" description mode
52
52
  * @param curve - The animation curve
53
53
  */
54
- addCurveBinding<T extends Component>(relativePath: string, type: new (entity: Entity) => T, propertyName: string, curve: AnimationCurve<KeyframeValueType>): void;
54
+ addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, propertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
55
+ /**
56
+ * Add curve binding for the clip.
57
+ * @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
58
+ * @param componentType - The class type of the component that is animated
59
+ * @param setPropertyPath - The path to set the property being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
60
+ * @param getPropertyPath - The path to get the value when being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
61
+ * @param curve - The animation curve
62
+ */
63
+ addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, setPropertyPath: string, getPropertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
64
+ /**
65
+ * Add curve binding for the clip.
66
+ * @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
67
+ * @param componentType - The type index of the component that is animated
68
+ * @param componentIndex - The class type of the component that is animated
69
+ * @param propertyPath - The path to the property being animated, support "a.b" and "a.b[x]" description mode
70
+ * @param curve - The animation curve
71
+ */
72
+ addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, componentIndex: number, propertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
73
+ /**
74
+ * Add curve binding for the clip.
75
+ * @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
76
+ * @param componentType - The class type of the component that is animated
77
+ * @param componentIndex - The class type of the component that is animated
78
+ * @param setPropertyPath - The path to set the property being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
79
+ * @param getPropertyPath - The path to get the value when being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
80
+ * @param curve - The animation curve
81
+ */
82
+ addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, componentIndex: number, setPropertyPath: string, getPropertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
55
83
  /**
56
84
  * Clears all curve bindings from the clip.
57
85
  */
@@ -1,7 +1,7 @@
1
1
  import { Component } from "../Component";
2
2
  import { Entity } from "../Entity";
3
- import { AnimationCurve } from "./animationCurve";
4
3
  import { KeyframeValueType } from "./Keyframe";
4
+ import { AnimationCurve } from "./animationCurve";
5
5
  /**
6
6
  * Associate AnimationCurve and the Entity
7
7
  */
@@ -13,8 +13,18 @@ export declare class AnimationClipCurveBinding {
13
13
  relativePath: string;
14
14
  /** The class type of the component that is animated. */
15
15
  type: new (entity: Entity) => Component;
16
- /** The name or path to the property being animated. */
16
+ /** The index of the component that is animated. */
17
+ typeIndex: number;
18
+ /**
19
+ * The name or path to the property being animated.
20
+ * @remarks support property:"a.b", array: "a.b[0]", method: "a.b('c', 0, $value)"
21
+ */
17
22
  property: string;
23
+ /**
24
+ * The name or path to get the value when being animated.
25
+ * @remarks support property:"a.b", array: "a.b[0]", method: "a.b('c', 0)"
26
+ */
27
+ getProperty?: string;
18
28
  /** The animation curve. */
19
29
  curve: AnimationCurve<KeyframeValueType>;
20
30
  private _tempCurveOwner;
@@ -1,5 +1,6 @@
1
1
  import { AnimatorStateMachine } from "./AnimatorStateMachine";
2
2
  import { AnimatorLayerBlendingMode } from "./enums/AnimatorLayerBlendingMode";
3
+ import { AnimatorLayerMask } from "./AnimatorLayerMask";
3
4
  /**
4
5
  * The Animation Layer contains a state machine that controls animations of a model or part of it.
5
6
  */
@@ -11,6 +12,8 @@ export declare class AnimatorControllerLayer {
11
12
  blendingMode: AnimatorLayerBlendingMode;
12
13
  /** The state machine for the layer. */
13
14
  stateMachine: AnimatorStateMachine;
15
+ /** The AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer. */
16
+ mask: AnimatorLayerMask;
14
17
  /**
15
18
  * @param name - The layer's name
16
19
  */
@@ -0,0 +1,45 @@
1
+ import { Entity } from "../Entity";
2
+ import { LayerPathMask } from "./LayerPathMask";
3
+ /**
4
+ * AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer.
5
+ */
6
+ export declare class AnimatorLayerMask {
7
+ /**
8
+ * Creates an AnimatorLayerMask instance by specifying an entity.
9
+ * This will automatically add path masks for the entity and all its children.
10
+ * @param entity - The root entity to create path masks for
11
+ */
12
+ static createByEntity(entity: Entity): AnimatorLayerMask;
13
+ private static _addPathMaskWithChildren;
14
+ private _pathMasks;
15
+ private _pathMaskMap;
16
+ /**
17
+ * The list of path masks.
18
+ */
19
+ get pathMasks(): Readonly<LayerPathMask[]>;
20
+ /**
21
+ * Adds a path mask to the AnimatorLayerMask, the root path is "".
22
+ * @param path - The path to add a mask for
23
+ * @returns The created or existing LayerPathMask
24
+ */
25
+ addPathMask(path: string): LayerPathMask;
26
+ /**
27
+ * Removes a path mask from the AnimatorLayerMask.
28
+ * @param path - The path of the mask to remove
29
+ */
30
+ removePathMask(path: any): void;
31
+ /**
32
+ * Get a path mask based on the given path.
33
+ * @param path - The path of the mask to get
34
+ * @returns The LayerPathMask for the given path
35
+ */
36
+ getPathMask(path: string): LayerPathMask;
37
+ /**
38
+ * Sets the active state of a path mask.
39
+ * If recursive is true, it also sets the active state of all child path masks.
40
+ * @param path - The path of the mask to modify
41
+ * @param active - The active state to set
42
+ * @param withChildren - Whether to apply the active state recursively to child paths
43
+ */
44
+ setPathMaskActive(path: string, active: boolean, withChildren?: boolean): void;
45
+ }
@@ -17,4 +17,4 @@ export declare class Keyframe<V extends KeyframeValueType, T = V extends number
17
17
  /**
18
18
  * Type of Keyframe value.
19
19
  */
20
- export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | Rect | boolean | ReferResource;
20
+ export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | Rect | string | boolean | ReferResource;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * LayerPathMask represents a mask for a specific entity in an animation layer.
3
+ * It is used to control the animation whether to be applied to the entity or not.
4
+ */
5
+ export declare class LayerPathMask {
6
+ /**
7
+ * It identifies a particular entity in the hierarchy.
8
+ * Example: "arm/left/hand" could be a path to the left hand of a character.
9
+ */
10
+ path: string;
11
+ /**
12
+ * The active property is indicating whether the animation at this path is active or not.
13
+ * When true, the animation for this path is applied; when false, the animation for this path is ignored.
14
+ */
15
+ active: boolean;
16
+ }
@@ -0,0 +1,7 @@
1
+ import { AnimationCurve } from "./AnimationCurve";
2
+ /**
3
+ * Store a collection of Keyframes that can be evaluated over time.
4
+ */
5
+ export declare class AnimationStringCurve extends AnimationCurve<string> {
6
+ constructor();
7
+ }
@@ -10,3 +10,4 @@ export { AnimationVector3Curve } from "./AnimationVector3Curve";
10
10
  export { AnimationVector4Curve } from "./AnimationVector4Curve";
11
11
  export { AnimationRefCurve } from "./AnimationRefCurve";
12
12
  export { AnimationRectCurve } from "./AnimationRectCurve";
13
+ export { AnimationStringCurve } from "./AnimationStringCurve";
@@ -18,4 +18,5 @@ export { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
18
18
  export { InterpolationType } from "./enums/InterpolationType";
19
19
  export { WrapMode } from "./enums/WrapMode";
20
20
  export * from "./Keyframe";
21
+ export * from "./AnimatorLayerMask";
21
22
  export { StateMachineScript } from "./StateMachineScript";
@@ -13,7 +13,10 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
13
13
  get [Symbol.toStringTag](): string;
14
14
  private _promise;
15
15
  private _state;
16
- private _onProgressCallback;
16
+ private _taskCompleteProgress;
17
+ private _taskDetailProgress;
18
+ private _onTaskCompleteCallbacks;
19
+ private _onTaskDetailCallbacks;
17
20
  private _onCancelHandler;
18
21
  private _reject;
19
22
  /**
@@ -26,10 +29,11 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
26
29
  constructor(executor: AssetPromiseExecutor<T>);
27
30
  /**
28
31
  * Progress callback.
29
- * @param callback
32
+ * @param onTaskComplete - This callback function provides information about the overall progress of the task. For example, in batch processing tasks, you can use the loaded and total parameters to calculate the percentage of task completion or display a progress bar
33
+ * @param onTaskDetail - This callback function provides detailed progress information about the task. For instance, in file downloading scenarios, you can use the loaded and total parameters to calculate the download progress percentage and utilize the url parameter to provide additional details such as download speed and estimated remaining time
30
34
  * @returns AssetPromise
31
35
  */
32
- onProgress(callback: (progress: number) => void): AssetPromise<T>;
36
+ onProgress(onTaskComplete: (loaded: number, total: number) => void, onTaskDetail?: (identifier: string, loaded: number, total: number) => void): AssetPromise<T>;
33
37
  then<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): AssetPromise<TResult1 | TResult2>;
34
38
  /**
35
39
  * Attaches a callback for only the rejection of the Promise.
@@ -51,6 +55,8 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
51
55
  cancel(): AssetPromise<T>;
52
56
  }
53
57
  interface AssetPromiseExecutor<T> {
54
- (resolve: (value?: T | PromiseLike<T>) => void, reject?: (reason?: any) => void, setProgress?: (progress: number) => void, onCancel?: (callback: () => void) => void): void;
58
+ (resolve: (value?: T | PromiseLike<T>) => void, reject?: (reason?: any) => void, setTaskCompleteProgress?: TaskCompleteCallback, setTaskDetailProgress?: TaskDetailCallback, onCancel?: (callback: () => void) => void): void;
55
59
  }
60
+ type TaskCompleteCallback = (loaded: number, total: number) => void;
61
+ type TaskDetailCallback = (url: string, loaded: number, total: number) => void;
56
62
  export {};
@@ -8,6 +8,7 @@ export declare abstract class ReferResource extends EngineObject implements IRef
8
8
  /** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
9
9
  isGCIgnored: boolean;
10
10
  private _refCount;
11
+ private _superResources;
11
12
  /**
12
13
  * Counted by valid references.
13
14
  */
@@ -15,8 +16,8 @@ export declare abstract class ReferResource extends EngineObject implements IRef
15
16
  protected constructor(engine: Engine);
16
17
  /**
17
18
  * Destroy self.
18
- * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
19
- * @returns Whether the release was successful.
19
+ * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully
20
+ * @returns Whether the release was successful
20
21
  */
21
22
  destroy(force?: boolean): boolean;
22
23
  }
@@ -104,7 +104,6 @@ export declare class ResourceManager {
104
104
  private _gc;
105
105
  private _getResolveResource;
106
106
  private _parseURL;
107
- private _getParameterByName;
108
107
  private _parseQueryPath;
109
108
  }
110
109
  /**
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { Platform } from "./Platform";
2
2
  export { Engine } from "./Engine";
3
3
  export { SystemInfo } from "./SystemInfo";
4
- export type { Canvas } from "./Canvas";
4
+ export { Canvas } from "./Canvas";
5
5
  export { Scene } from "./Scene";
6
6
  export { SceneManager } from "./SceneManager";
7
7
  export { Entity } from "./Entity";
@@ -29,8 +29,10 @@ export { BackgroundMode } from "./enums/BackgroundMode";
29
29
  export { DepthTextureMode } from "./enums/DepthTextureMode";
30
30
  export { FogMode } from "./enums/FogMode";
31
31
  export { CameraClearFlags } from "./enums/CameraClearFlags";
32
+ export { CameraType } from "./enums/CameraType";
32
33
  export { ColorSpace } from "./enums/ColorSpace";
33
34
  export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
35
+ export { XRManager } from "./xr/XRManager";
34
36
  export * from "./input/index";
35
37
  export * from "./lighting/index";
36
38
  export * from "./shadow/index";
@@ -26,7 +26,6 @@ export declare abstract class Light extends Component {
26
26
  private _color;
27
27
  private _viewMat;
28
28
  private _inverseViewMat;
29
- private _lightColor;
30
29
  /**
31
30
  * Light Color.
32
31
  */
@@ -9,5 +9,4 @@ export declare class LightManager {
9
9
  private _directData;
10
10
  private _pointData;
11
11
  private _spotData;
12
- private _getSunLightIndex;
13
12
  }
@@ -9,6 +9,9 @@ export declare class PBRMaterial extends PBRBaseMaterial {
9
9
  private static _roughnessProp;
10
10
  private static _roughnessMetallicTextureProp;
11
11
  private static _iorProp;
12
+ private static _anisotropyInfoProp;
13
+ private static _anisotropyTextureProp;
14
+ private _anisotropyRotation;
12
15
  /**
13
16
  * Index Of Refraction.
14
17
  * @defaultValue `1.5`
@@ -33,6 +36,26 @@ export declare class PBRMaterial extends PBRBaseMaterial {
33
36
  */
34
37
  get roughnessMetallicTexture(): Texture2D;
35
38
  set roughnessMetallicTexture(value: Texture2D);
39
+ /**
40
+ * The strength of anisotropy, when anisotropyTexture is present, this value is multiplied by the blue channel.
41
+ * @defaultValue `0`
42
+ */
43
+ get anisotropy(): number;
44
+ set anisotropy(value: number);
45
+ /**
46
+ * The rotation of the anisotropy in tangent, bitangent space, value in degrees.
47
+ * @defaultValue `0`
48
+ */
49
+ get anisotropyRotation(): number;
50
+ set anisotropyRotation(value: number);
51
+ /**
52
+ * The anisotropy texture.
53
+ * @remarks
54
+ * Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation.
55
+ * The blue channel contains strength as [0, 1] to be multiplied by anisotropy.
56
+ */
57
+ get anisotropyTexture(): Texture2D;
58
+ set anisotropyTexture(value: Texture2D);
36
59
  /**
37
60
  * Create a pbr metallic-roughness workflow material instance.
38
61
  * @param engine - Engine to which the material belongs
@@ -9,11 +9,11 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
9
9
  private static _jointCountProperty;
10
10
  private static _jointSamplerProperty;
11
11
  private static _jointMatrixProperty;
12
+ private _localBounds;
12
13
  private _jointDataCreateCache;
13
14
  private _blendShapeWeights;
14
15
  private _maxVertexUniformVectors;
15
16
  private _rootBone;
16
- private _localBounds;
17
17
  private _jointMatrices;
18
18
  private _jointTexture;
19
19
  private _bones;
@@ -13,7 +13,6 @@ export declare class EmissionModule extends ParticleGeneratorModule {
13
13
  /** The shape of the emitter. */
14
14
  shape: BaseShape;
15
15
  private _bursts;
16
- private _frameRateTime;
17
16
  private _currentBurstIndex;
18
17
  private _burstRand;
19
18
  /**
@@ -54,7 +54,6 @@ export declare class MainModule implements ICustomClone {
54
54
  scalingMode: ParticleScaleMode;
55
55
  /** If set to true, the Particle Generator automatically begins to play on startup. */
56
56
  playOnEnabled: boolean;
57
- private _maxParticles;
58
57
  private _generator;
59
58
  private _gravity;
60
59
  /**