@galacean/engine-core 1.0.0-beta.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +4854 -6253
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +4854 -6253
- package/dist/module.js +4850 -6245
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/SpriteAtlas.d.ts +6 -2
- package/types/2d/enums/SpriteDrawMode.d.ts +2 -4
- package/types/2d/index.d.ts +0 -1
- package/types/2d/sprite/Sprite.d.ts +6 -2
- package/types/2d/sprite/SpriteMask.d.ts +4 -4
- package/types/2d/sprite/SpriteRenderer.d.ts +1 -18
- package/types/2d/text/Font.d.ts +7 -2
- package/types/2d/text/TextRenderer.d.ts +0 -4
- package/types/2d/text/index.d.ts +0 -1
- package/types/Camera.d.ts +2 -28
- package/types/Component.d.ts +8 -0
- package/types/ComponentsDependencies.d.ts +9 -17
- package/types/Engine.d.ts +39 -31
- package/types/RenderPipeline/Basic2DBatcher.d.ts +7 -6
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +6 -8
- package/types/RenderPipeline/MeshRenderElement.d.ts +17 -0
- package/types/RenderPipeline/RenderElement.d.ts +7 -5
- package/types/RenderPipeline/RenderPass.d.ts +1 -1
- package/types/RenderPipeline/RenderQueue.d.ts +5 -3
- package/types/RenderPipeline/SpriteElement.d.ts +13 -0
- package/types/RenderPipeline/SpriteMaskBatcher.d.ts +3 -4
- package/types/RenderPipeline/SpriteMaskElement.d.ts +10 -0
- package/types/RenderPipeline/TextRenderElement.d.ts +6 -0
- package/types/Renderer.d.ts +2 -2
- package/types/Scene.d.ts +0 -2
- package/types/Script.d.ts +15 -18
- package/types/Transform.d.ts +12 -9
- package/types/Utils.d.ts +0 -28
- package/types/animation/AnimationClip.d.ts +1 -2
- package/types/asset/AssetType.d.ts +16 -16
- package/types/asset/IRefObject.d.ts +2 -0
- package/types/asset/{ReferResource.d.ts → RefObject.d.ts} +5 -5
- package/types/asset/ResourceManager.d.ts +9 -17
- package/types/base/Constant.d.ts +1 -2
- package/types/base/EngineObject.d.ts +0 -1
- package/types/base/Event.d.ts +24 -0
- package/types/base/EventDispatcher.d.ts +14 -1
- package/types/base/Time.d.ts +24 -27
- package/types/base/Util.d.ts +14 -0
- package/types/base/index.d.ts +2 -0
- package/types/graphic/Buffer.d.ts +9 -5
- package/types/graphic/Mesh.d.ts +5 -4
- package/types/index.d.ts +7 -8
- package/types/input/InputManager.d.ts +1 -1
- package/types/input/interface/IInput.d.ts +1 -1
- package/types/lighting/DirectLight.d.ts +1 -0
- package/types/lighting/SpotLight.d.ts +1 -0
- package/types/material/BaseMaterial.d.ts +8 -8
- package/types/material/Material.d.ts +7 -3
- package/types/mesh/BlendShape.d.ts +1 -1
- package/types/mesh/BlendShapeFrame.d.ts +6 -28
- package/types/mesh/ModelMesh.d.ts +5 -5
- package/types/mesh/PrimitiveMesh.d.ts +2 -4
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -0
- package/types/particle/ParticleRenderer.d.ts +2 -2
- package/types/physics/Collider.d.ts +1 -1
- package/types/physics/PhysicsManager.d.ts +20 -1
- package/types/physics/joint/Joint.d.ts +2 -2
- package/types/renderingHardwareInterface/index.d.ts +0 -1
- package/types/shader/Shader.d.ts +23 -32
- package/types/shader/ShaderData.d.ts +24 -24
- package/types/shader/ShaderMacro.d.ts +0 -16
- package/types/shader/ShaderPass.d.ts +2 -9
- package/types/shader/ShaderProperty.d.ts +0 -7
- package/types/shader/index.d.ts +1 -4
- package/types/shadow/CascadedShadowCasterPass.d.ts +1 -0
- package/types/sky/SkyBoxMaterial.d.ts +9 -30
- package/types/sky/index.d.ts +0 -1
- package/types/texture/RenderTarget.d.ts +4 -4
- package/types/texture/Texture.d.ts +6 -2
- package/types/texture/Texture2DArray.d.ts +0 -4
- package/types/texture/TextureCube.d.ts +0 -4
- package/types/2d/data/VertexData2D.d.ts +0 -1
- package/types/2d/enums/SpriteTileMode.d.ts +0 -11
- package/types/RenderPipeline/MeshRenderData.d.ts +0 -15
- package/types/RenderPipeline/RenderData.d.ts +0 -7
- package/types/RenderPipeline/SpriteMaskRenderData.d.ts +0 -10
- package/types/RenderPipeline/SpriteRenderData.d.ts +0 -12
- package/types/RenderPipeline/TextRenderData.d.ts +0 -6
- package/types/RenderPipeline/enums/PipelineStage.d.ts +0 -9
- package/types/RenderPipeline/index.d.ts +0 -4
- package/types/asset/ContentRestorer.d.ts +0 -17
- package/types/asset/GraphicsResource.d.ts +0 -9
- package/types/asset/IReferable.d.ts +0 -2
- package/types/mesh/PrimitiveMeshRestorer.d.ts +0 -1
- package/types/physics/Collision.d.ts +0 -4
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +0 -8
- package/types/shader/ShaderPart.d.ts +0 -41
- package/types/shader/ShaderTagKey.d.ts +0 -16
- package/types/shader/SubShader.d.ts +0 -19
- package/types/sky/SkyProceduralMaterial.d.ts +0 -72
- /package/types/2d/{assembler/TiledSpriteAssembler.d.ts → data/RenderData2D.d.ts} +0 -0
package/types/Script.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Camera } from "./Camera";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { Pointer } from "./input";
|
|
4
4
|
import { ColliderShape } from "./physics";
|
|
5
|
-
import { Collision } from "./physics/Collision";
|
|
6
5
|
/**
|
|
7
6
|
* Script class, used for logic writing.
|
|
8
7
|
*/
|
|
@@ -23,12 +22,12 @@ export declare class Script extends Component {
|
|
|
23
22
|
onStart(): void;
|
|
24
23
|
/**
|
|
25
24
|
* The main loop, called frame by frame.
|
|
26
|
-
* @param deltaTime - The
|
|
25
|
+
* @param deltaTime - The deltaTime when the script update.
|
|
27
26
|
*/
|
|
28
27
|
onUpdate(deltaTime: number): void;
|
|
29
28
|
/**
|
|
30
29
|
* Called after the onUpdate finished, called frame by frame.
|
|
31
|
-
* @param deltaTime - The
|
|
30
|
+
* @param deltaTime - The deltaTime when the script update.
|
|
32
31
|
*/
|
|
33
32
|
onLateUpdate(deltaTime: number): void;
|
|
34
33
|
/**
|
|
@@ -46,39 +45,37 @@ export declare class Script extends Component {
|
|
|
46
45
|
*/
|
|
47
46
|
onPhysicsUpdate(): void;
|
|
48
47
|
/**
|
|
49
|
-
* Called when the
|
|
48
|
+
* Called when the collision enter.
|
|
50
49
|
* @param other - ColliderShape
|
|
51
50
|
*/
|
|
52
51
|
onTriggerEnter(other: ColliderShape): void;
|
|
53
52
|
/**
|
|
54
|
-
* Called when the
|
|
53
|
+
* Called when the collision stay.
|
|
54
|
+
* @remarks onTriggerStay is called every frame while the collision stay.
|
|
55
55
|
* @param other - ColliderShape
|
|
56
56
|
*/
|
|
57
57
|
onTriggerExit(other: ColliderShape): void;
|
|
58
58
|
/**
|
|
59
|
-
* Called when the
|
|
60
|
-
* @remarks onTriggerStay is called every frame while the trigger stay.
|
|
59
|
+
* Called when the collision exit.
|
|
61
60
|
* @param other - ColliderShape
|
|
62
61
|
*/
|
|
63
62
|
onTriggerStay(other: ColliderShape): void;
|
|
64
63
|
/**
|
|
65
64
|
* Called when the collision enter.
|
|
66
|
-
* @param other -
|
|
67
|
-
* @remarks The Collision data will be invalid after this call, you should copy the data if needed.
|
|
65
|
+
* @param other - ColliderShape
|
|
68
66
|
*/
|
|
69
|
-
onCollisionEnter(other:
|
|
67
|
+
onCollisionEnter(other: ColliderShape): void;
|
|
70
68
|
/**
|
|
71
|
-
* Called when the collision
|
|
72
|
-
* @
|
|
73
|
-
* @
|
|
69
|
+
* Called when the collision stay.
|
|
70
|
+
* @remarks onTriggerStay is called every frame while the collision stay.
|
|
71
|
+
* @param other - ColliderShape
|
|
74
72
|
*/
|
|
75
|
-
onCollisionExit(other:
|
|
73
|
+
onCollisionExit(other: ColliderShape): void;
|
|
76
74
|
/**
|
|
77
|
-
* Called when the collision
|
|
78
|
-
* @param other -
|
|
79
|
-
* @remarks The Collision data will be invalid after this call, you should copy the data if needed.
|
|
75
|
+
* Called when the collision exit.
|
|
76
|
+
* @param other - ColliderShape
|
|
80
77
|
*/
|
|
81
|
-
onCollisionStay(other:
|
|
78
|
+
onCollisionStay(other: ColliderShape): void;
|
|
82
79
|
/**
|
|
83
80
|
* Called when the pointer is down while over the ColliderShape.
|
|
84
81
|
* @param pointer - The pointer that triggered
|
package/types/Transform.d.ts
CHANGED
|
@@ -24,9 +24,6 @@ export declare class Transform extends Component {
|
|
|
24
24
|
private _lossyWorldScale;
|
|
25
25
|
private _localMatrix;
|
|
26
26
|
private _worldMatrix;
|
|
27
|
-
private _worldForward;
|
|
28
|
-
private _worldRight;
|
|
29
|
-
private _worldUp;
|
|
30
27
|
private _isParentDirty;
|
|
31
28
|
private _parentTransformCache;
|
|
32
29
|
private _dirtyFlag;
|
|
@@ -138,17 +135,23 @@ export declare class Transform extends Component {
|
|
|
138
135
|
*/
|
|
139
136
|
setWorldRotationQuaternion(x: number, y: number, z: number, w: number): void;
|
|
140
137
|
/**
|
|
141
|
-
*
|
|
138
|
+
* Get the forward direction in world space.
|
|
139
|
+
* @param forward - Forward vector
|
|
140
|
+
* @returns Forward vector
|
|
142
141
|
*/
|
|
143
|
-
|
|
142
|
+
getWorldForward(forward: Vector3): Vector3;
|
|
144
143
|
/**
|
|
145
|
-
*
|
|
144
|
+
* Get the right direction in world space.
|
|
145
|
+
* @param right - Right vector
|
|
146
|
+
* @returns Right vector
|
|
146
147
|
*/
|
|
147
|
-
|
|
148
|
+
getWorldRight(right: Vector3): Vector3;
|
|
148
149
|
/**
|
|
149
|
-
*
|
|
150
|
+
* Get the up direction in world space.
|
|
151
|
+
* @param up - Up vector
|
|
152
|
+
* @returns Up vector
|
|
150
153
|
*/
|
|
151
|
-
|
|
154
|
+
getWorldUp(up: Vector3): Vector3;
|
|
152
155
|
/**
|
|
153
156
|
* Translate in the direction and distance of the translation.
|
|
154
157
|
* @param translation - Direction and distance of translation
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
1
|
export declare class Utils {
|
|
2
|
-
/**
|
|
3
|
-
* Fast remove an element from array.
|
|
4
|
-
* @param array - Array
|
|
5
|
-
* @param item - Element
|
|
6
|
-
*/
|
|
7
|
-
static removeFromArray(array: any[], item: any): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Decodes a given Uint8Array into a string.
|
|
10
|
-
*/
|
|
11
|
-
static decodeText(array: Uint8Array): string;
|
|
12
|
-
/**
|
|
13
|
-
* Judge whether the url is absolute url.
|
|
14
|
-
* @param url - The url to be judged.
|
|
15
|
-
* @returns Whether the url is absolute url.
|
|
16
|
-
*/
|
|
17
|
-
static isAbsoluteUrl(url: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Get the values of an object.
|
|
20
|
-
*/
|
|
21
|
-
static objectValues(obj: any): any[];
|
|
22
|
-
/**
|
|
23
|
-
* Convert a relative URL to an absolute URL based on a given base URL.
|
|
24
|
-
* @param baseUrl - The base url.
|
|
25
|
-
* @param relativeUrl - The relative url.
|
|
26
|
-
* @returns The resolved url.
|
|
27
|
-
*/
|
|
28
|
-
static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
|
|
29
2
|
private static _stringToPath;
|
|
30
|
-
private static _formatRelativePath;
|
|
31
3
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EngineObject } from "../base/EngineObject";
|
|
2
1
|
import { Component } from "../Component";
|
|
3
2
|
import { Entity } from "../Entity";
|
|
4
3
|
import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
|
|
@@ -8,7 +7,7 @@ import { KeyframeValueType } from "./Keyframe";
|
|
|
8
7
|
/**
|
|
9
8
|
* Stores keyframe based animations.
|
|
10
9
|
*/
|
|
11
|
-
export declare class AnimationClip
|
|
10
|
+
export declare class AnimationClip {
|
|
12
11
|
readonly name: string;
|
|
13
12
|
private _length;
|
|
14
13
|
private _events;
|
|
@@ -6,47 +6,47 @@ export declare enum AssetType {
|
|
|
6
6
|
* Plain text.
|
|
7
7
|
* @remarks Will not be cached based on url in ResourceManager.
|
|
8
8
|
*/
|
|
9
|
-
Text = "
|
|
9
|
+
Text = "text",
|
|
10
10
|
/**
|
|
11
11
|
* JSON.
|
|
12
12
|
* @remarks Will not be cached based on url in ResourceManager.
|
|
13
13
|
*/
|
|
14
|
-
JSON = "
|
|
14
|
+
JSON = "json",
|
|
15
15
|
/**
|
|
16
16
|
* ArrayBuffer.
|
|
17
17
|
* @remarks Will not be cached based on url in ResourceManager.
|
|
18
18
|
*/
|
|
19
|
-
Buffer = "
|
|
19
|
+
Buffer = "buffer",
|
|
20
20
|
/** 2D Texture. */
|
|
21
|
-
Texture2D = "
|
|
21
|
+
Texture2D = "texture2d",
|
|
22
22
|
/** Cube Texture. */
|
|
23
|
-
TextureCube = "
|
|
23
|
+
TextureCube = "texture-cube",
|
|
24
24
|
/** Material. */
|
|
25
|
-
Material = "
|
|
25
|
+
Material = "material",
|
|
26
26
|
/** Mesh. */
|
|
27
|
-
Mesh = "
|
|
27
|
+
Mesh = "mesh",
|
|
28
28
|
/** AnimationClip. */
|
|
29
29
|
AnimationClip = "AnimationClip",
|
|
30
30
|
/** AnimatorController. */
|
|
31
31
|
AnimatorController = "AnimatorController",
|
|
32
32
|
/** Prefab.*/
|
|
33
|
-
|
|
33
|
+
Prefab = "prefab",
|
|
34
34
|
/** Compress Texture. */
|
|
35
|
-
KTX = "
|
|
35
|
+
KTX = "ktx",
|
|
36
36
|
/** Cube Compress Texture. */
|
|
37
|
-
KTXCube = "
|
|
37
|
+
KTXCube = "ktx-cube",
|
|
38
38
|
/** Sprite. */
|
|
39
|
-
Sprite = "
|
|
39
|
+
Sprite = "sprite",
|
|
40
40
|
/** Sprite Atlas. */
|
|
41
|
-
SpriteAtlas = "
|
|
41
|
+
SpriteAtlas = "sprite-atlas",
|
|
42
42
|
/** Ambient light. */
|
|
43
|
-
Env = "
|
|
43
|
+
Env = "environment",
|
|
44
44
|
/** Scene. */
|
|
45
|
-
Scene = "
|
|
45
|
+
Scene = "scene",
|
|
46
46
|
/** HDR to cube. */
|
|
47
47
|
HDR = "HDR",
|
|
48
48
|
/** Font. */
|
|
49
|
-
Font = "
|
|
49
|
+
Font = "font",
|
|
50
50
|
/** Source Font, include ttf、 otf and woff. */
|
|
51
|
-
SourceFont = "
|
|
51
|
+
SourceFont = "source-font"
|
|
52
52
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EngineObject } from "../base/EngineObject";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import {
|
|
3
|
+
import { IRefObject } from "./IRefObject";
|
|
4
4
|
/**
|
|
5
5
|
* The base class of assets, with reference counting capability.
|
|
6
6
|
*/
|
|
7
|
-
export declare abstract class
|
|
7
|
+
export declare abstract class RefObject extends EngineObject implements IRefObject {
|
|
8
8
|
/** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
|
|
9
9
|
isGCIgnored: boolean;
|
|
10
10
|
private _refCount;
|
|
@@ -14,14 +14,14 @@ export declare abstract class ReferResource extends EngineObject implements IRef
|
|
|
14
14
|
get refCount(): number;
|
|
15
15
|
protected constructor(engine: Engine);
|
|
16
16
|
/**
|
|
17
|
-
* @override
|
|
18
17
|
* Destroy self.
|
|
19
18
|
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
20
19
|
* @returns Whether the release was successful.
|
|
21
20
|
*/
|
|
22
21
|
destroy(force?: boolean): boolean;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* Called when the resource is destroyed.
|
|
24
|
+
* Subclasses can override this function.
|
|
25
25
|
*/
|
|
26
|
-
protected _onDestroy(): void;
|
|
26
|
+
protected abstract _onDestroy(): void;
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Engine } from "..";
|
|
2
2
|
import { AssetPromise } from "./AssetPromise";
|
|
3
3
|
import { Loader } from "./Loader";
|
|
4
4
|
import { LoadItem } from "./LoadItem";
|
|
@@ -17,17 +17,14 @@ export declare class ResourceManager {
|
|
|
17
17
|
retryInterval: number;
|
|
18
18
|
/** The default timeout period for loading assets, in milliseconds. */
|
|
19
19
|
timeout: number;
|
|
20
|
-
|
|
21
|
-
/** Asset path pool, key is the `instanceID` of resource, value is asset path. */
|
|
20
|
+
/** Asset path pool, key is asset ID, value is asset path */
|
|
22
21
|
private _assetPool;
|
|
23
|
-
/** Asset
|
|
22
|
+
/** Asset pool, the key is the asset path and the value is the asset. */
|
|
24
23
|
private _assetUrlPool;
|
|
25
|
-
/**
|
|
26
|
-
private
|
|
27
|
-
/**
|
|
28
|
-
private
|
|
29
|
-
/** Restorable resource information pool, key is the `instanceID` of resource. */
|
|
30
|
-
private _contentRestorerPool;
|
|
24
|
+
/** Reference counted object pool, key is the object ID, and reference counted objects are put into this pool. */
|
|
25
|
+
private _refObjectPool;
|
|
26
|
+
/** Loading promises. */
|
|
27
|
+
private _loadingPromises;
|
|
31
28
|
/**
|
|
32
29
|
* Create a ResourceManager.
|
|
33
30
|
* @param engine - Engine to which the current ResourceManager belongs
|
|
@@ -88,11 +85,6 @@ export declare class ResourceManager {
|
|
|
88
85
|
* @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
|
|
89
86
|
*/
|
|
90
87
|
gc(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Add content restorer.
|
|
93
|
-
* @param restorer - The restorer
|
|
94
|
-
*/
|
|
95
|
-
addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
|
|
96
88
|
private _assignDefaultOptions;
|
|
97
89
|
private _loadSingleItem;
|
|
98
90
|
private _gc;
|
|
@@ -104,6 +96,6 @@ export declare class ResourceManager {
|
|
|
104
96
|
/**
|
|
105
97
|
* Declare ResourceLoader's decorator.
|
|
106
98
|
* @param assetType - Type of asset
|
|
107
|
-
* @param
|
|
99
|
+
* @param extnames - Name of file extension
|
|
108
100
|
*/
|
|
109
|
-
export declare function resourceLoader(assetType: string,
|
|
101
|
+
export declare function resourceLoader(assetType: string, extnames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
|
package/types/base/Constant.d.ts
CHANGED
|
@@ -105,7 +105,6 @@ export declare enum GLCapabilityType {
|
|
|
105
105
|
pvrtc = "WEBGL_compressed_texture_pvrtc",
|
|
106
106
|
pvrtc_webkit = "WEBKIT_WEBGL_compressed_texture_pvrtc",
|
|
107
107
|
s3tc = "WEBGL_compressed_texture_s3tc",
|
|
108
|
-
s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc"
|
|
109
|
-
WEBGL_lose_context = "WEBGL_lose_context"
|
|
108
|
+
s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc"
|
|
110
109
|
}
|
|
111
110
|
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventDispatcher } from "./EventDispatcher";
|
|
2
|
+
export type Listener = ((e: Event) => any) & {
|
|
3
|
+
once?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** Event Object. * @class */
|
|
6
|
+
export declare class Event {
|
|
7
|
+
get propagationStopped(): boolean;
|
|
8
|
+
get target(): EventDispatcher;
|
|
9
|
+
set target(t: EventDispatcher);
|
|
10
|
+
get timeStamp(): number;
|
|
11
|
+
get currentTarget(): EventDispatcher;
|
|
12
|
+
set currentTarget(t: EventDispatcher);
|
|
13
|
+
get bubbles(): boolean;
|
|
14
|
+
get type(): string | number;
|
|
15
|
+
data: any;
|
|
16
|
+
private _timeStamp;
|
|
17
|
+
private _target;
|
|
18
|
+
private _currentTarget;
|
|
19
|
+
private _bubbles;
|
|
20
|
+
private _propagationStopped;
|
|
21
|
+
private _type;
|
|
22
|
+
constructor(type: string | number, target?: EventDispatcher, data?: any, bubbles?: boolean);
|
|
23
|
+
stopPropagation(): void;
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Event } from "./Event";
|
|
1
2
|
/**
|
|
2
3
|
* EventDispatcher, which can be inherited as a base class.
|
|
3
4
|
*/
|
|
@@ -43,6 +44,15 @@ export declare class EventDispatcher {
|
|
|
43
44
|
* @returns This
|
|
44
45
|
*/
|
|
45
46
|
once(event: string, fn: Function): EventDispatcher;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use `on/once` instead.
|
|
49
|
+
* Add a listener function with the specified event name.
|
|
50
|
+
* @param event - Event name
|
|
51
|
+
* @param fn - Function
|
|
52
|
+
* @param once - Is it a one-time listener
|
|
53
|
+
* @returns this
|
|
54
|
+
*/
|
|
55
|
+
addEventListener(event: string, fn: Function, once?: boolean): EventDispatcher;
|
|
46
56
|
/**
|
|
47
57
|
* Remove the event listener(s) of the specified event name.
|
|
48
58
|
* @param event - Event name
|
|
@@ -61,6 +71,9 @@ export declare class EventDispatcher {
|
|
|
61
71
|
* @param event - Event name, delete all events if not passed
|
|
62
72
|
*/
|
|
63
73
|
removeAllEventListeners(event?: string): void;
|
|
64
|
-
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Use `dispatch` instead.
|
|
76
|
+
*/
|
|
77
|
+
trigger(e: Event): void;
|
|
65
78
|
private _clearEvent;
|
|
66
79
|
}
|
package/types/base/Time.d.ts
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Tools for calculating the time per frame.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Time {
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private _frameCount;
|
|
5
|
+
private _clock;
|
|
6
|
+
private _timeScale;
|
|
8
7
|
private _deltaTime;
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private _actualElapsedTime;
|
|
12
|
-
private _lastSystemTime;
|
|
13
|
-
private _elapsedTimeValue;
|
|
14
|
-
private _deltaTimeValue;
|
|
15
|
-
/** Maximum delta time allowed per frame in seconds. */
|
|
16
|
-
maximumDeltaTime: number;
|
|
17
|
-
/** The scale of time. */
|
|
18
|
-
timeScale: number;
|
|
8
|
+
private _startTime;
|
|
9
|
+
private _lastTickTime;
|
|
19
10
|
get frameCount(): number;
|
|
20
11
|
/**
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
* Constructor of the Time.
|
|
13
|
+
*/
|
|
14
|
+
constructor();
|
|
15
|
+
reset(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Current Time
|
|
18
|
+
*/
|
|
19
|
+
get nowTime(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Time between two ticks
|
|
24
22
|
*/
|
|
25
23
|
get deltaTime(): number;
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
25
|
+
* Scaled delta time.
|
|
28
26
|
*/
|
|
29
|
-
get
|
|
27
|
+
get timeScale(): number;
|
|
28
|
+
set timeScale(s: number);
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @remarks The actual delta time is not affected by `maximumDeltaTime` and `timeScale`.
|
|
30
|
+
* Unscaled delta time.
|
|
34
31
|
*/
|
|
35
|
-
get
|
|
32
|
+
get unscaledDeltaTime(): number;
|
|
36
33
|
/**
|
|
37
|
-
* The
|
|
34
|
+
* The elapsed time, after the clock is initialized.
|
|
38
35
|
*/
|
|
39
|
-
get
|
|
36
|
+
get timeSinceStartup(): number;
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
38
|
+
* Call every frame, update delta time and other data.
|
|
42
39
|
*/
|
|
43
|
-
|
|
40
|
+
tick(): void;
|
|
44
41
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Util: {
|
|
2
|
+
isArray: (value: any) => boolean;
|
|
3
|
+
isArrayLike(x: any): boolean;
|
|
4
|
+
clone<T>(obj: T): T;
|
|
5
|
+
downloadBlob(blob: Blob, fileName?: string): void;
|
|
6
|
+
};
|
|
7
|
+
export declare const isArrayLike: <T>(x: any) => x is ArrayLike<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Fastly remove an element from array.
|
|
10
|
+
* @param array - Array
|
|
11
|
+
* @param item - Element
|
|
12
|
+
*/
|
|
13
|
+
export declare function removeFromArray(array: any[], item: any): boolean;
|
|
14
|
+
export declare function ObjectValues(obj: any): any[];
|
package/types/base/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { Event } from "./Event";
|
|
1
2
|
export { EventDispatcher } from "./EventDispatcher";
|
|
2
3
|
export { Logger } from "./Logger";
|
|
3
4
|
export { Time } from "./Time";
|
|
5
|
+
export { Util, ObjectValues } from "./Util";
|
|
4
6
|
export { EngineObject } from "./EngineObject";
|
|
5
7
|
export * from "./Constant";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RefObject } from "../asset/RefObject";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { BufferBindFlag } from "./enums/BufferBindFlag";
|
|
4
4
|
import { BufferUsage } from "./enums/BufferUsage";
|
|
@@ -6,11 +6,14 @@ import { SetDataOptions } from "./enums/SetDataOptions";
|
|
|
6
6
|
/**
|
|
7
7
|
* Buffer.
|
|
8
8
|
*/
|
|
9
|
-
export declare class Buffer extends
|
|
9
|
+
export declare class Buffer extends RefObject {
|
|
10
|
+
_glBindTarget: number;
|
|
11
|
+
_glBufferUsage: number;
|
|
12
|
+
_nativeBuffer: WebGLBuffer;
|
|
13
|
+
private _hardwareRenderer;
|
|
10
14
|
private _type;
|
|
11
15
|
private _byteLength;
|
|
12
16
|
private _bufferUsage;
|
|
13
|
-
private _platformBuffer;
|
|
14
17
|
/**
|
|
15
18
|
* Buffer binding flag.
|
|
16
19
|
*/
|
|
@@ -92,10 +95,11 @@ export declare class Buffer extends GraphicsResource {
|
|
|
92
95
|
getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
|
|
93
96
|
/**
|
|
94
97
|
* @override
|
|
98
|
+
* Destroy.
|
|
95
99
|
*/
|
|
96
|
-
|
|
100
|
+
_onDestroy(): void;
|
|
97
101
|
/**
|
|
98
102
|
* @deprecated
|
|
99
103
|
*/
|
|
100
|
-
resize(
|
|
104
|
+
resize(dataLength: number): void;
|
|
101
105
|
}
|
package/types/graphic/Mesh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
-
import {
|
|
2
|
+
import { RefObject } from "../asset/RefObject";
|
|
3
3
|
import { Engine } from "../Engine";
|
|
4
4
|
import { MeshTopology } from "../graphic/enums/MeshTopology";
|
|
5
5
|
import { IndexBufferBinding } from "../graphic/IndexBufferBinding";
|
|
@@ -8,7 +8,7 @@ import { VertexElement } from "../graphic/VertexElement";
|
|
|
8
8
|
/**
|
|
9
9
|
* Mesh.
|
|
10
10
|
*/
|
|
11
|
-
export declare abstract class Mesh extends
|
|
11
|
+
export declare abstract class Mesh extends RefObject {
|
|
12
12
|
/** Name. */
|
|
13
13
|
name: string;
|
|
14
14
|
private _bounds;
|
|
@@ -58,11 +58,12 @@ export declare abstract class Mesh extends GraphicsResource {
|
|
|
58
58
|
/**
|
|
59
59
|
* @override
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
_addRefCount(value: number): void;
|
|
62
62
|
/**
|
|
63
63
|
* @override
|
|
64
|
+
* Destroy.
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
_onDestroy(): void;
|
|
66
67
|
protected _setVertexElements(elements: VertexElement[]): void;
|
|
67
68
|
protected _setIndexBufferBinding(binding: IndexBufferBinding | null): void;
|
|
68
69
|
private _onBoundsChanged;
|
package/types/index.d.ts
CHANGED
|
@@ -8,21 +8,23 @@ export { Entity } from "./Entity";
|
|
|
8
8
|
export { Component } from "./Component";
|
|
9
9
|
export { Script } from "./Script";
|
|
10
10
|
export { Renderer } from "./Renderer";
|
|
11
|
-
export { dependentComponents
|
|
11
|
+
export { dependentComponents } from "./ComponentsDependencies";
|
|
12
12
|
export { Camera } from "./Camera";
|
|
13
13
|
export { Transform } from "./Transform";
|
|
14
14
|
export { BoolUpdateFlag } from "./BoolUpdateFlag";
|
|
15
15
|
export type { EngineSettings } from "./EngineSettings";
|
|
16
|
-
export type { EngineConfiguration } from "./Engine";
|
|
17
16
|
export { request } from "./asset/request";
|
|
18
17
|
export { Loader } from "./asset/Loader";
|
|
19
|
-
export { ContentRestorer } from "./asset/ContentRestorer";
|
|
20
18
|
export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
|
|
21
19
|
export { AssetPromise } from "./asset/AssetPromise";
|
|
22
20
|
export type { LoadItem } from "./asset/LoadItem";
|
|
23
21
|
export { AssetType } from "./asset/AssetType";
|
|
24
|
-
export {
|
|
25
|
-
export
|
|
22
|
+
export { RefObject } from "./asset/RefObject";
|
|
23
|
+
export { BasicRenderPipeline } from "./RenderPipeline/BasicRenderPipeline";
|
|
24
|
+
export { RenderQueue } from "./RenderPipeline/RenderQueue";
|
|
25
|
+
export { RenderPass } from "./RenderPipeline/RenderPass";
|
|
26
|
+
export { MeshRenderElement } from "./RenderPipeline/MeshRenderElement";
|
|
27
|
+
export { SpriteElement } from "./RenderPipeline/SpriteElement";
|
|
26
28
|
export * from "./base";
|
|
27
29
|
export { Background } from "./Background";
|
|
28
30
|
export { BackgroundMode } from "./enums/BackgroundMode";
|
|
@@ -49,6 +51,3 @@ export * from "./Layer";
|
|
|
49
51
|
export * from "./clone/CloneManager";
|
|
50
52
|
export * from "./renderingHardwareInterface/index";
|
|
51
53
|
export * from "./physics/index";
|
|
52
|
-
export * from "./Utils";
|
|
53
|
-
export { Basic2DBatcher } from "./RenderPipeline/Basic2DBatcher";
|
|
54
|
-
export { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
|
|
@@ -6,9 +6,9 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
6
6
|
* InputManager manages device input such as mouse, touch, keyboard, etc.
|
|
7
7
|
*/
|
|
8
8
|
export declare class InputManager {
|
|
9
|
-
private _engine;
|
|
10
9
|
/** Sometimes the input module will not be initialized, such as off-screen rendering. */
|
|
11
10
|
private _initialized;
|
|
11
|
+
private _curFrameCount;
|
|
12
12
|
private _wheelManager;
|
|
13
13
|
private _pointerManager;
|
|
14
14
|
private _keyboardManager;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
|
-
import { Shader
|
|
2
|
+
import { Shader } from "../shader";
|
|
3
3
|
import { ShaderMacro } from "../shader/ShaderMacro";
|
|
4
4
|
import { BlendMode } from "./enums/BlendMode";
|
|
5
5
|
import { RenderFace } from "./enums/RenderFace";
|
|
6
6
|
import { Material } from "./Material";
|
|
7
7
|
export declare class BaseMaterial extends Material {
|
|
8
|
+
protected static _baseColorProp: import("../shader").ShaderProperty;
|
|
9
|
+
protected static _baseTextureProp: import("../shader").ShaderProperty;
|
|
8
10
|
protected static _baseTextureMacro: ShaderMacro;
|
|
11
|
+
protected static _tilingOffsetProp: import("../shader").ShaderProperty;
|
|
12
|
+
protected static _normalTextureProp: import("../shader").ShaderProperty;
|
|
13
|
+
protected static _normalIntensityProp: import("../shader").ShaderProperty;
|
|
9
14
|
protected static _normalTextureMacro: ShaderMacro;
|
|
15
|
+
protected static _emissiveColorProp: import("../shader").ShaderProperty;
|
|
16
|
+
protected static _emissiveTextureProp: import("../shader").ShaderProperty;
|
|
10
17
|
protected static _emissiveTextureMacro: ShaderMacro;
|
|
11
18
|
protected static _transparentMacro: ShaderMacro;
|
|
12
|
-
protected static _baseColorProp: ShaderProperty;
|
|
13
|
-
protected static _baseTextureProp: ShaderProperty;
|
|
14
|
-
protected static _tilingOffsetProp: ShaderProperty;
|
|
15
|
-
protected static _normalTextureProp: ShaderProperty;
|
|
16
|
-
protected static _normalIntensityProp: ShaderProperty;
|
|
17
|
-
protected static _emissiveColorProp: ShaderProperty;
|
|
18
|
-
protected static _emissiveTextureProp: ShaderProperty;
|
|
19
19
|
private static _alphaCutoffProp;
|
|
20
20
|
private static _alphaCutoffMacro;
|
|
21
21
|
private _renderFace;
|