@galacean/engine-core 1.1.0-alpha.0 → 1.1.0-alpha.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 +4539 -3189
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +4539 -3189
- package/dist/module.js +4917 -3567
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/sprite/Sprite.d.ts +3 -0
- package/types/Camera.d.ts +25 -4
- package/types/DisorderedArray.d.ts +4 -3
- package/types/Engine.d.ts +5 -1
- package/types/Entity.d.ts +3 -1
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +1 -2
- package/types/RenderPipeline/ClassPool.d.ts +3 -1
- package/types/RenderPipeline/CullingResults.d.ts +1 -0
- package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
- package/types/RenderPipeline/IPoolElement.d.ts +3 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +3 -1
- package/types/RenderPipeline/PipelinePass.d.ts +16 -0
- package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
- package/types/RenderPipeline/RenderElement.d.ts +5 -5
- package/types/RenderPipeline/RenderElementX.d.ts +12 -0
- package/types/RenderPipeline/RenderQueue.d.ts +1 -1
- package/types/RenderPipeline/SpriteMaskRenderData.d.ts +3 -1
- package/types/RenderPipeline/SpriteRenderData.d.ts +3 -1
- package/types/RenderPipeline/TextRenderData.d.ts +3 -1
- package/types/RenderPipeline/enums/PipelineStage.d.ts +2 -0
- package/types/Renderer.d.ts +5 -2
- package/types/Scene.d.ts +10 -4
- package/types/Ticker.d.ts +30 -0
- package/types/Transform.d.ts +1 -0
- package/types/animation/Animator.d.ts +3 -1
- package/types/animation/enums/LayerState.d.ts +3 -1
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/LoadItem.d.ts +16 -9
- package/types/asset/Loader.d.ts +3 -1
- package/types/asset/ResourceManager.d.ts +8 -2
- package/types/asset/request.d.ts +7 -3
- package/types/base/Constant.d.ts +1 -0
- package/types/base/EventDispatcher.d.ts +1 -1
- package/types/clone/ComponentCloner.d.ts +2 -1
- package/types/enums/DepthTextureMode.d.ts +7 -0
- package/types/graphic/Buffer.d.ts +22 -6
- package/types/graphic/BufferUtil.d.ts +1 -0
- package/types/graphic/Primitive.d.ts +1 -0
- package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
- package/types/graphic/SubMesh.d.ts +3 -1
- package/types/graphic/SubPrimitive.d.ts +9 -0
- package/types/graphic/VertexElement.d.ts +10 -6
- package/types/index.d.ts +2 -1
- package/types/lighting/AmbientLight.d.ts +4 -1
- package/types/lighting/LightManager.d.ts +1 -0
- package/types/material/Material.d.ts +9 -2
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/ModelMesh.d.ts +62 -41
- 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/ParticleBufferUtils.d.ts +1 -0
- package/types/particle/ParticleData.d.ts +1 -0
- package/types/particle/ParticleGenerator.d.ts +72 -0
- package/types/particle/ParticleMaterial.d.ts +28 -0
- package/types/particle/ParticleMesh.d.ts +289 -0
- package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
- package/types/particle/ParticleShaderMacro.d.ts +1 -0
- package/types/particle/ParticleShaderProperty.d.ts +1 -0
- package/types/particle/ParticleSystem.d.ts +41 -0
- package/types/particle/ParticleVertexElements.d.ts +1 -0
- package/types/particle/ParticleVertexUtils.d.ts +1 -0
- package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
- package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
- package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
- package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
- package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/enum/ParticleShapeType.d.ts +15 -0
- package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enum/index.d.ts +9 -0
- package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
- package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
- package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enums/ParticleStopMode.d.ts +6 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
- package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
- package/types/particle/module/Burst.d.ts +38 -0
- package/types/particle/module/ColorGradient.d.ts +75 -0
- package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/module/EmissionModule.d.ts +63 -0
- package/types/particle/module/FrameOverTime.d.ts +73 -0
- package/types/particle/module/ParticleCurve.d.ts +37 -0
- package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
- package/types/particle/module/SizeGradient.d.ts +151 -0
- package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/StartFrame.d.ts +46 -0
- package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
- package/types/particle/module/VelocityGradient.d.ts +110 -0
- package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
- package/types/particle/module/index.d.ts +15 -0
- package/types/particle/module/shape/BaseShape.d.ts +26 -0
- package/types/particle/module/shape/BoxShape.d.ts +20 -0
- package/types/particle/module/shape/CircleShape.d.ts +27 -0
- package/types/particle/module/shape/ConeShape.d.ts +35 -0
- package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/module/shape/SphereShape.d.ts +23 -0
- package/types/particle/module/shape/index.d.ts +5 -0
- package/types/particle/modules/Burst.d.ts +14 -0
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/modules/EmissionModule.d.ts +45 -0
- package/types/particle/modules/MainModule.d.ts +68 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
- package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
- package/types/particle/modules/ParticleCurve.d.ts +56 -0
- package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
- package/types/particle/modules/ParticleGradient.d.ts +94 -0
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/ShapeModule.d.ts +9 -0
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/shape/BaseShape.d.ts +12 -0
- package/types/particle/modules/shape/BoxShape.d.ts +11 -0
- package/types/particle/modules/shape/CircleShape.d.ts +17 -0
- package/types/particle/modules/shape/ConeShape.d.ts +28 -0
- package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/modules/shape/SphereShape.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/modules/shape/index.d.ts +6 -0
- package/types/particle/moudules/Burst.d.ts +25 -0
- package/types/particle/moudules/Emission.d.ts +47 -0
- package/types/particle/moudules/EmissionModule.d.ts +49 -0
- package/types/particle/moudules/MainModule.d.ts +59 -0
- package/types/particle/moudules/ParticleCurve.d.ts +27 -0
- package/types/particle/moudules/ParticleGradient.d.ts +28 -0
- package/types/particle/moudules/ShapeModule.d.ts +7 -0
- package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
- package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
- package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
- package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
- package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/moudules/shape/index.d.ts +5 -0
- package/types/physics/PhysicsScene.d.ts +6 -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/enums/RenderStateElementKey.d.ts +58 -0
- package/types/shader/index.d.ts +1 -0
- package/types/shaderlib/particle/index.d.ts +14 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -6
- package/types/shadow/PipelinePass.d.ts +16 -0
- package/types/sky/Sky.d.ts +12 -4
- package/types/texture/RenderTarget.d.ts +1 -2
- package/types/texture/Texture.d.ts +6 -0
- package/types/texture/Texture2D.d.ts +4 -2
- 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/types/texture/enums/TextureUsage.d.ts +9 -0
- package/types/texture/index.d.ts +1 -0
- package/types/xr/XRManager.d.ts +31 -0
- package/types/xr/component/XRPoseDriver.d.ts +10 -0
- package/types/xr/data/XRCamera.d.ts +6 -0
- package/types/xr/data/XRDevice.d.ts +9 -0
- package/types/xr/data/XRHandle.d.ts +10 -0
- package/types/xr/enum/EnumXRButton.d.ts +5 -0
- package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
- package/types/xr/enum/EnumXRFeature.d.ts +9 -0
- package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
- package/types/xr/enum/EnumXRMode.d.ts +7 -0
- package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
- package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
- package/types/xr/feature/XRCameraManager.d.ts +21 -0
- package/types/xr/feature/XRFeature.d.ts +29 -0
- package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
- package/types/xr/feature/XRInputManager.d.ts +16 -0
- package/types/xr/index.d.ts +18 -0
- package/types/xr/provider/XRProvider.d.ts +19 -0
- package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
- package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.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": "1.1.0-alpha.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-alpha.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-alpha.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-alpha.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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
3
|
import { Layer } from "./Layer";
|
|
4
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";
|
|
@@ -12,8 +13,9 @@ import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
|
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 _cameraDepthBufferParamsProperty;
|
|
17
19
|
/** Whether to enable frustum culling, it is enabled by default. */
|
|
18
20
|
enableFrustumCulling: boolean;
|
|
19
21
|
/**
|
|
@@ -26,7 +28,13 @@ export declare class Camera extends Component {
|
|
|
26
28
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
27
29
|
*/
|
|
28
30
|
cullingMask: Layer;
|
|
31
|
+
/**
|
|
32
|
+
* Depth texture mode.
|
|
33
|
+
* @defaultValue `DepthTextureMode.None`
|
|
34
|
+
*/
|
|
35
|
+
depthTextureMode: DepthTextureMode;
|
|
29
36
|
private _priority;
|
|
37
|
+
private _shaderData;
|
|
30
38
|
private _isProjMatSetting;
|
|
31
39
|
private _nearClipPlane;
|
|
32
40
|
private _farClipPlane;
|
|
@@ -37,14 +45,20 @@ export declare class Camera extends Component {
|
|
|
37
45
|
private _isFrustumProjectDirty;
|
|
38
46
|
private _customAspectRatio;
|
|
39
47
|
private _renderTarget;
|
|
48
|
+
private _depthBufferParams;
|
|
40
49
|
private _frustumViewChangeFlag;
|
|
41
50
|
private _transform;
|
|
42
51
|
private _isViewMatrixDirty;
|
|
43
52
|
private _isInvViewProjDirty;
|
|
44
53
|
private _viewport;
|
|
54
|
+
private _pixelViewport;
|
|
45
55
|
private _inverseProjectionMatrix;
|
|
46
56
|
private _lastAspectSize;
|
|
47
57
|
private _invViewProjMat;
|
|
58
|
+
/**
|
|
59
|
+
* Shader data.
|
|
60
|
+
*/
|
|
61
|
+
get shaderData(): ShaderData;
|
|
48
62
|
/**
|
|
49
63
|
* Near clip plane - the closest point to the camera when rendering occurs.
|
|
50
64
|
*/
|
|
@@ -67,11 +81,17 @@ export declare class Camera extends Component {
|
|
|
67
81
|
get aspectRatio(): number;
|
|
68
82
|
set aspectRatio(value: number);
|
|
69
83
|
/**
|
|
70
|
-
*
|
|
84
|
+
* The viewport of the camera in normalized coordinates on the screen.
|
|
85
|
+
* In normalized screen coordinates, the upper-left corner is (0, 0), and the lower-right corner is (1.0, 1.0).
|
|
71
86
|
* @remarks Re-assignment is required after modification to ensure that the modification takes effect.
|
|
72
87
|
*/
|
|
73
88
|
get viewport(): Vector4;
|
|
74
89
|
set viewport(value: Vector4);
|
|
90
|
+
/**
|
|
91
|
+
* The viewport of the camera in pixel coordinates on the screen.
|
|
92
|
+
* In pixel screen coordinates, the upper-left corner is (0, 0), and the lower-right corner is (1.0, 1.0).
|
|
93
|
+
*/
|
|
94
|
+
get pixelViewport(): Rect;
|
|
75
95
|
/**
|
|
76
96
|
* Rendering priority, higher priority will be rendered on top of a camera with lower priority.
|
|
77
97
|
*/
|
|
@@ -215,6 +235,7 @@ export declare class Camera extends Component {
|
|
|
215
235
|
* @inheritdoc
|
|
216
236
|
*/
|
|
217
237
|
_onDisableInScene(): void;
|
|
238
|
+
private _updatePixelViewport;
|
|
218
239
|
private _projMatChange;
|
|
219
240
|
private _innerViewportToWorldPoint;
|
|
220
241
|
private _updateShaderData;
|
|
@@ -7,11 +7,12 @@ export declare class DisorderedArray<T> {
|
|
|
7
7
|
constructor(count?: number);
|
|
8
8
|
add(element: T): void;
|
|
9
9
|
delete(element: T): void;
|
|
10
|
+
set(index: number, element: T): void;
|
|
10
11
|
get(index: number): T;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param index
|
|
14
|
-
* @returns The replaced item is used to reset its index
|
|
13
|
+
* Delete the element at the specified index.
|
|
14
|
+
* @param index - The index of the element to be deleted
|
|
15
|
+
* @returns The replaced item is used to reset its index
|
|
15
16
|
*/
|
|
16
17
|
deleteByIndex(index: number): T;
|
|
17
18
|
garbageCollection(): void;
|
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";
|
|
@@ -30,6 +30,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
30
30
|
private _frameInProcess;
|
|
31
31
|
private _waitingDestroy;
|
|
32
32
|
private _isDeviceLost;
|
|
33
|
+
private _waitingGC;
|
|
33
34
|
private _animate;
|
|
34
35
|
/**
|
|
35
36
|
* Settings of Engine.
|
|
@@ -116,6 +117,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
116
117
|
private _createSpriteMaskMaterial;
|
|
117
118
|
private _onDeviceLost;
|
|
118
119
|
private _onDeviceRestored;
|
|
120
|
+
private _gc;
|
|
119
121
|
/**
|
|
120
122
|
* @deprecated
|
|
121
123
|
* The first scene physics manager.
|
|
@@ -130,4 +132,6 @@ export interface EngineConfiguration {
|
|
|
130
132
|
physics?: IPhysics;
|
|
131
133
|
/** Color space. */
|
|
132
134
|
colorSpace?: ColorSpace;
|
|
135
|
+
/** Shader lab */
|
|
136
|
+
shaderLab?: IShaderLab;
|
|
133
137
|
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export declare class Entity extends EngineObject {
|
|
|
65
65
|
* @param type - The type of the component
|
|
66
66
|
* @returns The first component which match type
|
|
67
67
|
*/
|
|
68
|
-
getComponent<T extends Component>(type: new (entity: Entity) => T): T;
|
|
68
|
+
getComponent<T extends Component>(type: new (entity: Entity) => T): T | null;
|
|
69
69
|
/**
|
|
70
70
|
* Get components which match the type.
|
|
71
71
|
* @param type - The type of the component
|
|
@@ -130,6 +130,8 @@ export declare class Entity extends EngineObject {
|
|
|
130
130
|
* @returns Cloned entity
|
|
131
131
|
*/
|
|
132
132
|
clone(): Entity;
|
|
133
|
+
private _createCloneEntity;
|
|
134
|
+
private _parseCloneEntity;
|
|
133
135
|
/**
|
|
134
136
|
* Destroy self.
|
|
135
137
|
*/
|
|
@@ -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
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IPoolElement } from "./IPoolElement";
|
|
1
2
|
/**
|
|
2
3
|
* Class pool utils.
|
|
3
4
|
*/
|
|
4
|
-
export declare class ClassPool<T> {
|
|
5
|
+
export declare class ClassPool<T extends IPoolElement> {
|
|
5
6
|
private _elementPoolIndex;
|
|
6
7
|
private _elementPool;
|
|
7
8
|
private _type;
|
|
@@ -14,4 +15,5 @@ export declare class ClassPool<T> {
|
|
|
14
15
|
* Reset pool.
|
|
15
16
|
*/
|
|
16
17
|
resetPool(): void;
|
|
18
|
+
garbageCollection(): void;
|
|
17
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,14 +2,16 @@ import { Mesh } from "../graphic/Mesh";
|
|
|
2
2
|
import { SubMesh } from "../graphic/SubMesh";
|
|
3
3
|
import { Material } from "../material/Material";
|
|
4
4
|
import { Renderer } from "../Renderer";
|
|
5
|
+
import { IPoolElement } from "./IPoolElement";
|
|
5
6
|
import { RenderData } from "./RenderData";
|
|
6
7
|
/**
|
|
7
8
|
* Render element.
|
|
8
9
|
*/
|
|
9
|
-
export declare class MeshRenderData extends RenderData {
|
|
10
|
+
export declare class MeshRenderData extends RenderData implements IPoolElement {
|
|
10
11
|
/** Mesh. */
|
|
11
12
|
mesh: Mesh;
|
|
12
13
|
/** Sub mesh. */
|
|
13
14
|
subMesh: SubMesh;
|
|
14
15
|
set(component: Renderer, material: Material, mesh: Mesh, subMesh: SubMesh): void;
|
|
16
|
+
dispose(): void;
|
|
15
17
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { CullingResults } from "../RenderPipeline/CullingResults";
|
|
3
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
4
|
+
/**
|
|
5
|
+
* PipelinePass is a base class for all pipeline passes.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class PipelinePass {
|
|
8
|
+
protected _engine: Engine;
|
|
9
|
+
constructor(engine: Engine);
|
|
10
|
+
/**
|
|
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.
|
|
12
|
+
* @param context - Rendering context
|
|
13
|
+
* @param cullingResults - Culling results
|
|
14
|
+
*/
|
|
15
|
+
abstract onRender(context: RenderContext, cullingResults: CullingResults): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ShaderPass } from "../shader/ShaderPass";
|
|
2
|
-
import {
|
|
2
|
+
import { IPoolElement } from "./IPoolElement";
|
|
3
3
|
import { RenderData } from "./RenderData";
|
|
4
|
-
export declare class RenderElement {
|
|
4
|
+
export declare class RenderElement implements IPoolElement {
|
|
5
5
|
data: RenderData;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
shaderPasses: ReadonlyArray<ShaderPass>;
|
|
7
|
+
set(data: RenderData, shaderPasses: ReadonlyArray<ShaderPass>): void;
|
|
8
|
+
dispose(): void;
|
|
9
9
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Renderer } from "../Renderer";
|
|
2
|
+
import { Primitive } from "../graphic/Primitive";
|
|
3
|
+
import { Material } from "../material/Material";
|
|
4
|
+
import { ShaderPass } from "../shader/ShaderPass";
|
|
5
|
+
import { IPoolElement } from "./IPoolElement";
|
|
6
|
+
export declare class RenderElementX implements IPoolElement {
|
|
7
|
+
shaderPasses: ReadonlyArray<ShaderPass>;
|
|
8
|
+
component: Renderer;
|
|
9
|
+
material: Material;
|
|
10
|
+
primitive: Primitive;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
@@ -13,7 +13,7 @@ export declare class RenderQueue {
|
|
|
13
13
|
* Push a render element.
|
|
14
14
|
*/
|
|
15
15
|
pushRenderElement(element: RenderElement): void;
|
|
16
|
-
render(camera: Camera, mask: Layer): void;
|
|
16
|
+
render(camera: Camera, mask: Layer, pipelineStageTagValue: string): void;
|
|
17
17
|
/**
|
|
18
18
|
* Clear collection.
|
|
19
19
|
*/
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { VertexData2D } from "../2d/data/VertexData2D";
|
|
2
2
|
import { Material } from "../material/Material";
|
|
3
3
|
import { Renderer } from "../Renderer";
|
|
4
|
+
import { IPoolElement } from "./IPoolElement";
|
|
4
5
|
import { RenderData } from "./RenderData";
|
|
5
|
-
export declare class SpriteMaskRenderData extends RenderData {
|
|
6
|
+
export declare class SpriteMaskRenderData extends RenderData implements IPoolElement {
|
|
6
7
|
isAdd: boolean;
|
|
7
8
|
verticesData: VertexData2D;
|
|
8
9
|
constructor();
|
|
9
10
|
set(component: Renderer, material: Material, verticesData: VertexData2D): void;
|
|
11
|
+
dispose(): void;
|
|
10
12
|
}
|
|
@@ -2,11 +2,13 @@ import { VertexData2D } from "../2d/data/VertexData2D";
|
|
|
2
2
|
import { Material } from "../material/Material";
|
|
3
3
|
import { Renderer } from "../Renderer";
|
|
4
4
|
import { Texture2D } from "../texture";
|
|
5
|
+
import { IPoolElement } from "./IPoolElement";
|
|
5
6
|
import { RenderData } from "./RenderData";
|
|
6
|
-
export declare class SpriteRenderData extends RenderData {
|
|
7
|
+
export declare class SpriteRenderData extends RenderData implements IPoolElement {
|
|
7
8
|
verticesData: VertexData2D;
|
|
8
9
|
texture: Texture2D;
|
|
9
10
|
dataIndex: number;
|
|
10
11
|
constructor();
|
|
11
12
|
set(component: Renderer, material: Material, verticesData: VertexData2D, texture: Texture2D, dataIndex?: number): void;
|
|
13
|
+
dispose(): void;
|
|
12
14
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IPoolElement } from "./IPoolElement";
|
|
1
2
|
import { RenderData } from "./RenderData";
|
|
2
3
|
import { SpriteRenderData } from "./SpriteRenderData";
|
|
3
|
-
export declare class TextRenderData extends RenderData {
|
|
4
|
+
export declare class TextRenderData extends RenderData implements IPoolElement {
|
|
4
5
|
charsData: SpriteRenderData[];
|
|
5
6
|
constructor();
|
|
7
|
+
dispose(): void;
|
|
6
8
|
}
|
package/types/Renderer.d.ts
CHANGED
|
@@ -17,12 +17,11 @@ export declare class Renderer extends Component implements ICustomClone {
|
|
|
17
17
|
private static _mvInvMatrixProperty;
|
|
18
18
|
private static _normalMatrixProperty;
|
|
19
19
|
private static _rendererLayerProperty;
|
|
20
|
-
/** ShaderData related to renderer. */
|
|
21
|
-
readonly shaderData: ShaderData;
|
|
22
20
|
_renderFrameCount: number;
|
|
23
21
|
protected _overrideUpdate: boolean;
|
|
24
22
|
protected _materials: Material[];
|
|
25
23
|
protected _dirtyUpdateFlag: number;
|
|
24
|
+
private _shaderData;
|
|
26
25
|
private _mvMatrix;
|
|
27
26
|
private _mvpMatrix;
|
|
28
27
|
private _mvInvMatrix;
|
|
@@ -31,6 +30,10 @@ export declare class Renderer extends Component implements ICustomClone {
|
|
|
31
30
|
private _priority;
|
|
32
31
|
private _receiveShadows;
|
|
33
32
|
protected _rendererLayer: Vector4;
|
|
33
|
+
/**
|
|
34
|
+
* ShaderData related to renderer.
|
|
35
|
+
*/
|
|
36
|
+
get shaderData(): ShaderData;
|
|
34
37
|
/**
|
|
35
38
|
* Whether it is culled in the current frame and does not participate in rendering.
|
|
36
39
|
*/
|
package/types/Scene.d.ts
CHANGED
|
@@ -21,10 +21,6 @@ export declare class Scene extends EngineObject {
|
|
|
21
21
|
name: string;
|
|
22
22
|
/** Physics. */
|
|
23
23
|
readonly physics: PhysicsScene;
|
|
24
|
-
/** The background of the scene. */
|
|
25
|
-
readonly background: Background;
|
|
26
|
-
/** Scene-related shader data. */
|
|
27
|
-
readonly shaderData: ShaderData;
|
|
28
24
|
/** If cast shadows. */
|
|
29
25
|
castShadows: boolean;
|
|
30
26
|
/** The resolution of the shadow maps. */
|
|
@@ -35,6 +31,8 @@ export declare class Scene extends EngineObject {
|
|
|
35
31
|
shadowFourCascadeSplits: Vector3;
|
|
36
32
|
/** Max Shadow distance. */
|
|
37
33
|
shadowDistance: number;
|
|
34
|
+
private _background;
|
|
35
|
+
private _shaderData;
|
|
38
36
|
private _shadowCascades;
|
|
39
37
|
private _ambientLight;
|
|
40
38
|
private _fogMode;
|
|
@@ -43,6 +41,14 @@ export declare class Scene extends EngineObject {
|
|
|
43
41
|
private _fogEnd;
|
|
44
42
|
private _fogDensity;
|
|
45
43
|
private _fogParams;
|
|
44
|
+
/**
|
|
45
|
+
* Scene-related shader data.
|
|
46
|
+
*/
|
|
47
|
+
get shaderData(): ShaderData;
|
|
48
|
+
/**
|
|
49
|
+
* The background of the scene.
|
|
50
|
+
*/
|
|
51
|
+
get background(): Background;
|
|
46
52
|
/**
|
|
47
53
|
* Number of cascades to use for directional light shadows.
|
|
48
54
|
*/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare class Ticker {
|
|
2
|
+
private _vSyncCount;
|
|
3
|
+
private _vSyncCounter;
|
|
4
|
+
private _requestId;
|
|
5
|
+
private _animationLoop;
|
|
6
|
+
private _requestAnimationFrame;
|
|
7
|
+
private _cancelAnimationFrame;
|
|
8
|
+
/**
|
|
9
|
+
* The number of vertical synchronization means the number of vertical blanking for one frame.
|
|
10
|
+
* @remarks 0 means that the vertical synchronization is turned off.
|
|
11
|
+
*/
|
|
12
|
+
get vSyncCount(): number;
|
|
13
|
+
set vSyncCount(value: number);
|
|
14
|
+
get requestAnimationFrame(): (...params: any[]) => any;
|
|
15
|
+
set requestAnimationFrame(func: (...params: any[]) => any);
|
|
16
|
+
get cancelAnimationFrame(): (...params: any[]) => any;
|
|
17
|
+
set cancelAnimationFrame(func: (...params: any[]) => any);
|
|
18
|
+
get animationLoop(): (...params: any[]) => any;
|
|
19
|
+
set animationLoop(func: (...params: any[]) => any);
|
|
20
|
+
/**
|
|
21
|
+
* Pause the engine.
|
|
22
|
+
*/
|
|
23
|
+
pause(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Resume the engine.
|
|
26
|
+
*/
|
|
27
|
+
resume(): void;
|
|
28
|
+
private _onAnimationFrame;
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
package/types/Transform.d.ts
CHANGED
|
@@ -195,6 +195,7 @@ export declare class Transform extends Component {
|
|
|
195
195
|
* @returns Change flag
|
|
196
196
|
*/
|
|
197
197
|
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
198
|
+
protected _onDestroy(): void;
|
|
198
199
|
/**
|
|
199
200
|
* Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
|
|
200
201
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
@@ -13,6 +13,7 @@ export declare class Animator extends Component {
|
|
|
13
13
|
speed: number;
|
|
14
14
|
protected _animatorController: AnimatorController;
|
|
15
15
|
protected _controllerUpdateFlag: BoolUpdateFlag;
|
|
16
|
+
protected _updateMark: number;
|
|
16
17
|
private _animatorLayersData;
|
|
17
18
|
private _curveOwnerPool;
|
|
18
19
|
private _animationEventHandlerPool;
|
|
@@ -55,7 +56,6 @@ export declare class Animator extends Component {
|
|
|
55
56
|
*/
|
|
56
57
|
findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
|
|
57
58
|
private _getAnimatorStateInfo;
|
|
58
|
-
private _saveDefaultValues;
|
|
59
59
|
private _getAnimatorStateData;
|
|
60
60
|
private _saveAnimatorStateData;
|
|
61
61
|
private _saveAnimatorEventHandlers;
|
|
@@ -71,6 +71,7 @@ export declare class Animator extends Component {
|
|
|
71
71
|
private _updatePlayingState;
|
|
72
72
|
private _updateCrossFade;
|
|
73
73
|
private _updateCrossFadeFromPose;
|
|
74
|
+
private _updateFinishedState;
|
|
74
75
|
private _updateCrossFadeData;
|
|
75
76
|
private _preparePlay;
|
|
76
77
|
private _checkTransition;
|
|
@@ -82,4 +83,5 @@ export declare class Animator extends Component {
|
|
|
82
83
|
private _callAnimatorScriptOnUpdate;
|
|
83
84
|
private _callAnimatorScriptOnExit;
|
|
84
85
|
private _checkAutoPlay;
|
|
86
|
+
private _checkRevertOwner;
|
|
85
87
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
type PickOnlyOne<T extends {}, Keys extends keyof T = keyof T> = Keys extends unknown ? {
|
|
2
|
+
[K in Keys]: T[Keys];
|
|
3
|
+
} & {
|
|
4
|
+
[K in Exclude<keyof T, Keys>]?: never;
|
|
5
|
+
} : never;
|
|
1
6
|
/**
|
|
2
7
|
* Used to describe loading asset.
|
|
3
8
|
*/
|
|
4
9
|
export type LoadItem = {
|
|
5
|
-
/**
|
|
6
|
-
* Loading url.
|
|
7
|
-
*/
|
|
8
|
-
url?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Available when AssetType is TextureCube.
|
|
11
|
-
*/
|
|
12
|
-
urls?: string[];
|
|
13
10
|
/**
|
|
14
11
|
* Asset Type.
|
|
15
12
|
*/
|
|
@@ -30,4 +27,14 @@ export type LoadItem = {
|
|
|
30
27
|
* Additional parameters for specified loader.
|
|
31
28
|
*/
|
|
32
29
|
params?: Record<string, any>;
|
|
33
|
-
}
|
|
30
|
+
} & PickOnlyOne<{
|
|
31
|
+
/**
|
|
32
|
+
* Loading url.
|
|
33
|
+
*/
|
|
34
|
+
url: string;
|
|
35
|
+
/**
|
|
36
|
+
* Available when AssetType is TextureCube.
|
|
37
|
+
*/
|
|
38
|
+
urls: string[];
|
|
39
|
+
}>;
|
|
40
|
+
export {};
|
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/asset/request.d.ts
CHANGED
|
@@ -17,9 +17,13 @@ export declare class MultiExecutor {
|
|
|
17
17
|
private interval;
|
|
18
18
|
private _timeoutId;
|
|
19
19
|
private _currentCount;
|
|
20
|
+
private _onComplete;
|
|
21
|
+
private _onError;
|
|
22
|
+
private _error;
|
|
20
23
|
constructor(execFunc: (count?: number) => Promise<any>, totalCount: number, interval: number);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
start(): this;
|
|
25
|
+
onComplete(func: Function): this;
|
|
26
|
+
onError(func: Function): this;
|
|
27
|
+
cancel(): void;
|
|
24
28
|
private exec;
|
|
25
29
|
}
|
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;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* EventDispatcher, which can be inherited as a base class.
|
|
3
3
|
*/
|
|
4
4
|
export declare class EventDispatcher {
|
|
5
|
+
private static _dispatchingListenersPool;
|
|
5
6
|
private _events;
|
|
6
7
|
private _eventCount;
|
|
7
|
-
private _dispatchingListeners;
|
|
8
8
|
/**
|
|
9
9
|
* Determine whether there is event listening.
|
|
10
10
|
* @param event - Event name
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
|
+
import { Entity } from "../Entity";
|
|
2
3
|
/**
|
|
3
4
|
* Custom clone interface.
|
|
4
5
|
*/
|
|
@@ -10,5 +11,5 @@ export declare class ComponentCloner {
|
|
|
10
11
|
* @param source - Clone source
|
|
11
12
|
* @param target - Clone target
|
|
12
13
|
*/
|
|
13
|
-
static cloneComponent(source: Component, target: Component): void;
|
|
14
|
+
static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity): void;
|
|
14
15
|
}
|