@galacean/engine-core 0.0.0-experimental-double11.4 → 0.0.0-experimental-double11.6
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 +15500 -12197
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +15500 -12197
- package/dist/module.js +16092 -12812
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Background.d.ts +8 -0
- package/types/Camera.d.ts +32 -8
- package/types/Component.d.ts +1 -0
- package/types/ComponentsManager.d.ts +0 -2
- package/types/DisorderedArray.d.ts +8 -1
- package/types/Engine.d.ts +9 -4
- package/types/Entity.d.ts +2 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +2 -3
- package/types/RenderPipeline/RenderData.d.ts +8 -1
- package/types/RenderPipeline/RenderElement.d.ts +2 -4
- package/types/RenderPipeline/RenderQueue.d.ts +4 -2
- package/types/RenderPipeline/enums/PipelineStage.d.ts +2 -0
- package/types/Renderer.d.ts +2 -2
- package/types/Scene.d.ts +9 -4
- package/types/SceneManager.d.ts +28 -5
- package/types/Script.d.ts +0 -1
- package/types/animation/Keyframe.d.ts +4 -3
- package/types/animation/animationCurve/index.d.ts +2 -0
- package/types/animation/index.d.ts +4 -0
- package/types/asset/AssetType.d.ts +5 -1
- package/types/asset/GraphicsResource.d.ts +4 -0
- package/types/asset/Loader.d.ts +3 -1
- package/types/asset/ResourceManager.d.ts +8 -2
- package/types/base/Constant.d.ts +1 -0
- package/types/clone/ComponentCloner.d.ts +4 -1
- package/types/graphic/Buffer.d.ts +22 -6
- package/types/graphic/BufferUtil.d.ts +1 -0
- package/types/graphic/Mesh.d.ts +2 -3
- package/types/graphic/VertexElement.d.ts +10 -6
- package/types/graphic/index.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/input/InputManager.d.ts +2 -2
- package/types/lighting/DirectLight.d.ts +8 -1
- package/types/lighting/Light.d.ts +0 -4
- package/types/lighting/LightManager.d.ts +7 -0
- package/types/lighting/PointLight.d.ts +9 -1
- package/types/lighting/SpotLight.d.ts +12 -1
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/ModelMesh.d.ts +70 -42
- package/types/mesh/PrimitiveMesh.d.ts +4 -2
- package/types/mesh/Skin.d.ts +3 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +20 -11
- package/types/mesh/index.d.ts +6 -5
- package/types/particle/ParticleGenerator.d.ts +0 -2
- package/types/particle/ParticleRenderer.d.ts +41 -231
- package/types/particle/index.d.ts +22 -1
- package/types/particle/modules/MainModule.d.ts +7 -5
- package/types/particle/modules/ParticleGeneratorModule.d.ts +0 -1
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +1 -1
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +0 -4
- package/types/physics/Collider.d.ts +1 -0
- package/types/physics/index.d.ts +7 -7
- package/types/physics/joint/HingeJoint.d.ts +1 -1
- package/types/physics/joint/Joint.d.ts +4 -2
- package/types/physics/joint/SpringJoint.d.ts +1 -2
- package/types/physics/shape/BoxColliderShape.d.ts +0 -2
- package/types/physics/shape/CapsuleColliderShape.d.ts +0 -2
- package/types/physics/shape/ColliderShape.d.ts +2 -4
- package/types/physics/shape/PlaneColliderShape.d.ts +0 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -2
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +0 -1
- package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +1 -1
- package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +1 -1
- package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +1 -1
- package/types/shader/Shader.d.ts +22 -0
- package/types/shader/ShaderPart.d.ts +5 -0
- package/types/shader/ShaderPass.d.ts +8 -0
- package/types/shader/SubShader.d.ts +0 -1
- package/types/shader/index.d.ts +1 -0
- package/types/shaderlib/ShaderFactory.d.ts +2 -7
- package/types/shaderlib/ShaderLib.d.ts +11 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -6
- package/types/texture/RenderTarget.d.ts +1 -2
- package/types/texture/Texture2D.d.ts +1 -1
- package/types/texture/Texture2DArray.d.ts +1 -1
- package/types/texture/TextureCube.d.ts +1 -1
- package/types/texture/enums/TextureFormat.d.ts +55 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "0.0.0-experimental-double11.
|
|
3
|
+
"version": "0.0.0-experimental-double11.6",
|
|
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-double11.
|
|
18
|
+
"@galacean/engine-math": "0.0.0-experimental-double11.6"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "0.0.0-experimental-double11.
|
|
21
|
+
"@galacean/engine-design": "0.0.0-experimental-double11.6"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/Background.d.ts
CHANGED
|
@@ -33,11 +33,19 @@ export declare class Background {
|
|
|
33
33
|
*/
|
|
34
34
|
get texture(): Texture2D;
|
|
35
35
|
set texture(value: Texture2D);
|
|
36
|
+
/**
|
|
37
|
+
* Background texture fill mode.
|
|
38
|
+
* @remarks When `mode` is `BackgroundMode.Texture`, the property will take effects.
|
|
39
|
+
* @defaultValue `BackgroundTextureFillMode.FitHeight`
|
|
40
|
+
*/
|
|
41
|
+
get textureFillMode(): BackgroundTextureFillMode;
|
|
36
42
|
set textureFillMode(value: BackgroundTextureFillMode);
|
|
37
43
|
/**
|
|
38
44
|
* Constructor of Background.
|
|
39
45
|
* @param _engine Engine Which the background belongs to.
|
|
40
46
|
*/
|
|
41
47
|
constructor(_engine: Engine);
|
|
48
|
+
private _initMesh;
|
|
49
|
+
private _initMaterial;
|
|
42
50
|
private _createPlane;
|
|
43
51
|
}
|
package/types/Camera.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { Matrix, Ray, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
1
|
+
import { Matrix, Ray, Rect, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
-
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
4
3
|
import { Layer } from "./Layer";
|
|
4
|
+
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
5
|
+
import { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
5
6
|
import { Shader } from "./shader/Shader";
|
|
6
7
|
import { ShaderData } from "./shader/ShaderData";
|
|
7
8
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
8
|
-
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
9
9
|
import { RenderTarget } from "./texture/RenderTarget";
|
|
10
|
+
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
10
11
|
/**
|
|
11
12
|
* Camera component, as the entrance to the three-dimensional world.
|
|
12
13
|
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
13
14
|
*/
|
|
14
15
|
export declare class Camera extends Component {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
private static _inverseViewMatrixProperty;
|
|
17
|
+
private static _cameraPositionProperty;
|
|
18
|
+
private static _cameraForwardProperty;
|
|
19
|
+
private static _cameraUpProperty;
|
|
20
|
+
private static _cameraDepthBufferParamsProperty;
|
|
17
21
|
/** Whether to enable frustum culling, it is enabled by default. */
|
|
18
22
|
enableFrustumCulling: boolean;
|
|
19
23
|
/**
|
|
@@ -26,6 +30,12 @@ export declare class Camera extends Component {
|
|
|
26
30
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
27
31
|
*/
|
|
28
32
|
cullingMask: Layer;
|
|
33
|
+
/**
|
|
34
|
+
* Depth texture mode.
|
|
35
|
+
* @defaultValue `DepthTextureMode.None`
|
|
36
|
+
*/
|
|
37
|
+
depthTextureMode: DepthTextureMode;
|
|
38
|
+
private _priority;
|
|
29
39
|
private _shaderData;
|
|
30
40
|
private _isProjMatSetting;
|
|
31
41
|
private _nearClipPlane;
|
|
@@ -37,11 +47,13 @@ export declare class Camera extends Component {
|
|
|
37
47
|
private _isFrustumProjectDirty;
|
|
38
48
|
private _customAspectRatio;
|
|
39
49
|
private _renderTarget;
|
|
50
|
+
private _depthBufferParams;
|
|
40
51
|
private _frustumViewChangeFlag;
|
|
41
52
|
private _transform;
|
|
42
53
|
private _isViewMatrixDirty;
|
|
43
54
|
private _isInvViewProjDirty;
|
|
44
55
|
private _viewport;
|
|
56
|
+
private _pixelViewport;
|
|
45
57
|
private _inverseProjectionMatrix;
|
|
46
58
|
private _lastAspectSize;
|
|
47
59
|
private _invViewProjMat;
|
|
@@ -71,11 +83,22 @@ export declare class Camera extends Component {
|
|
|
71
83
|
get aspectRatio(): number;
|
|
72
84
|
set aspectRatio(value: number);
|
|
73
85
|
/**
|
|
74
|
-
*
|
|
86
|
+
* The viewport of the camera in normalized coordinates on the screen.
|
|
87
|
+
* In normalized screen coordinates, the upper-left corner is (0, 0), and the lower-right corner is (1.0, 1.0).
|
|
75
88
|
* @remarks Re-assignment is required after modification to ensure that the modification takes effect.
|
|
76
89
|
*/
|
|
77
90
|
get viewport(): Vector4;
|
|
78
91
|
set viewport(value: Vector4);
|
|
92
|
+
/**
|
|
93
|
+
* The viewport of the camera in pixel coordinates on the screen.
|
|
94
|
+
* In pixel screen coordinates, the upper-left corner is (0, 0), and the lower-right corner is (1.0, 1.0).
|
|
95
|
+
*/
|
|
96
|
+
get pixelViewport(): Rect;
|
|
97
|
+
/**
|
|
98
|
+
* Rendering priority, higher priority will be rendered on top of a camera with lower priority.
|
|
99
|
+
*/
|
|
100
|
+
get priority(): number;
|
|
101
|
+
set priority(value: number);
|
|
79
102
|
/**
|
|
80
103
|
* Whether it is orthogonal, the default is false. True will use orthographic projection, false will use perspective projection.
|
|
81
104
|
*/
|
|
@@ -209,11 +232,12 @@ export declare class Camera extends Component {
|
|
|
209
232
|
/**
|
|
210
233
|
* @inheritdoc
|
|
211
234
|
*/
|
|
212
|
-
|
|
235
|
+
_onEnableInScene(): void;
|
|
213
236
|
/**
|
|
214
237
|
* @inheritdoc
|
|
215
238
|
*/
|
|
216
|
-
|
|
239
|
+
_onDisableInScene(): void;
|
|
240
|
+
private _updatePixelViewport;
|
|
217
241
|
private _projMatChange;
|
|
218
242
|
private _innerViewportToWorldPoint;
|
|
219
243
|
private _updateShaderData;
|
package/types/Component.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare class ComponentsManager {
|
|
|
11
11
|
private _onUpdateScripts;
|
|
12
12
|
private _onLateUpdateScripts;
|
|
13
13
|
private _onPhysicsUpdateScripts;
|
|
14
|
-
private _disableScripts;
|
|
15
14
|
private _pendingDestroyScripts;
|
|
16
15
|
private _disposeDestroyScripts;
|
|
17
16
|
private _onUpdateAnimations;
|
|
@@ -31,7 +30,6 @@ export declare class ComponentsManager {
|
|
|
31
30
|
removeOnUpdateAnimations(animation: Animator): void;
|
|
32
31
|
addOnUpdateRenderers(renderer: Renderer): void;
|
|
33
32
|
removeOnUpdateRenderers(renderer: Renderer): void;
|
|
34
|
-
addDisableScript(component: Script): void;
|
|
35
33
|
addPendingDestroyScript(component: Script): void;
|
|
36
34
|
callScriptOnStart(): void;
|
|
37
35
|
callScriptOnUpdate(deltaTime: number): void;
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.
|
|
3
3
|
*/
|
|
4
4
|
export declare class DisorderedArray<T> {
|
|
5
|
-
_elements: T[];
|
|
6
5
|
length: number;
|
|
6
|
+
_elements: T[];
|
|
7
|
+
private _isLooping;
|
|
8
|
+
private _blankCount;
|
|
7
9
|
constructor(count?: number);
|
|
8
10
|
add(element: T): void;
|
|
9
11
|
delete(element: T): void;
|
|
@@ -15,5 +17,10 @@ export declare class DisorderedArray<T> {
|
|
|
15
17
|
* @returns The replaced item is used to reset its index
|
|
16
18
|
*/
|
|
17
19
|
deleteByIndex(index: number): T;
|
|
20
|
+
forEach(callbackFn: (element: T) => void, swapFn: (element: T, index: number) => void): void;
|
|
21
|
+
forEachAndClean(callbackFn: (e: T) => void): void;
|
|
18
22
|
garbageCollection(): void;
|
|
23
|
+
private _startLoop;
|
|
24
|
+
private _endLoop;
|
|
25
|
+
private _endLoopAndClear;
|
|
19
26
|
}
|
package/types/Engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPhysics } from "@galacean/engine-design";
|
|
1
|
+
import { IPhysics, IShaderLab } from "@galacean/engine-design";
|
|
2
2
|
import { Canvas } from "./Canvas";
|
|
3
3
|
import { EngineSettings } from "./EngineSettings";
|
|
4
4
|
import { Entity } from "./Entity";
|
|
@@ -7,14 +7,12 @@ 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 {
|
|
10
|
+
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
11
11
|
import { IHardwareRenderer } from "./renderingHardwareInterface";
|
|
12
12
|
/**
|
|
13
13
|
* Engine.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Engine extends EventDispatcher {
|
|
16
|
-
/** Physics manager of Engine. */
|
|
17
|
-
readonly physicsManager: PhysicsManager;
|
|
18
16
|
/** Input manager of Engine. */
|
|
19
17
|
readonly inputManager: InputManager;
|
|
20
18
|
private _settings;
|
|
@@ -120,6 +118,11 @@ export declare class Engine extends EventDispatcher {
|
|
|
120
118
|
private _onDeviceLost;
|
|
121
119
|
private _onDeviceRestored;
|
|
122
120
|
private _gc;
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated
|
|
123
|
+
* The first scene physics manager.
|
|
124
|
+
*/
|
|
125
|
+
get physicsManager(): PhysicsScene;
|
|
123
126
|
}
|
|
124
127
|
/**
|
|
125
128
|
* Engine configuration.
|
|
@@ -129,4 +132,6 @@ export interface EngineConfiguration {
|
|
|
129
132
|
physics?: IPhysics;
|
|
130
133
|
/** Color space. */
|
|
131
134
|
colorSpace?: ColorSpace;
|
|
135
|
+
/** Shader lab */
|
|
136
|
+
shaderLab?: IShaderLab;
|
|
132
137
|
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -9,13 +9,12 @@ import { RenderPass } from "./RenderPass";
|
|
|
9
9
|
* Basic render pipeline.
|
|
10
10
|
*/
|
|
11
11
|
export declare class BasicRenderPipeline {
|
|
12
|
-
private static _shadowCasterPipelineStageTagValue;
|
|
13
|
-
private static _forwardPipelineStageTagValue;
|
|
14
12
|
private _camera;
|
|
15
13
|
private _defaultPass;
|
|
16
14
|
private _renderPassArray;
|
|
17
15
|
private _lastCanvasSize;
|
|
18
16
|
private _cascadedShadowCaster;
|
|
17
|
+
private _depthOnlyPass;
|
|
19
18
|
/**
|
|
20
19
|
* Create a basic render pipeline.
|
|
21
20
|
* @param camera - Camera
|
|
@@ -62,7 +61,7 @@ export declare class BasicRenderPipeline {
|
|
|
62
61
|
* @param data - Render data
|
|
63
62
|
*/
|
|
64
63
|
pushRenderData(context: RenderContext, data: RenderData): void;
|
|
65
|
-
private
|
|
64
|
+
private pushRenderDataWithShader;
|
|
66
65
|
private _drawBackgroundTexture;
|
|
67
66
|
private _callRender;
|
|
68
67
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { SubMesh } from "../graphic";
|
|
2
|
+
import { Primitive } from "../graphic/Primitive";
|
|
1
3
|
import { Material } from "../material";
|
|
2
4
|
import { Renderer } from "../Renderer";
|
|
3
|
-
|
|
5
|
+
import { IPoolElement } from "./IPoolElement";
|
|
6
|
+
export declare class RenderData implements IPoolElement {
|
|
4
7
|
component: Renderer;
|
|
5
8
|
material: Material;
|
|
9
|
+
primitive: Primitive;
|
|
10
|
+
subPrimitive: SubMesh;
|
|
6
11
|
multiRenderData: boolean;
|
|
12
|
+
setX(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh): void;
|
|
13
|
+
dispose(): void;
|
|
7
14
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ShaderPass } from "../shader/ShaderPass";
|
|
2
|
-
import { RenderState } from "../shader/state/RenderState";
|
|
3
2
|
import { IPoolElement } from "./IPoolElement";
|
|
4
3
|
import { RenderData } from "./RenderData";
|
|
5
4
|
export declare class RenderElement implements IPoolElement {
|
|
6
5
|
data: RenderData;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
set(data: RenderData, shaderPass: ShaderPass, renderState: RenderState): void;
|
|
6
|
+
shaderPasses: ReadonlyArray<ShaderPass>;
|
|
7
|
+
set(data: RenderData, shaderPasses: ReadonlyArray<ShaderPass>): void;
|
|
10
8
|
dispose(): void;
|
|
11
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { Layer } from "../Layer";
|
|
4
|
+
import { RenderQueueType } from "../shader";
|
|
4
5
|
import { RenderElement } from "./RenderElement";
|
|
5
6
|
/**
|
|
6
7
|
* Render queue.
|
|
@@ -8,12 +9,13 @@ import { RenderElement } from "./RenderElement";
|
|
|
8
9
|
export declare class RenderQueue {
|
|
9
10
|
readonly elements: RenderElement[];
|
|
10
11
|
private _spriteBatcher;
|
|
11
|
-
|
|
12
|
+
private readonly _renderQueueType;
|
|
13
|
+
constructor(engine: Engine, renderQueueType: RenderQueueType);
|
|
12
14
|
/**
|
|
13
15
|
* Push a render element.
|
|
14
16
|
*/
|
|
15
17
|
pushRenderElement(element: RenderElement): void;
|
|
16
|
-
render(camera: Camera, mask: Layer): void;
|
|
18
|
+
render(camera: Camera, mask: Layer, pipelineStageTagValue: string): void;
|
|
17
19
|
/**
|
|
18
20
|
* Clear collection.
|
|
19
21
|
*/
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BoundingBox, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
-
import {
|
|
3
|
+
import { IComponentCustomClone } from "./clone/ComponentCloner";
|
|
4
4
|
import { Material } from "./material";
|
|
5
5
|
import { ShaderData } from "./shader/ShaderData";
|
|
6
6
|
/**
|
|
7
7
|
* Basis for all renderers.
|
|
8
8
|
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
9
9
|
*/
|
|
10
|
-
export declare class Renderer extends Component implements
|
|
10
|
+
export declare class Renderer extends Component implements IComponentCustomClone {
|
|
11
11
|
private static _tempVector0;
|
|
12
12
|
private static _receiveShadowMacro;
|
|
13
13
|
private static _localMatrixProperty;
|
package/types/Scene.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Entity } from "./Entity";
|
|
|
5
5
|
import { EngineObject } from "./base";
|
|
6
6
|
import { FogMode } from "./enums/FogMode";
|
|
7
7
|
import { AmbientLight } from "./lighting/AmbientLight";
|
|
8
|
+
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
8
9
|
import { ShaderData } from "./shader/ShaderData";
|
|
9
10
|
import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode";
|
|
10
11
|
import { ShadowResolution } from "./shadow/enum/ShadowResolution";
|
|
@@ -18,6 +19,8 @@ export declare class Scene extends EngineObject {
|
|
|
18
19
|
private static _sunlightDirectionProperty;
|
|
19
20
|
/** Scene name. */
|
|
20
21
|
name: string;
|
|
22
|
+
/** Physics. */
|
|
23
|
+
readonly physics: PhysicsScene;
|
|
21
24
|
/** If cast shadows. */
|
|
22
25
|
castShadows: boolean;
|
|
23
26
|
/** The resolution of the shadow maps. */
|
|
@@ -38,6 +41,12 @@ export declare class Scene extends EngineObject {
|
|
|
38
41
|
private _fogEnd;
|
|
39
42
|
private _fogDensity;
|
|
40
43
|
private _fogParams;
|
|
44
|
+
private _isActive;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the scene is active.
|
|
47
|
+
*/
|
|
48
|
+
get isActive(): boolean;
|
|
49
|
+
set isActive(value: boolean);
|
|
41
50
|
/**
|
|
42
51
|
* Scene-related shader data.
|
|
43
52
|
*/
|
|
@@ -140,10 +149,6 @@ export declare class Scene extends EngineObject {
|
|
|
140
149
|
* @returns Entity
|
|
141
150
|
*/
|
|
142
151
|
findEntityByPath(path: string): Entity | null;
|
|
143
|
-
/**
|
|
144
|
-
* Destroy this scene.
|
|
145
|
-
*/
|
|
146
|
-
destroy(): void;
|
|
147
152
|
private _addToRootEntityList;
|
|
148
153
|
private _computeLinearFogParams;
|
|
149
154
|
private _computeExponentialFogParams;
|
package/types/SceneManager.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import { AssetPromise } from "./asset/AssetPromise";
|
|
2
1
|
import { Engine } from "./Engine";
|
|
3
2
|
import { Scene } from "./Scene";
|
|
3
|
+
import { AssetPromise } from "./asset/AssetPromise";
|
|
4
4
|
/**
|
|
5
5
|
* Scene manager.
|
|
6
6
|
*/
|
|
7
7
|
export declare class SceneManager {
|
|
8
8
|
readonly engine: Engine;
|
|
9
9
|
/**
|
|
10
|
-
* Get the
|
|
10
|
+
* Get the scene list.
|
|
11
11
|
*/
|
|
12
|
-
get
|
|
13
|
-
|
|
12
|
+
get scenes(): ReadonlyArray<Scene>;
|
|
13
|
+
/**
|
|
14
|
+
* Add scene.
|
|
15
|
+
* @param scene - The scene which want to be added
|
|
16
|
+
*/
|
|
17
|
+
addScene(scene: Scene): void;
|
|
18
|
+
/**
|
|
19
|
+
* Add scene at specified index.
|
|
20
|
+
* @param index - specified index
|
|
21
|
+
* @param child - The scene which want to be added
|
|
22
|
+
*/
|
|
23
|
+
addScene(index: number, scene: Scene): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove scene.
|
|
26
|
+
* @param scene - The scene which want to be removed
|
|
27
|
+
*/
|
|
28
|
+
removeScene(scene: Scene): void;
|
|
14
29
|
/**
|
|
15
30
|
* Load and activate scene.
|
|
16
31
|
* @param url - the path of the scene
|
|
17
|
-
* @param destroyOldScene - whether to destroy old scene
|
|
32
|
+
* @param destroyOldScene - whether to destroy old scene
|
|
18
33
|
* @returns scene promise
|
|
19
34
|
*/
|
|
20
35
|
loadScene(url: string, destroyOldScene?: boolean): AssetPromise<Scene>;
|
|
@@ -25,4 +40,12 @@ export declare class SceneManager {
|
|
|
25
40
|
* @param destScene - target scene
|
|
26
41
|
*/
|
|
27
42
|
mergeScenes(sourceScene: Scene, destScene: Scene): void;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
* Please use `scenes` instead.
|
|
46
|
+
*
|
|
47
|
+
* Get the first scene.
|
|
48
|
+
*/
|
|
49
|
+
get activeScene(): Scene;
|
|
50
|
+
set activeScene(scene: Scene);
|
|
28
51
|
}
|
package/types/Script.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Color, Quaternion, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
1
|
+
import { Color, Quaternion, Rect, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { ReferResource } from "../asset/ReferResource";
|
|
2
3
|
/**
|
|
3
4
|
* Keyframe.
|
|
4
5
|
* @typeParam V - Type of Keyframe value
|
|
5
6
|
*/
|
|
6
|
-
export declare class Keyframe<V extends KeyframeValueType, T = V extends number ? number : V extends Vector2 ? Vector2 : V extends Vector3 ? Vector3 : V extends Vector4 | Color | Quaternion ? Vector4 : V extends number[] | Float32Array ? number[] : never> {
|
|
7
|
+
export declare class Keyframe<V extends KeyframeValueType, T = V extends number ? number : V extends Vector2 ? Vector2 : V extends Vector3 ? Vector3 : V extends Vector4 | Color | Quaternion | Rect ? Vector4 : V extends number[] | Float32Array ? number[] : V extends ReferResource ? ReferResource : never> {
|
|
7
8
|
/** The time of the Keyframe. */
|
|
8
9
|
time: number;
|
|
9
10
|
/** The value of the Keyframe. */
|
|
@@ -16,4 +17,4 @@ export declare class Keyframe<V extends KeyframeValueType, T = V extends number
|
|
|
16
17
|
/**
|
|
17
18
|
* Type of Keyframe value.
|
|
18
19
|
*/
|
|
19
|
-
export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | boolean;
|
|
20
|
+
export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | Rect | boolean | ReferResource;
|
|
@@ -8,3 +8,5 @@ export { AnimationQuaternionCurve } from "./AnimationQuaternionCurve";
|
|
|
8
8
|
export { AnimationVector2Curve } from "./AnimationVector2Curve";
|
|
9
9
|
export { AnimationVector3Curve } from "./AnimationVector3Curve";
|
|
10
10
|
export { AnimationVector4Curve } from "./AnimationVector4Curve";
|
|
11
|
+
export { AnimationRefCurve } from "./AnimationRefCurve";
|
|
12
|
+
export { AnimationRectCurve } from "./AnimationRectCurve";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import "./internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler";
|
|
2
|
+
import "./internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler";
|
|
3
|
+
import "./internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler";
|
|
4
|
+
import "./internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler";
|
|
1
5
|
export { AnimationClip } from "./AnimationClip";
|
|
2
6
|
export { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
|
|
3
7
|
export * from "./animationCurve";
|
|
@@ -35,6 +35,8 @@ export declare enum AssetType {
|
|
|
35
35
|
KTX = "KTX",
|
|
36
36
|
/** Cube Compress Texture. */
|
|
37
37
|
KTXCube = "KTXCube",
|
|
38
|
+
/** KTX2 Compress Texture */
|
|
39
|
+
KTX2 = "KTX2",
|
|
38
40
|
/** Sprite. */
|
|
39
41
|
Sprite = "Sprite",
|
|
40
42
|
/** Sprite Atlas. */
|
|
@@ -48,5 +50,7 @@ export declare enum AssetType {
|
|
|
48
50
|
/** Font. */
|
|
49
51
|
Font = "Font",
|
|
50
52
|
/** Source Font, include ttf、 otf and woff. */
|
|
51
|
-
SourceFont = "SourceFont"
|
|
53
|
+
SourceFont = "SourceFont",
|
|
54
|
+
/** Project asset. */
|
|
55
|
+
Project = "project"
|
|
52
56
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
2
|
import { ReferResource } from "./ReferResource";
|
|
3
3
|
export declare abstract class GraphicsResource extends ReferResource {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the content of the resource is lost.
|
|
6
|
+
*/
|
|
7
|
+
get isContentLost(): boolean;
|
|
4
8
|
protected constructor(engine: Engine);
|
|
5
9
|
}
|
package/types/asset/Loader.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Engine, EngineConfiguration } from "../Engine";
|
|
1
2
|
import { AssetPromise } from "./AssetPromise";
|
|
2
3
|
import { LoadItem } from "./LoadItem";
|
|
3
4
|
import { RequestConfig } from "./request";
|
|
@@ -25,6 +26,7 @@ export declare abstract class Loader<T> {
|
|
|
25
26
|
};
|
|
26
27
|
private static _engineObjects;
|
|
27
28
|
constructor(useCache: boolean);
|
|
29
|
+
initialize?(engine: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
30
|
+
abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T>;
|
|
28
31
|
request: <U>(url: string, config: RequestConfig) => AssetPromise<U>;
|
|
29
|
-
abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T> | Record<string, AssetPromise<any>>;
|
|
30
32
|
}
|
|
@@ -7,8 +7,6 @@ import { LoadItem } from "./LoadItem";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ResourceManager {
|
|
9
9
|
readonly engine: Engine;
|
|
10
|
-
/** Loader collection. */
|
|
11
|
-
private static _loaders;
|
|
12
10
|
private static _extTypeMapping;
|
|
13
11
|
private static _getTypeByUrl;
|
|
14
12
|
/** The number of retries after failing to load assets. */
|
|
@@ -28,6 +26,7 @@ export declare class ResourceManager {
|
|
|
28
26
|
private _graphicResourcePool;
|
|
29
27
|
/** Restorable resource information pool, key is the `instanceID` of resource. */
|
|
30
28
|
private _contentRestorerPool;
|
|
29
|
+
private _subAssetPromiseCallbacks;
|
|
31
30
|
/**
|
|
32
31
|
* Create a ResourceManager.
|
|
33
32
|
* @param engine - Engine to which the current ResourceManager belongs
|
|
@@ -63,6 +62,12 @@ export declare class ResourceManager {
|
|
|
63
62
|
* @returns Resource object
|
|
64
63
|
*/
|
|
65
64
|
getFromCache<T>(url: string): T;
|
|
65
|
+
/**
|
|
66
|
+
* Find the resource by type.
|
|
67
|
+
* @param type - Resource type
|
|
68
|
+
* @returns - Resource collection
|
|
69
|
+
*/
|
|
70
|
+
findResourcesByType<T extends EngineObject>(type: new (...args: any[]) => T): T[];
|
|
66
71
|
/**
|
|
67
72
|
* Get asset url from instanceId.
|
|
68
73
|
* @param instanceId - Engine instance id
|
|
@@ -95,6 +100,7 @@ export declare class ResourceManager {
|
|
|
95
100
|
addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
|
|
96
101
|
private _assignDefaultOptions;
|
|
97
102
|
private _loadSingleItem;
|
|
103
|
+
private _pushSubAssetPromiseCallback;
|
|
98
104
|
private _gc;
|
|
99
105
|
private _getResolveResource;
|
|
100
106
|
private _parseURL;
|
package/types/base/Constant.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export declare enum GLCapabilityType {
|
|
|
106
106
|
pvrtc_webkit = "WEBKIT_WEBGL_compressed_texture_pvrtc",
|
|
107
107
|
s3tc = "WEBGL_compressed_texture_s3tc",
|
|
108
108
|
s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc",
|
|
109
|
+
bptc = "EXT_texture_compression_bptc",
|
|
109
110
|
WEBGL_lose_context = "WEBGL_lose_context"
|
|
110
111
|
}
|
|
111
112
|
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
|
+
import { Entity } from "../Entity";
|
|
2
3
|
/**
|
|
3
4
|
* Custom clone interface.
|
|
4
5
|
*/
|
|
5
6
|
export interface ICustomClone {
|
|
6
7
|
}
|
|
8
|
+
export interface IComponentCustomClone {
|
|
9
|
+
}
|
|
7
10
|
export declare class ComponentCloner {
|
|
8
11
|
/**
|
|
9
12
|
* Clone component.
|
|
10
13
|
* @param source - Clone source
|
|
11
14
|
* @param target - Clone target
|
|
12
15
|
*/
|
|
13
|
-
static cloneComponent(source: Component, target: Component): void;
|
|
16
|
+
static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity): void;
|
|
14
17
|
}
|
|
@@ -11,6 +11,8 @@ export declare class Buffer extends GraphicsResource {
|
|
|
11
11
|
private _byteLength;
|
|
12
12
|
private _bufferUsage;
|
|
13
13
|
private _platformBuffer;
|
|
14
|
+
private _readable;
|
|
15
|
+
private _data;
|
|
14
16
|
/**
|
|
15
17
|
* Buffer binding flag.
|
|
16
18
|
*/
|
|
@@ -23,22 +25,36 @@ export declare class Buffer extends GraphicsResource {
|
|
|
23
25
|
* Buffer usage.
|
|
24
26
|
*/
|
|
25
27
|
get bufferUsage(): BufferUsage;
|
|
28
|
+
/**
|
|
29
|
+
* If buffer is readable.
|
|
30
|
+
*/
|
|
31
|
+
get readable(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Buffer data cache.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Buffer must be readable.
|
|
37
|
+
* If the data you get is modified, must call `setData()` to update buffer to GPU.
|
|
38
|
+
*/
|
|
39
|
+
get data(): Uint8Array;
|
|
26
40
|
/**
|
|
27
41
|
* Create Buffer.
|
|
28
42
|
* @param engine - Engine
|
|
29
43
|
* @param type - Buffer binding flag
|
|
30
44
|
* @param byteLength - Byte length
|
|
31
45
|
* @param bufferUsage - Buffer usage
|
|
46
|
+
* @param readable - If buffer is readable
|
|
32
47
|
*/
|
|
33
|
-
constructor(engine: Engine, type: BufferBindFlag, byteLength: number, bufferUsage?: BufferUsage);
|
|
48
|
+
constructor(engine: Engine, type: BufferBindFlag, byteLength: number, bufferUsage?: BufferUsage, readable?: boolean);
|
|
34
49
|
/**
|
|
35
50
|
* Create Buffer.
|
|
36
51
|
* @param engine - Engine
|
|
37
52
|
* @param type - Buffer binding flag
|
|
38
|
-
* @param data -
|
|
53
|
+
* @param data - Buffer data, if `readable` is true, the`data` property will store a copy of this
|
|
39
54
|
* @param bufferUsage - Buffer usage
|
|
55
|
+
* @param readable - If buffer is readable
|
|
40
56
|
*/
|
|
41
|
-
constructor(engine: Engine, type: BufferBindFlag, data: ArrayBuffer | ArrayBufferView, bufferUsage?: BufferUsage);
|
|
57
|
+
constructor(engine: Engine, type: BufferBindFlag, data: ArrayBuffer | ArrayBufferView, bufferUsage?: BufferUsage, readable?: boolean);
|
|
42
58
|
/**
|
|
43
59
|
* Bind buffer.
|
|
44
60
|
*/
|
|
@@ -90,9 +106,9 @@ export declare class Buffer extends GraphicsResource {
|
|
|
90
106
|
* @param dataLength - Output data length
|
|
91
107
|
*/
|
|
92
108
|
getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
|
|
93
|
-
_rebuild(): void;
|
|
94
109
|
/**
|
|
95
|
-
*
|
|
110
|
+
* Mark buffer as readable, the `data` property will be not accessible anymore.
|
|
96
111
|
*/
|
|
97
|
-
|
|
112
|
+
markAsUnreadable(): void;
|
|
113
|
+
_rebuild(): void;
|
|
98
114
|
}
|