@galacean/engine-core 0.0.0-experimental-1.2-xr.0 → 0.0.0-experimental-1.3-xr.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +18595 -16071
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +18595 -16071
- package/dist/module.js +18591 -16072
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/sprite/SpriteMask.d.ts +11 -0
- package/types/2d/sprite/SpriteRenderer.d.ts +6 -3
- package/types/2d/text/TextRenderer.d.ts +10 -4
- package/types/Camera.d.ts +18 -7
- package/types/Engine.d.ts +3 -0
- package/types/Entity.d.ts +1 -4
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +11 -5
- package/types/RenderPipeline/PipelinePass.d.ts +1 -1
- package/types/RenderPipeline/RenderElement.d.ts +9 -6
- package/types/RenderPipeline/RenderQueue.d.ts +1 -30
- package/types/RenderPipeline/index.d.ts +1 -1
- package/types/Renderer.d.ts +4 -3
- package/types/Scene.d.ts +6 -0
- package/types/animation/Animator.d.ts +35 -6
- package/types/animation/AnimatorController.d.ts +32 -2
- package/types/animation/AnimatorState.d.ts +15 -5
- package/types/animation/AnimatorStateMachine.d.ts +44 -0
- package/types/animation/enums/AnimatorConditionMode.d.ts +9 -0
- package/types/animation/index.d.ts +1 -1
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/ResourceManager.d.ts +1 -3
- package/types/enums/ReplacementFailureStrategy.d.ts +9 -0
- package/types/graphic/SubMesh.d.ts +3 -16
- package/types/graphic/SubPrimitive.d.ts +10 -0
- package/types/graphic/index.d.ts +1 -0
- package/types/index.d.ts +4 -1
- package/types/material/BaseMaterial.d.ts +1 -1
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
- package/types/particle/ParticleGenerator.d.ts +20 -0
- package/types/particle/ParticleRenderer.d.ts +3 -1
- package/types/particle/modules/EmissionModule.d.ts +6 -2
- package/types/particle/modules/MainModule.d.ts +49 -15
- package/types/particle/modules/ParticleCompositeCurve.d.ts +35 -10
- package/types/particle/modules/ParticleCurve.d.ts +16 -9
- package/types/particle/modules/ParticleGeneratorModule.d.ts +6 -2
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +27 -8
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +29 -8
- package/types/particle/modules/shape/BaseShape.d.ts +14 -4
- package/types/particle/modules/shape/BoxShape.d.ts +7 -2
- package/types/particle/modules/shape/CircleShape.d.ts +25 -8
- package/types/particle/modules/shape/ConeShape.d.ts +24 -8
- package/types/particle/modules/shape/HemisphereShape.d.ts +6 -2
- package/types/particle/modules/shape/SphereShape.d.ts +6 -2
- package/types/postProcess/PostProcessManager.d.ts +1 -0
- package/types/postProcess/effects/BloomEffect.d.ts +94 -0
- package/types/postProcess/effects/TonemappingEffect.d.ts +35 -0
- package/types/postProcess/effects/index.d.ts +2 -0
- package/types/postProcess/index.d.ts +3 -0
- package/types/shader/ShaderPass.d.ts +10 -0
- package/types/shader/enums/ShaderDataGroup.d.ts +4 -2
- package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
- package/types/shader/enums/ShaderType.d.ts +1 -0
- package/types/shader/index.d.ts +1 -0
- package/types/shader/state/RenderState.d.ts +1 -0
- package/types/shaderlib/ShaderFactory.d.ts +2 -1
- package/types/texture/enums/TextureFormat.d.ts +2 -0
- package/types/utils/ClearableObjectPool.d.ts +6 -0
- package/types/utils/ObjectPool.d.ts +6 -0
- package/types/utils/ReturnableObjectPool.d.ts +6 -0
- package/types/utils/index.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "0.0.0-experimental-1.
|
|
3
|
+
"version": "0.0.0-experimental-1.3-xr.2",
|
|
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-1.
|
|
18
|
+
"@galacean/engine-math": "0.0.0-experimental-1.3-xr.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "0.0.0-experimental-1.
|
|
21
|
+
"@galacean/engine-design": "0.0.0-experimental-1.3-xr.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
1
3
|
import { Renderer } from "../../Renderer";
|
|
2
4
|
import { Sprite } from "./Sprite";
|
|
3
5
|
/**
|
|
@@ -52,6 +54,15 @@ export declare class SpriteMask extends Renderer {
|
|
|
52
54
|
*/
|
|
53
55
|
get alphaCutoff(): number;
|
|
54
56
|
set alphaCutoff(value: number);
|
|
57
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
58
|
+
/**
|
|
59
|
+
* @inheritdoc
|
|
60
|
+
*/
|
|
61
|
+
protected _render(context: RenderContext): void;
|
|
62
|
+
/**
|
|
63
|
+
* @inheritdoc
|
|
64
|
+
*/
|
|
65
|
+
protected _onDestroy(): void;
|
|
55
66
|
private _calDefaultSize;
|
|
56
67
|
private _onSpriteChange;
|
|
57
68
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
1
|
+
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
2
3
|
import { Renderer } from "../../Renderer";
|
|
3
4
|
import { SpriteDrawMode } from "../enums/SpriteDrawMode";
|
|
4
5
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
@@ -20,8 +21,6 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
20
21
|
private _customHeight;
|
|
21
22
|
private _flipX;
|
|
22
23
|
private _flipY;
|
|
23
|
-
private _maskLayer;
|
|
24
|
-
private _maskInteraction;
|
|
25
24
|
/**
|
|
26
25
|
* The draw mode of the sprite renderer.
|
|
27
26
|
*/
|
|
@@ -85,7 +84,11 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
85
84
|
*/
|
|
86
85
|
get maskInteraction(): SpriteMaskInteraction;
|
|
87
86
|
set maskInteraction(value: SpriteMaskInteraction);
|
|
87
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
88
|
+
protected _render(context: RenderContext): void;
|
|
89
|
+
protected _onDestroy(): void;
|
|
88
90
|
private _calDefaultSize;
|
|
89
91
|
private _updateStencilState;
|
|
90
92
|
private _onSpriteChange;
|
|
93
|
+
private _onColorChanged;
|
|
91
94
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../../Entity";
|
|
3
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
4
|
import { Renderer } from "../../Renderer";
|
|
4
5
|
import { FontStyle } from "../enums/FontStyle";
|
|
5
6
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
@@ -10,10 +11,11 @@ import { Font } from "./Font";
|
|
|
10
11
|
* Renders a text for 2D graphics.
|
|
11
12
|
*/
|
|
12
13
|
export declare class TextRenderer extends Renderer {
|
|
13
|
-
private static
|
|
14
|
+
private static _textureProperty;
|
|
14
15
|
private static _tempVec30;
|
|
15
16
|
private static _tempVec31;
|
|
16
|
-
|
|
17
|
+
private static _worldPositions;
|
|
18
|
+
private static _charRenderInfos;
|
|
17
19
|
private _color;
|
|
18
20
|
private _text;
|
|
19
21
|
private _width;
|
|
@@ -27,8 +29,6 @@ export declare class TextRenderer extends Renderer {
|
|
|
27
29
|
private _verticalAlignment;
|
|
28
30
|
private _enableWrapping;
|
|
29
31
|
private _overflowMode;
|
|
30
|
-
private _maskInteraction;
|
|
31
|
-
private _maskLayer;
|
|
32
32
|
/**
|
|
33
33
|
* Rendering color for the Text.
|
|
34
34
|
*/
|
|
@@ -104,9 +104,15 @@ export declare class TextRenderer extends Renderer {
|
|
|
104
104
|
*/
|
|
105
105
|
get bounds(): BoundingBox;
|
|
106
106
|
constructor(entity: Entity);
|
|
107
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
108
|
+
protected _render(context: RenderContext): void;
|
|
107
109
|
private _updateStencilState;
|
|
108
110
|
private _resetSubFont;
|
|
109
111
|
private _updatePosition;
|
|
112
|
+
private _updateColor;
|
|
110
113
|
private _updateLocalData;
|
|
111
114
|
private _isTextNoVisible;
|
|
115
|
+
private _buildChunk;
|
|
116
|
+
private _freeTextChunks;
|
|
117
|
+
private _onColorChanged;
|
|
112
118
|
}
|
package/types/Camera.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
|
5
5
|
import { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
6
6
|
import { Downsampling } from "./enums/Downsampling";
|
|
7
7
|
import { MSAASamples } from "./enums/MSAASamples";
|
|
8
|
+
import { ReplacementFailureStrategy } from "./enums/ReplacementFailureStrategy";
|
|
8
9
|
import { Shader } from "./shader/Shader";
|
|
9
10
|
import { ShaderData } from "./shader/ShaderData";
|
|
10
11
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
@@ -64,6 +65,8 @@ export declare class Camera extends Component {
|
|
|
64
65
|
private _renderTarget;
|
|
65
66
|
private _depthBufferParams;
|
|
66
67
|
private _opaqueTextureEnabled;
|
|
68
|
+
private _enableHDR;
|
|
69
|
+
private _enablePostProcess;
|
|
67
70
|
private _frustumChangeFlag;
|
|
68
71
|
private _transform;
|
|
69
72
|
private _isViewMatrixDirty;
|
|
@@ -77,7 +80,6 @@ export declare class Camera extends Component {
|
|
|
77
80
|
* If enabled, the opaque texture can be accessed in the shader using `camera_OpaqueTexture`.
|
|
78
81
|
*
|
|
79
82
|
* @defaultValue `false`
|
|
80
|
-
*
|
|
81
83
|
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
82
84
|
*/
|
|
83
85
|
get opaqueTextureEnabled(): boolean;
|
|
@@ -153,10 +155,18 @@ export declare class Camera extends Component {
|
|
|
153
155
|
set projectionMatrix(value: Matrix);
|
|
154
156
|
/**
|
|
155
157
|
* Whether to enable HDR.
|
|
156
|
-
* @
|
|
158
|
+
* @defaultValue `false`
|
|
159
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
157
160
|
*/
|
|
158
161
|
get enableHDR(): boolean;
|
|
159
162
|
set enableHDR(value: boolean);
|
|
163
|
+
/**
|
|
164
|
+
* Whether to enable post process.
|
|
165
|
+
* @defaultValue `false`
|
|
166
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
167
|
+
*/
|
|
168
|
+
get enablePostProcess(): boolean;
|
|
169
|
+
set enablePostProcess(value: boolean);
|
|
160
170
|
/**
|
|
161
171
|
* RenderTarget. After setting, it will be rendered to the renderTarget. If it is empty, it will be rendered to the main canvas.
|
|
162
172
|
*/
|
|
@@ -245,22 +255,24 @@ export declare class Camera extends Component {
|
|
|
245
255
|
* Set the replacement shader.
|
|
246
256
|
* @param shader - Replacement shader
|
|
247
257
|
* @param replacementTagName - Sub shader tag name
|
|
258
|
+
* @param failureStrategy - Replacement failure strategy, @defaultValue `ReplacementFailureStrategy.KeepOriginalShader`
|
|
248
259
|
*
|
|
249
260
|
* @remarks
|
|
250
261
|
* If replacementTagName is not specified, the first sub shader will be replaced.
|
|
251
|
-
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
262
|
+
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey. If failed to find the sub shader, the strategy will be determined by failureStrategy.
|
|
252
263
|
*/
|
|
253
|
-
setReplacementShader(shader: Shader, replacementTagName?: string): any;
|
|
264
|
+
setReplacementShader(shader: Shader, replacementTagName?: string, failureStrategy?: ReplacementFailureStrategy): any;
|
|
254
265
|
/**
|
|
255
266
|
* Set the replacement shader.
|
|
256
267
|
* @param shader - Replacement shader
|
|
257
268
|
* @param replacementTag - Sub shader tag
|
|
269
|
+
* @param failureStrategy - Replacement failure strategy, @defaultValue `ReplacementFailureStrategy.KeepOriginalShader`
|
|
258
270
|
*
|
|
259
271
|
* @remarks
|
|
260
272
|
* If replacementTag is not specified, the first sub shader will be replaced.
|
|
261
|
-
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
273
|
+
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey. If failed to find the sub shader, the strategy will be determined by failureStrategy.
|
|
262
274
|
*/
|
|
263
|
-
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey): any;
|
|
275
|
+
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey, failureStrategy?: ReplacementFailureStrategy): any;
|
|
264
276
|
/**
|
|
265
277
|
* Reset and clear the replacement shader.
|
|
266
278
|
*/
|
|
@@ -286,7 +298,6 @@ export declare class Camera extends Component {
|
|
|
286
298
|
* The inverse of the projection matrix.
|
|
287
299
|
*/
|
|
288
300
|
private _getInverseProjectionMatrix;
|
|
289
|
-
private _forceUseInternalCanvas;
|
|
290
301
|
private _onPixelViewportChanged;
|
|
291
302
|
private _checkMainCanvasAntialiasWaste;
|
|
292
303
|
}
|
package/types/Engine.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ResourceManager } from "./asset/ResourceManager";
|
|
|
7
7
|
import { EventDispatcher, Time } from "./base";
|
|
8
8
|
import { ColorSpace } from "./enums/ColorSpace";
|
|
9
9
|
import { InputManager } from "./input";
|
|
10
|
+
import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
|
|
10
11
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
11
12
|
import { XRManager } from "./xr/XRManager";
|
|
12
13
|
/**
|
|
@@ -17,6 +18,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
17
18
|
readonly inputManager: InputManager;
|
|
18
19
|
/** XR manager of Engine. */
|
|
19
20
|
readonly xrManager: XRManager;
|
|
21
|
+
_particleBufferUtils: ParticleBufferUtils;
|
|
20
22
|
private _settings;
|
|
21
23
|
private _resourceManager;
|
|
22
24
|
private _sceneManager;
|
|
@@ -117,6 +119,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
117
119
|
destroy(): void;
|
|
118
120
|
private _createSpriteMaterial;
|
|
119
121
|
private _createSpriteMaskMaterial;
|
|
122
|
+
private _createTextMaterial;
|
|
120
123
|
private _onDeviceLost;
|
|
121
124
|
private _onDeviceRestored;
|
|
122
125
|
private _gc;
|
package/types/Entity.d.ts
CHANGED
|
@@ -58,10 +58,9 @@ export declare class Entity extends EngineObject {
|
|
|
58
58
|
/**
|
|
59
59
|
* Add component based on the component type.
|
|
60
60
|
* @param type - The type of the component
|
|
61
|
-
* @param args - The arguments of the component
|
|
62
61
|
* @returns The component which has been added
|
|
63
62
|
*/
|
|
64
|
-
addComponent<T extends new (entity: Entity
|
|
63
|
+
addComponent<T extends Component>(type: new (entity: Entity) => T): T;
|
|
65
64
|
/**
|
|
66
65
|
* Get component which match the type.
|
|
67
66
|
* @param type - The type of the component
|
|
@@ -153,5 +152,3 @@ export declare class Entity extends EngineObject {
|
|
|
153
152
|
*/
|
|
154
153
|
getInvModelMatrix(): Matrix;
|
|
155
154
|
}
|
|
156
|
-
type ComponentArguments<T extends new (entity: Entity, ...args: any[]) => Component> = T extends new (entity: Entity, ...args: infer P) => Component ? P : never;
|
|
157
|
-
export {};
|
|
@@ -2,7 +2,7 @@ import { Camera } from "../Camera";
|
|
|
2
2
|
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
3
3
|
import { TextureCubeFace } from "../texture";
|
|
4
4
|
import { RenderContext } from "./RenderContext";
|
|
5
|
-
import {
|
|
5
|
+
import { RenderElement } from "./RenderElement";
|
|
6
6
|
/**
|
|
7
7
|
* Basic render pipeline.
|
|
8
8
|
*/
|
|
@@ -34,11 +34,17 @@ export declare class BasicRenderPipeline {
|
|
|
34
34
|
/**
|
|
35
35
|
* Push render data to render queue.
|
|
36
36
|
* @param context - Render context
|
|
37
|
-
* @param
|
|
37
|
+
* @param renderElement - Render element
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
private
|
|
39
|
+
pushRenderElement(context: RenderContext, renderElement: RenderElement): void;
|
|
40
|
+
private pushRenderElementByType;
|
|
41
41
|
private _drawBackgroundTexture;
|
|
42
42
|
private _prepareRender;
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
export declare enum RenderQueueFlags {
|
|
45
|
+
None = 0,
|
|
46
|
+
Opaque = 1,
|
|
47
|
+
AlphaTest = 2,
|
|
48
|
+
Transparent = 4,
|
|
49
|
+
All = 7
|
|
44
50
|
}
|
|
@@ -5,7 +5,7 @@ import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
|
5
5
|
* PipelinePass is a base class for all pipeline passes.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class PipelinePass {
|
|
8
|
-
|
|
8
|
+
readonly engine: Engine;
|
|
9
9
|
constructor(engine: Engine);
|
|
10
10
|
/**
|
|
11
11
|
* Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { IPoolElement } from "../utils/ObjectPool";
|
|
2
|
+
import { RenderQueueFlags } from "./BasicRenderPipeline";
|
|
3
|
+
import { SubRenderElement } from "./SubRenderElement";
|
|
4
4
|
export declare class RenderElement implements IPoolElement {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
priority: number;
|
|
6
|
+
distanceForSort: number;
|
|
7
|
+
subRenderElements: SubRenderElement[];
|
|
8
|
+
renderQueueFlags: RenderQueueFlags;
|
|
9
|
+
set(priority: number, distanceForSort: number): void;
|
|
10
|
+
addSubRenderElement(element: SubRenderElement): void;
|
|
8
11
|
dispose(): void;
|
|
9
12
|
}
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Engine } from "../Engine";
|
|
3
|
-
import { RenderQueueType } from "../shader";
|
|
4
|
-
import { RenderElement } from "./RenderElement";
|
|
5
|
-
/**
|
|
6
|
-
* Render queue.
|
|
7
|
-
*/
|
|
8
|
-
export declare class RenderQueue {
|
|
9
|
-
readonly elements: RenderElement[];
|
|
10
|
-
private _spriteBatcher;
|
|
11
|
-
private readonly _renderQueueType;
|
|
12
|
-
constructor(engine: Engine, renderQueueType: RenderQueueType);
|
|
13
|
-
/**
|
|
14
|
-
* Push a render element.
|
|
15
|
-
*/
|
|
16
|
-
pushRenderElement(element: RenderElement): void;
|
|
17
|
-
render(camera: Camera, pipelineStageTagValue: string): void;
|
|
18
|
-
/**
|
|
19
|
-
* Clear collection.
|
|
20
|
-
*/
|
|
21
|
-
clear(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Destroy internal resources.
|
|
24
|
-
*/
|
|
25
|
-
destroy(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Sort the elements.
|
|
28
|
-
*/
|
|
29
|
-
sort(compareFunc: Function): void;
|
|
30
|
-
}
|
|
1
|
+
export {};
|
package/types/Renderer.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
22
22
|
protected _overrideUpdate: boolean;
|
|
23
23
|
protected _materials: Material[];
|
|
24
24
|
protected _dirtyUpdateFlag: number;
|
|
25
|
+
protected _rendererLayer: Vector4;
|
|
25
26
|
private _shaderData;
|
|
26
27
|
private _mvMatrix;
|
|
27
28
|
private _mvpMatrix;
|
|
@@ -30,7 +31,6 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
30
31
|
private _materialsInstanced;
|
|
31
32
|
private _priority;
|
|
32
33
|
private _receiveShadows;
|
|
33
|
-
protected _rendererLayer: Vector4;
|
|
34
34
|
/**
|
|
35
35
|
* ShaderData related to renderer.
|
|
36
36
|
*/
|
|
@@ -111,7 +111,8 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
111
111
|
*/
|
|
112
112
|
setMaterials(materials: Material[]): void;
|
|
113
113
|
update(deltaTime: number): void;
|
|
114
|
-
protected
|
|
115
|
-
protected
|
|
114
|
+
protected _updateRendererShaderData(context: RenderContext): void;
|
|
115
|
+
protected _updateWorldViewRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
|
|
116
|
+
protected _updateProjectionRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
|
|
116
117
|
private _setMaterial;
|
|
117
118
|
}
|
package/types/Scene.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare class Scene extends EngineObject {
|
|
|
47
47
|
private _fogParams;
|
|
48
48
|
private _isActive;
|
|
49
49
|
private _sun;
|
|
50
|
+
private _enableTransparentShadow;
|
|
50
51
|
/**
|
|
51
52
|
* Whether the scene is active.
|
|
52
53
|
*/
|
|
@@ -114,6 +115,11 @@ export declare class Scene extends EngineObject {
|
|
|
114
115
|
*/
|
|
115
116
|
get sun(): DirectLight | null;
|
|
116
117
|
set sun(light: DirectLight | null);
|
|
118
|
+
/**
|
|
119
|
+
* Whether to enable transparent shadow.
|
|
120
|
+
*/
|
|
121
|
+
get enableTransparentShadow(): boolean;
|
|
122
|
+
set enableTransparentShadow(value: boolean);
|
|
117
123
|
/**
|
|
118
124
|
* Create scene.
|
|
119
125
|
* @param engine - Engine
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BoolUpdateFlag } from "../BoolUpdateFlag";
|
|
2
2
|
import { Component } from "../Component";
|
|
3
3
|
import { AnimatorController } from "./AnimatorController";
|
|
4
|
+
import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
5
|
+
import { AnimatorControllerParameter } from "./AnimatorControllerParameter";
|
|
4
6
|
import { AnimatorState } from "./AnimatorState";
|
|
5
7
|
import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
|
|
6
8
|
/**
|
|
@@ -24,6 +26,14 @@ export declare class Animator extends Component {
|
|
|
24
26
|
*/
|
|
25
27
|
get animatorController(): AnimatorController;
|
|
26
28
|
set animatorController(animatorController: AnimatorController);
|
|
29
|
+
/**
|
|
30
|
+
* The layers in the animator's controller.
|
|
31
|
+
*/
|
|
32
|
+
get layers(): Readonly<AnimatorControllerLayer[]>;
|
|
33
|
+
/**
|
|
34
|
+
* The parameters in the animator's controller.
|
|
35
|
+
*/
|
|
36
|
+
get parameters(): Readonly<AnimatorControllerParameter[]>;
|
|
27
37
|
/**
|
|
28
38
|
* Play a state by name.
|
|
29
39
|
* @param stateName - The state name
|
|
@@ -55,6 +65,16 @@ export declare class Animator extends Component {
|
|
|
55
65
|
* @param layerIndex - The layer index(default -1). If layer is -1, find the first state with the given state name
|
|
56
66
|
*/
|
|
57
67
|
findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
|
|
68
|
+
/**
|
|
69
|
+
* Get the layer by name.
|
|
70
|
+
* @param name - The layer's name.
|
|
71
|
+
*/
|
|
72
|
+
findLayerByName(name: string): AnimatorControllerLayer;
|
|
73
|
+
/**
|
|
74
|
+
* Get the parameter by name from animatorController.
|
|
75
|
+
* @param name - The name of the parameter
|
|
76
|
+
*/
|
|
77
|
+
getParameter(name: string): AnimatorControllerParameter;
|
|
58
78
|
private _getAnimatorStateInfo;
|
|
59
79
|
private _getAnimatorStateData;
|
|
60
80
|
private _saveAnimatorStateData;
|
|
@@ -68,22 +88,31 @@ export declare class Animator extends Component {
|
|
|
68
88
|
private _prepareDestCrossData;
|
|
69
89
|
private _getAnimatorLayerData;
|
|
70
90
|
private _updateLayer;
|
|
91
|
+
private _updateState;
|
|
71
92
|
private _updatePlayingState;
|
|
72
|
-
private
|
|
73
|
-
private
|
|
93
|
+
private _evaluatePlayingState;
|
|
94
|
+
private _updateCrossFadeState;
|
|
95
|
+
private _evaluateCrossFadeState;
|
|
96
|
+
private _updateCrossFadeFromPoseState;
|
|
97
|
+
private _evaluateCrossFadeFromPoseState;
|
|
74
98
|
private _updateFinishedState;
|
|
99
|
+
private _evaluateFinishedState;
|
|
75
100
|
private _updateCrossFadeData;
|
|
76
|
-
private
|
|
77
|
-
private
|
|
101
|
+
private _preparePlayOwner;
|
|
102
|
+
private _applyStateTransitions;
|
|
78
103
|
private _checkSubTransition;
|
|
79
104
|
private _checkBackwardsSubTransition;
|
|
80
|
-
private
|
|
105
|
+
private _applyTransitionsByCondition;
|
|
106
|
+
private _preparePlay;
|
|
107
|
+
private _applyTransition;
|
|
108
|
+
private _checkConditions;
|
|
109
|
+
private _prepareCrossFadeByTransition;
|
|
81
110
|
private _fireAnimationEvents;
|
|
82
111
|
private _fireSubAnimationEvents;
|
|
83
112
|
private _fireBackwardSubAnimationEvents;
|
|
84
113
|
private _callAnimatorScriptOnEnter;
|
|
85
114
|
private _callAnimatorScriptOnUpdate;
|
|
86
115
|
private _callAnimatorScriptOnExit;
|
|
87
|
-
private
|
|
116
|
+
private _checkAnyAndEntryState;
|
|
88
117
|
private _checkRevertOwner;
|
|
89
118
|
}
|
|
@@ -1,15 +1,45 @@
|
|
|
1
|
+
import { AnimatorControllerParameter, AnimatorControllerParameterValueType } 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 value - The value of the parameter
|
|
20
|
+
*/
|
|
21
|
+
addParameter(name: string, value?: AnimatorControllerParameterValueType): 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;
|
|
32
|
+
/**
|
|
33
|
+
* Get the parameter by name.
|
|
34
|
+
* @param name - The name of the parameter
|
|
35
|
+
*/
|
|
36
|
+
getParameter(name: string): AnimatorControllerParameter;
|
|
37
|
+
/**
|
|
38
|
+
* Set the value of the given parameter.
|
|
39
|
+
* @param name - The name of the parameter
|
|
40
|
+
* @param value - The value of the parameter
|
|
41
|
+
*/
|
|
42
|
+
setParameterValue(name: string, value: AnimatorControllerParameterValueType): void;
|
|
13
43
|
/**
|
|
14
44
|
* Get the layer by name.
|
|
15
45
|
* @param name - The layer's name.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimationClip } from "./AnimationClip";
|
|
2
|
-
import { AnimatorStateTransition } from "./
|
|
2
|
+
import { AnimatorStateTransition } from "./AnimatorStateTransition";
|
|
3
3
|
import { WrapMode } from "./enums/WrapMode";
|
|
4
4
|
import { StateMachineScript } from "./StateMachineScript";
|
|
5
5
|
/**
|
|
@@ -25,12 +25,12 @@ export declare class AnimatorState {
|
|
|
25
25
|
get clip(): AnimationClip;
|
|
26
26
|
set clip(clip: AnimationClip);
|
|
27
27
|
/**
|
|
28
|
-
* The start time of the clip, the range is 0 to 1, default is 0.
|
|
28
|
+
* The normalized start time of the clip, the range is 0 to 1, default is 0.
|
|
29
29
|
*/
|
|
30
30
|
get clipStartTime(): number;
|
|
31
31
|
set clipStartTime(time: number);
|
|
32
32
|
/**
|
|
33
|
-
* The end time of the clip, the range is 0 to 1, default is 1.
|
|
33
|
+
* The normalized end time of the clip, the range is 0 to 1, default is 1.
|
|
34
34
|
*/
|
|
35
35
|
get clipEndTime(): number;
|
|
36
36
|
set clipEndTime(time: number);
|
|
@@ -39,10 +39,20 @@ export declare class AnimatorState {
|
|
|
39
39
|
*/
|
|
40
40
|
constructor(name: string);
|
|
41
41
|
/**
|
|
42
|
-
* Add an outgoing transition
|
|
42
|
+
* Add an outgoing transition.
|
|
43
43
|
* @param transition - The transition
|
|
44
44
|
*/
|
|
45
|
-
addTransition(transition: AnimatorStateTransition):
|
|
45
|
+
addTransition(transition: AnimatorStateTransition): AnimatorStateTransition;
|
|
46
|
+
/**
|
|
47
|
+
* Add an outgoing transition to the destination state.
|
|
48
|
+
* @param animatorState - The destination state
|
|
49
|
+
*/
|
|
50
|
+
addTransition(animatorState: AnimatorState): AnimatorStateTransition;
|
|
51
|
+
/**
|
|
52
|
+
* Add an outgoing transition to exit of the stateMachine.
|
|
53
|
+
* @param exitTime - The time at which the transition can take effect. This is represented in normalized time.
|
|
54
|
+
*/
|
|
55
|
+
addExitTransition(exitTime?: number): AnimatorStateTransition;
|
|
46
56
|
/**
|
|
47
57
|
* Remove a transition from the state.
|
|
48
58
|
* @param transition - The transition
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnimatorState } from "./AnimatorState";
|
|
2
|
+
import { AnimatorStateTransition } from "./AnimatorStateTransition";
|
|
2
3
|
export interface AnimatorStateMap {
|
|
3
4
|
[key: string]: AnimatorState;
|
|
4
5
|
}
|
|
@@ -13,6 +14,17 @@ export declare class AnimatorStateMachine {
|
|
|
13
14
|
* @remarks When the Animator's AnimatorController changed or the Animator's onEnable be triggered.
|
|
14
15
|
*/
|
|
15
16
|
defaultState: AnimatorState;
|
|
17
|
+
private _entryTransitions;
|
|
18
|
+
private _anyStateTransitions;
|
|
19
|
+
private _statesMap;
|
|
20
|
+
/**
|
|
21
|
+
* The list of entry transitions in the state machine.
|
|
22
|
+
*/
|
|
23
|
+
get entryTransitions(): Readonly<AnimatorStateTransition[]>;
|
|
24
|
+
/**
|
|
25
|
+
* The list of AnyState transitions.
|
|
26
|
+
*/
|
|
27
|
+
get anyStateTransitions(): Readonly<AnimatorStateTransition[]>;
|
|
16
28
|
/**
|
|
17
29
|
* Add a state to the state machine.
|
|
18
30
|
* @param name - The name of the new state
|
|
@@ -34,4 +46,36 @@ export declare class AnimatorStateMachine {
|
|
|
34
46
|
* @returns Unique name.
|
|
35
47
|
*/
|
|
36
48
|
makeUniqueStateName(name: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Add an entry transition.
|
|
51
|
+
* @param transition - The transition
|
|
52
|
+
*/
|
|
53
|
+
addEntryStateTransition(transition: AnimatorStateTransition): AnimatorStateTransition;
|
|
54
|
+
/**
|
|
55
|
+
* Add an entry transition to the destination state.
|
|
56
|
+
* @param animatorState - The destination state
|
|
57
|
+
*/
|
|
58
|
+
addEntryStateTransition(animatorState: AnimatorState): AnimatorStateTransition;
|
|
59
|
+
/**
|
|
60
|
+
* Remove an entry transition.
|
|
61
|
+
* @param transition - The transition
|
|
62
|
+
*/
|
|
63
|
+
removeEntryStateTransition(transition: AnimatorStateTransition): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add an any transition.
|
|
66
|
+
* @param transition - The transition
|
|
67
|
+
*/
|
|
68
|
+
addAnyStateTransition(transition: AnimatorStateTransition): AnimatorStateTransition;
|
|
69
|
+
/**
|
|
70
|
+
* Add an any transition to the destination state.
|
|
71
|
+
* @param animatorState - The destination state
|
|
72
|
+
*/
|
|
73
|
+
addAnyStateTransition(animatorState: AnimatorState): AnimatorStateTransition;
|
|
74
|
+
/**
|
|
75
|
+
* Remove an any transition.
|
|
76
|
+
* @param transition - The transition
|
|
77
|
+
*/
|
|
78
|
+
removeAnyStateTransition(transition: AnimatorStateTransition): void;
|
|
79
|
+
private _addTransition;
|
|
80
|
+
private _removeTransition;
|
|
37
81
|
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mode of the animator condition.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum AnimatorConditionMode {
|
|
5
|
+
/** The condition is true when the parameter value is true. */
|
|
2
6
|
If = 0,
|
|
7
|
+
/** The condition is true when the parameter value is false. */
|
|
3
8
|
IfNot = 1,
|
|
9
|
+
/** The condition is true when the parameter value is greater than the threshold. */
|
|
4
10
|
Greater = 2,
|
|
11
|
+
/** The condition is true when the parameter value is less than the threshold. */
|
|
5
12
|
Less = 3,
|
|
13
|
+
/** The condition is true when the parameter value is equal to the threshold. */
|
|
6
14
|
Equals = 4,
|
|
15
|
+
/** The condition is true when the parameter value is not equal to the threshold. */
|
|
7
16
|
NotEquals = 5
|
|
8
17
|
}
|
|
@@ -11,7 +11,7 @@ export { AnimatorController } from "./AnimatorController";
|
|
|
11
11
|
export { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
12
12
|
export { AnimatorState } from "./AnimatorState";
|
|
13
13
|
export { AnimatorStateMachine } from "./AnimatorStateMachine";
|
|
14
|
-
export { AnimatorStateTransition } from "./
|
|
14
|
+
export { AnimatorStateTransition } from "./AnimatorStateTransition";
|
|
15
15
|
export { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
|
|
16
16
|
export { AnimatorLayerBlendingMode } from "./enums/AnimatorLayerBlendingMode";
|
|
17
17
|
export { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
|