@galacean/engine-core 0.0.0-experimental-renderSort.4 → 0.0.0-experimental-stateMachine.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.
- package/LICENSE +2 -2
- package/dist/main.js +22858 -21862
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +22858 -21862
- package/dist/module.js +21193 -20200
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/BasicResources.d.ts +1 -0
- package/types/Camera.d.ts +48 -8
- package/types/Canvas.d.ts +15 -5
- package/types/Component.d.ts +2 -0
- package/types/ComponentsManager.d.ts +3 -0
- package/types/DisorderedArray.d.ts +1 -0
- package/types/Engine.d.ts +9 -3
- package/types/Entity.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +9 -32
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +1 -0
- package/types/RenderPipeline/RenderQueue.d.ts +1 -9
- package/types/RenderPipeline/{Index.d.ts → index.d.ts} +0 -1
- package/types/Renderer.d.ts +4 -1
- package/types/Scene.d.ts +14 -2
- package/types/SystemInfo.d.ts +2 -0
- package/types/Utils.d.ts +7 -1
- package/types/animation/AnimationClip.d.ts +32 -4
- package/types/animation/AnimationClipCurveBinding.d.ts +12 -2
- package/types/animation/Animator.d.ts +30 -1
- package/types/animation/AnimatorCondition.d.ts +13 -0
- package/types/animation/AnimatorController.d.ts +21 -2
- package/types/animation/AnimatorControllerLayer.d.ts +3 -0
- package/types/animation/AnimatorControllerParameter.d.ts +10 -0
- package/types/animation/AnimatorLayerMask.d.ts +45 -0
- package/types/animation/AnimatorState.d.ts +17 -4
- package/types/animation/AnimatorStateMachine.d.ts +39 -0
- package/types/animation/AnimatorTransition.d.ts +33 -0
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/LayerPathMask.d.ts +16 -0
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
- package/types/animation/animationCurve/index.d.ts +1 -0
- package/types/animation/index.d.ts +1 -0
- package/types/asset/AssetPromise.d.ts +10 -5
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/Loader.d.ts +7 -0
- package/types/asset/ReferResource.d.ts +3 -2
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/base/Constant.d.ts +1 -0
- package/types/enums/CameraType.d.ts +1 -0
- package/types/enums/Downsampling.d.ts +11 -0
- package/types/enums/MSAASamples.d.ts +13 -0
- package/types/index.d.ts +5 -1
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +0 -1
- package/types/material/PBRMaterial.d.ts +23 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
- package/types/particle/modules/MainModule.d.ts +2 -0
- package/types/particle/modules/shape/BaseShape.d.ts +2 -2
- package/types/particle/modules/shape/BoxShape.d.ts +2 -1
- package/types/particle/modules/shape/CircleShape.d.ts +2 -1
- package/types/particle/modules/shape/ConeShape.d.ts +2 -1
- package/types/particle/modules/shape/HemisphereShape.d.ts +2 -1
- package/types/particle/modules/shape/SphereShape.d.ts +2 -1
- package/types/particle/modules/shape/index.d.ts +1 -0
- package/types/physics/HitResult.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
- package/types/renderingHardwareInterface/index.d.ts +0 -1
- package/types/shader/Shader.d.ts +15 -2
- package/types/shader/state/DepthState.d.ts +2 -2
- package/types/shaderlib/ShaderFactory.d.ts +8 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/texture/RenderTarget.d.ts +5 -4
- package/types/texture/Texture.d.ts +1 -0
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
- package/types/texture/enums/TextureFormat.d.ts +30 -26
- package/types/xr/XRManager.d.ts +5 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +0 -17
- package/types/RenderPipeline/RenderPass.d.ts +0 -55
- package/types/physics/PhysicsManager.d.ts +0 -76
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-stateMachine.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": "0.0.0-experimental-
|
|
18
|
+
"@galacean/engine-math": "0.0.0-experimental-stateMachine.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "0.0.0-experimental-
|
|
21
|
+
"@galacean/engine-design": "0.0.0-experimental-stateMachine.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/Camera.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Component } from "./Component";
|
|
|
3
3
|
import { Layer } from "./Layer";
|
|
4
4
|
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
5
5
|
import { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
6
|
+
import { Downsampling } from "./enums/Downsampling";
|
|
7
|
+
import { MSAASamples } from "./enums/MSAASamples";
|
|
6
8
|
import { Shader } from "./shader/Shader";
|
|
7
9
|
import { ShaderData } from "./shader/ShaderData";
|
|
8
10
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
@@ -22,6 +24,7 @@ export declare class Camera extends Component {
|
|
|
22
24
|
enableFrustumCulling: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Determining what to clear when rendering by a Camera.
|
|
27
|
+
*
|
|
25
28
|
* @defaultValue `CameraClearFlags.All`
|
|
26
29
|
*/
|
|
27
30
|
clearFlags: CameraClearFlags;
|
|
@@ -32,31 +35,59 @@ export declare class Camera extends Component {
|
|
|
32
35
|
cullingMask: Layer;
|
|
33
36
|
/**
|
|
34
37
|
* Depth texture mode.
|
|
38
|
+
* If `DepthTextureMode.PrePass` is used, the depth texture can be accessed in the shader using `camera_DepthTexture`.
|
|
39
|
+
*
|
|
35
40
|
* @defaultValue `DepthTextureMode.None`
|
|
36
41
|
*/
|
|
37
42
|
depthTextureMode: DepthTextureMode;
|
|
43
|
+
/**
|
|
44
|
+
* Opacity texture down sampling.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue `Downsampling.TwoX`
|
|
47
|
+
*/
|
|
48
|
+
opaqueTextureDownsampling: Downsampling;
|
|
49
|
+
/**
|
|
50
|
+
* Multi-sample anti-aliasing samples when use independent canvas mode.
|
|
51
|
+
*
|
|
52
|
+
* @remarks The `independentCanvasEnabled` property should be `true` to take effect, otherwise it will be invalid.
|
|
53
|
+
*/
|
|
54
|
+
msaaSamples: MSAASamples;
|
|
38
55
|
private _priority;
|
|
39
56
|
private _shaderData;
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private _farClipPlane;
|
|
57
|
+
private _isCustomViewMatrix;
|
|
58
|
+
private _isCustomProjectionMatrix;
|
|
43
59
|
private _fieldOfView;
|
|
44
60
|
private _orthographicSize;
|
|
45
61
|
private _isProjectionDirty;
|
|
46
62
|
private _isInvProjMatDirty;
|
|
47
|
-
private _isFrustumProjectDirty;
|
|
48
63
|
private _customAspectRatio;
|
|
49
64
|
private _renderTarget;
|
|
50
65
|
private _depthBufferParams;
|
|
51
|
-
private
|
|
66
|
+
private _opaqueTextureEnabled;
|
|
67
|
+
private _frustumChangeFlag;
|
|
52
68
|
private _transform;
|
|
53
69
|
private _isViewMatrixDirty;
|
|
54
70
|
private _isInvViewProjDirty;
|
|
55
71
|
private _viewport;
|
|
56
72
|
private _pixelViewport;
|
|
57
73
|
private _inverseProjectionMatrix;
|
|
58
|
-
private _lastAspectSize;
|
|
59
74
|
private _invViewProjMat;
|
|
75
|
+
/**
|
|
76
|
+
* Whether to enable opaque texture.
|
|
77
|
+
* If enabled, the opaque texture can be accessed in the shader using `camera_OpaqueTexture`.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue `false`
|
|
80
|
+
*
|
|
81
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
82
|
+
*/
|
|
83
|
+
get opaqueTextureEnabled(): boolean;
|
|
84
|
+
set opaqueTextureEnabled(value: boolean);
|
|
85
|
+
/**
|
|
86
|
+
* Whether independent canvas is enabled.
|
|
87
|
+
*
|
|
88
|
+
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
89
|
+
*/
|
|
90
|
+
get independentCanvasEnabled(): boolean;
|
|
60
91
|
/**
|
|
61
92
|
* Shader data.
|
|
62
93
|
*/
|
|
@@ -113,12 +144,13 @@ export declare class Camera extends Component {
|
|
|
113
144
|
* View matrix.
|
|
114
145
|
*/
|
|
115
146
|
get viewMatrix(): Readonly<Matrix>;
|
|
147
|
+
set viewMatrix(value: Matrix);
|
|
116
148
|
/**
|
|
117
149
|
* The projection matrix is calculated by the relevant parameters of the camera by default.
|
|
118
150
|
* If it is manually set, the manual value will be maintained. Call resetProjectionMatrix() to restore it.
|
|
119
151
|
*/
|
|
152
|
+
get projectionMatrix(): Readonly<Matrix>;
|
|
120
153
|
set projectionMatrix(value: Matrix);
|
|
121
|
-
get projectionMatrix(): Matrix;
|
|
122
154
|
/**
|
|
123
155
|
* Whether to enable HDR.
|
|
124
156
|
* @todo When render pipeline modification
|
|
@@ -130,6 +162,10 @@ export declare class Camera extends Component {
|
|
|
130
162
|
*/
|
|
131
163
|
get renderTarget(): RenderTarget | null;
|
|
132
164
|
set renderTarget(value: RenderTarget | null);
|
|
165
|
+
/**
|
|
166
|
+
* Restore the view matrix to the world matrix of the entity.
|
|
167
|
+
*/
|
|
168
|
+
resetViewMatrix(): void;
|
|
133
169
|
/**
|
|
134
170
|
* Restore the automatic calculation of projection matrix through fieldOfView, nearClipPlane and farClipPlane.
|
|
135
171
|
*/
|
|
@@ -238,7 +274,8 @@ export declare class Camera extends Component {
|
|
|
238
274
|
*/
|
|
239
275
|
_onDisableInScene(): void;
|
|
240
276
|
private _updatePixelViewport;
|
|
241
|
-
private
|
|
277
|
+
private _viewMatrixChange;
|
|
278
|
+
private _projectionMatrixChange;
|
|
242
279
|
private _innerViewportToWorldPoint;
|
|
243
280
|
private _updateShaderData;
|
|
244
281
|
/**
|
|
@@ -249,4 +286,7 @@ export declare class Camera extends Component {
|
|
|
249
286
|
* The inverse of the projection matrix.
|
|
250
287
|
*/
|
|
251
288
|
private _getInverseProjectionMatrix;
|
|
289
|
+
private _forceUseInternalCanvas;
|
|
290
|
+
private _onPixelViewportChanged;
|
|
291
|
+
private _checkMainCanvasAntialiasWaste;
|
|
252
292
|
}
|
package/types/Canvas.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canvas.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
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 _onWidthChanged(value: number): void;
|
|
18
|
+
protected abstract _onHeightChange(value: number): void;
|
|
9
19
|
}
|
package/types/Component.d.ts
CHANGED
|
@@ -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, IInputOptions, 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 {
|
|
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,8 +132,12 @@ 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
|
-
/** Shader lab */
|
|
139
|
+
/** Shader lab. */
|
|
136
140
|
shaderLab?: IShaderLab;
|
|
141
|
+
/** Input options. */
|
|
142
|
+
input?: IInputOptions;
|
|
137
143
|
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -1,48 +1,23 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { RenderTarget, TextureCubeFace } from "../texture";
|
|
2
|
+
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
3
|
+
import { TextureCubeFace } from "../texture";
|
|
5
4
|
import { RenderContext } from "./RenderContext";
|
|
6
5
|
import { RenderData } from "./RenderData";
|
|
7
|
-
import { RenderPass } from "./RenderPass";
|
|
8
6
|
/**
|
|
9
7
|
* Basic render pipeline.
|
|
10
8
|
*/
|
|
11
9
|
export declare class BasicRenderPipeline {
|
|
12
10
|
private _camera;
|
|
13
|
-
private _defaultPass;
|
|
14
|
-
private _renderPassArray;
|
|
15
11
|
private _lastCanvasSize;
|
|
16
|
-
private
|
|
12
|
+
private _internalColorTarget;
|
|
13
|
+
private _cascadedShadowCasterPass;
|
|
17
14
|
private _depthOnlyPass;
|
|
15
|
+
private _opaqueTexturePass;
|
|
18
16
|
/**
|
|
19
17
|
* Create a basic render pipeline.
|
|
20
18
|
* @param camera - Camera
|
|
21
19
|
*/
|
|
22
20
|
constructor(camera: Camera);
|
|
23
|
-
/**
|
|
24
|
-
* Default render pass.
|
|
25
|
-
*/
|
|
26
|
-
get defaultRenderPass(): RenderPass;
|
|
27
|
-
/**
|
|
28
|
-
* Add render pass.
|
|
29
|
-
* @param nameOrPass - The name of this Pass or RenderPass object. When it is a name, the following parameters need to be provided
|
|
30
|
-
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
31
|
-
* @param renderTarget - The specified Render Target
|
|
32
|
-
* @param replaceMaterial - Replaced material
|
|
33
|
-
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
34
|
-
*/
|
|
35
|
-
addRenderPass(nameOrPass: string | RenderPass, priority?: number, renderTarget?: RenderTarget, replaceMaterial?: Material, mask?: Layer): void;
|
|
36
|
-
/**
|
|
37
|
-
* Remove render pass by name or render pass object.
|
|
38
|
-
* @param nameOrPass - Render pass name or render pass object
|
|
39
|
-
*/
|
|
40
|
-
removeRenderPass(nameOrPass: string | RenderPass): void;
|
|
41
|
-
/**
|
|
42
|
-
* Get render pass by name.
|
|
43
|
-
* @param name - Render pass name
|
|
44
|
-
*/
|
|
45
|
-
getRenderPass(name: string): RenderPass;
|
|
46
21
|
/**
|
|
47
22
|
* Destroy internal resources.
|
|
48
23
|
*/
|
|
@@ -52,8 +27,9 @@ export declare class BasicRenderPipeline {
|
|
|
52
27
|
* @param context - Render context
|
|
53
28
|
* @param cubeFace - Render surface of cube texture
|
|
54
29
|
* @param mipLevel - Set mip level the data want to write
|
|
30
|
+
* @param ignoreClear - Ignore clear flag
|
|
55
31
|
*/
|
|
56
|
-
render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number): void;
|
|
32
|
+
render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number, ignoreClear?: CameraClearFlags): void;
|
|
57
33
|
private _drawRenderPass;
|
|
58
34
|
/**
|
|
59
35
|
* Push render data to render queue.
|
|
@@ -63,5 +39,6 @@ export declare class BasicRenderPipeline {
|
|
|
63
39
|
pushRenderData(context: RenderContext, data: RenderData): void;
|
|
64
40
|
private pushRenderDataWithShader;
|
|
65
41
|
private _drawBackgroundTexture;
|
|
66
|
-
private
|
|
42
|
+
private _prepareRender;
|
|
43
|
+
private _updateMVPShaderData;
|
|
67
44
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import { Layer } from "../Layer";
|
|
4
3
|
import { RenderQueueType } from "../shader";
|
|
5
4
|
import { RenderElement } from "./RenderElement";
|
|
6
5
|
/**
|
|
@@ -15,7 +14,7 @@ export declare class RenderQueue {
|
|
|
15
14
|
* Push a render element.
|
|
16
15
|
*/
|
|
17
16
|
pushRenderElement(element: RenderElement): void;
|
|
18
|
-
render(camera: Camera,
|
|
17
|
+
render(camera: Camera, pipelineStageTagValue: string): void;
|
|
19
18
|
/**
|
|
20
19
|
* Clear collection.
|
|
21
20
|
*/
|
|
@@ -28,11 +27,4 @@ export declare class RenderQueue {
|
|
|
28
27
|
* Sort the elements.
|
|
29
28
|
*/
|
|
30
29
|
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
30
|
}
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BoundingBox, Vector4 } from "@galacean/engine-math";
|
|
1
|
+
import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
+
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
3
4
|
import { IComponentCustomClone } from "./clone/ComponentCloner";
|
|
4
5
|
import { Material } from "./material";
|
|
5
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
@@ -110,5 +111,7 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
110
111
|
*/
|
|
111
112
|
setMaterials(materials: Material[]): void;
|
|
112
113
|
update(deltaTime: number): void;
|
|
114
|
+
protected _updateTransformShaderData(context: RenderContext, worldMatrix: Matrix): void;
|
|
115
|
+
protected _updateMVPShaderData(context: RenderContext, worldMatrix: Matrix): void;
|
|
113
116
|
private _setMaterial;
|
|
114
117
|
}
|
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. */
|
|
@@ -31,6 +30,11 @@ export declare class Scene extends EngineObject {
|
|
|
31
30
|
shadowFourCascadeSplits: Vector3;
|
|
32
31
|
/** Max Shadow distance. */
|
|
33
32
|
shadowDistance: number;
|
|
33
|
+
/**
|
|
34
|
+
* Last shadow fade distance in percentage, range [0,1].
|
|
35
|
+
* @remarks Value 0 is used for no shadow fade.
|
|
36
|
+
*/
|
|
37
|
+
shadowFadeBorder: number;
|
|
34
38
|
private _background;
|
|
35
39
|
private _shaderData;
|
|
36
40
|
private _shadowCascades;
|
|
@@ -42,6 +46,7 @@ export declare class Scene extends EngineObject {
|
|
|
42
46
|
private _fogDensity;
|
|
43
47
|
private _fogParams;
|
|
44
48
|
private _isActive;
|
|
49
|
+
private _sun;
|
|
45
50
|
/**
|
|
46
51
|
* Whether the scene is active.
|
|
47
52
|
*/
|
|
@@ -103,6 +108,12 @@ export declare class Scene extends EngineObject {
|
|
|
103
108
|
* Root entity collection.
|
|
104
109
|
*/
|
|
105
110
|
get rootEntities(): Readonly<Entity[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Sun light source.
|
|
113
|
+
* @remarks If set this to null, scene will use the brightest directional light.
|
|
114
|
+
*/
|
|
115
|
+
get sun(): DirectLight | null;
|
|
116
|
+
set sun(light: DirectLight | null);
|
|
106
117
|
/**
|
|
107
118
|
* Create scene.
|
|
108
119
|
* @param engine - Engine
|
|
@@ -152,4 +163,5 @@ export declare class Scene extends EngineObject {
|
|
|
152
163
|
private _addToRootEntityList;
|
|
153
164
|
private _computeLinearFogParams;
|
|
154
165
|
private _computeExponentialFogParams;
|
|
166
|
+
private _getSunlight;
|
|
155
167
|
}
|
package/types/SystemInfo.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class SystemInfo {
|
|
|
7
7
|
static platform: Platform;
|
|
8
8
|
/** The operating system is running on. */
|
|
9
9
|
static operatingSystem: string;
|
|
10
|
+
/** Whether the system support SIMD. */
|
|
11
|
+
private static _simdSupported;
|
|
10
12
|
/**
|
|
11
13
|
* The pixel ratio of the device.
|
|
12
14
|
*/
|
package/types/Utils.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export declare class Utils {
|
|
|
15
15
|
* @returns Whether the url is absolute url.
|
|
16
16
|
*/
|
|
17
17
|
static isAbsoluteUrl(url: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Judge whether the url is base64 url.
|
|
20
|
+
* @param url - The url to be judged.
|
|
21
|
+
* @returns Whether the url is base64 url.
|
|
22
|
+
*/
|
|
23
|
+
static isBase64Url(url: string): boolean;
|
|
18
24
|
/**
|
|
19
25
|
* Get the values of an object.
|
|
20
26
|
*/
|
|
@@ -27,5 +33,5 @@ export declare class Utils {
|
|
|
27
33
|
*/
|
|
28
34
|
static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
|
|
29
35
|
private static _stringToPath;
|
|
30
|
-
private static
|
|
36
|
+
private static _insertionSort;
|
|
31
37
|
}
|
|
@@ -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
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
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>(
|
|
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
|
|
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;
|
|
@@ -2,7 +2,10 @@ import { BoolUpdateFlag } from "../BoolUpdateFlag";
|
|
|
2
2
|
import { Component } from "../Component";
|
|
3
3
|
import { AnimatorController } from "./AnimatorController";
|
|
4
4
|
import { AnimatorState } from "./AnimatorState";
|
|
5
|
+
import { AnimatorStateTransition } from "./AnimatorTransition";
|
|
5
6
|
import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
|
|
7
|
+
import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
8
|
+
import { AnimatorControllerParameter, AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
|
|
6
9
|
/**
|
|
7
10
|
* The controller of the animation system.
|
|
8
11
|
*/
|
|
@@ -24,6 +27,14 @@ export declare class Animator extends Component {
|
|
|
24
27
|
*/
|
|
25
28
|
get animatorController(): AnimatorController;
|
|
26
29
|
set animatorController(animatorController: AnimatorController);
|
|
30
|
+
/**
|
|
31
|
+
* The layers in the animator's controller.
|
|
32
|
+
*/
|
|
33
|
+
get layers(): Readonly<AnimatorControllerLayer[]>;
|
|
34
|
+
/**
|
|
35
|
+
* The parameters in the animator's controller.
|
|
36
|
+
*/
|
|
37
|
+
get parameters(): Readonly<AnimatorControllerParameter[]>;
|
|
27
38
|
/**
|
|
28
39
|
* Play a state by name.
|
|
29
40
|
* @param stateName - The state name
|
|
@@ -39,6 +50,7 @@ export declare class Animator extends Component {
|
|
|
39
50
|
* @param normalizedTimeOffset - The time offset between 0 and 1(default 0)
|
|
40
51
|
*/
|
|
41
52
|
crossFade(stateName: string, normalizedTransitionDuration: number, layerIndex?: number, normalizedTimeOffset?: number): void;
|
|
53
|
+
crossFade(transition: AnimatorStateTransition, layerIndex?: number): void;
|
|
42
54
|
/**
|
|
43
55
|
* Evaluates the animator component based on deltaTime.
|
|
44
56
|
* @param deltaTime - The deltaTime when the animation update
|
|
@@ -55,6 +67,21 @@ export declare class Animator extends Component {
|
|
|
55
67
|
* @param layerIndex - The layer index(default -1). If layer is -1, find the first state with the given state name
|
|
56
68
|
*/
|
|
57
69
|
findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
|
|
70
|
+
/**
|
|
71
|
+
* Get the layer by name.
|
|
72
|
+
* @param name - The layer's name.
|
|
73
|
+
*/
|
|
74
|
+
findLayerByName(name: string): AnimatorControllerLayer;
|
|
75
|
+
/**
|
|
76
|
+
* Get the parameter by name.
|
|
77
|
+
* @param name - The name of the parameter
|
|
78
|
+
*/
|
|
79
|
+
getParameter(name: string): AnimatorControllerParameter;
|
|
80
|
+
/**
|
|
81
|
+
* Set the value of the given parameter.
|
|
82
|
+
* @param name - The name of the parameter
|
|
83
|
+
*/
|
|
84
|
+
setParameter(name: string, value: AnimatorControllerParameterValue): void;
|
|
58
85
|
private _getAnimatorStateInfo;
|
|
59
86
|
private _getAnimatorStateData;
|
|
60
87
|
private _saveAnimatorStateData;
|
|
@@ -77,6 +104,8 @@ export declare class Animator extends Component {
|
|
|
77
104
|
private _checkTransition;
|
|
78
105
|
private _checkSubTransition;
|
|
79
106
|
private _checkBackwardsSubTransition;
|
|
107
|
+
_applyTransition(transition: AnimatorStateTransition, layerIndex: number): void;
|
|
108
|
+
private _checkConditions;
|
|
80
109
|
private _crossFadeByTransition;
|
|
81
110
|
private _fireAnimationEvents;
|
|
82
111
|
private _fireSubAnimationEvents;
|
|
@@ -84,6 +113,6 @@ export declare class Animator extends Component {
|
|
|
84
113
|
private _callAnimatorScriptOnEnter;
|
|
85
114
|
private _callAnimatorScriptOnUpdate;
|
|
86
115
|
private _callAnimatorScriptOnExit;
|
|
87
|
-
private
|
|
116
|
+
private _checkEntryState;
|
|
88
117
|
private _checkRevertOwner;
|
|
89
118
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
|
|
2
|
+
import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
|
|
3
|
+
/**
|
|
4
|
+
* Condition that is used to determine if a transition must be taken.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimatorCondition {
|
|
7
|
+
/** The mode of the condition. */
|
|
8
|
+
mode: AnimatorConditionMode;
|
|
9
|
+
/** The name of the parameter used in the condition. */
|
|
10
|
+
parameter: string;
|
|
11
|
+
/** The AnimatorParameter's threshold value for the condition to be true. */
|
|
12
|
+
threshold: AnimatorControllerParameterValue;
|
|
13
|
+
}
|
|
@@ -1,15 +1,34 @@
|
|
|
1
|
+
import { AnimatorControllerParameter, AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
|
|
1
2
|
import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
2
3
|
/**
|
|
3
4
|
* Store the data for Animator playback.
|
|
4
5
|
*/
|
|
5
6
|
export declare class AnimatorController {
|
|
6
7
|
private _updateFlagManager;
|
|
7
|
-
private _layers;
|
|
8
|
-
private _layersMap;
|
|
9
8
|
/**
|
|
10
9
|
* The layers in the controller.
|
|
11
10
|
*/
|
|
12
11
|
get layers(): Readonly<AnimatorControllerLayer[]>;
|
|
12
|
+
/**
|
|
13
|
+
* The parameters in the controller.
|
|
14
|
+
*/
|
|
15
|
+
get parameters(): Readonly<AnimatorControllerParameter[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Add a parameter to the controller.
|
|
18
|
+
* @param name - The name of the parameter
|
|
19
|
+
* @param defaultValue - The defaultValue of the parameter
|
|
20
|
+
*/
|
|
21
|
+
addParameter(name: string, defaultValue?: AnimatorControllerParameterValue): AnimatorControllerParameter;
|
|
22
|
+
/**
|
|
23
|
+
* Add a parameter to the controller.
|
|
24
|
+
* @param parameter - The parameter
|
|
25
|
+
*/
|
|
26
|
+
addParameter(parameter: AnimatorControllerParameter): AnimatorControllerParameter;
|
|
27
|
+
/**
|
|
28
|
+
* Remove a parameter from the controller.
|
|
29
|
+
* @param parameter - The parameter
|
|
30
|
+
*/
|
|
31
|
+
removeParameter(parameter: AnimatorControllerParameter): void;
|
|
13
32
|
/**
|
|
14
33
|
* Get the layer by name.
|
|
15
34
|
* @param name - The layer's name.
|