@galacean/engine-core 0.9.0 → 1.0.0-beta.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 +6175 -4776
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +6175 -4776
- package/dist/module.js +6167 -4772
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
- package/types/2d/data/VertexData2D.d.ts +1 -0
- package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
- package/types/2d/enums/SpriteTileMode.d.ts +11 -0
- package/types/2d/index.d.ts +1 -0
- package/types/2d/sprite/Sprite.d.ts +2 -6
- package/types/2d/sprite/SpriteMask.d.ts +4 -4
- package/types/2d/sprite/SpriteRenderer.d.ts +18 -1
- package/types/2d/text/Font.d.ts +2 -7
- package/types/2d/text/TextRenderer.d.ts +4 -0
- package/types/2d/text/index.d.ts +1 -0
- package/types/Camera.d.ts +28 -2
- package/types/Component.d.ts +0 -8
- package/types/ComponentsDependencies.d.ts +17 -9
- package/types/Engine.d.ts +31 -39
- package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
- package/types/RenderPipeline/MeshRenderData.d.ts +15 -0
- package/types/RenderPipeline/RenderData.d.ts +7 -0
- package/types/RenderPipeline/RenderElement.d.ts +5 -7
- package/types/RenderPipeline/RenderPass.d.ts +1 -1
- package/types/RenderPipeline/RenderQueue.d.ts +3 -5
- package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
- package/types/RenderPipeline/SpriteMaskRenderData.d.ts +10 -0
- package/types/RenderPipeline/SpriteRenderData.d.ts +12 -0
- package/types/RenderPipeline/TextRenderData.d.ts +6 -0
- package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
- package/types/RenderPipeline/index.d.ts +4 -0
- package/types/Renderer.d.ts +2 -2
- package/types/Scene.d.ts +2 -0
- package/types/Script.d.ts +18 -15
- package/types/Transform.d.ts +9 -12
- package/types/Utils.d.ts +28 -0
- package/types/animation/AnimationClip.d.ts +2 -1
- package/types/asset/AssetType.d.ts +16 -16
- package/types/asset/ContentRestorer.d.ts +17 -0
- package/types/asset/GraphicsResource.d.ts +9 -0
- package/types/asset/IReferable.d.ts +2 -0
- package/types/asset/{RefObject.d.ts → ReferResource.d.ts} +5 -5
- package/types/asset/ResourceManager.d.ts +17 -9
- package/types/base/Constant.d.ts +2 -1
- package/types/base/EngineObject.d.ts +1 -0
- package/types/base/EventDispatcher.d.ts +1 -14
- package/types/base/Time.d.ts +27 -24
- package/types/base/index.d.ts +0 -2
- package/types/graphic/Buffer.d.ts +5 -9
- package/types/graphic/Mesh.d.ts +4 -5
- package/types/index.d.ts +8 -7
- package/types/input/InputManager.d.ts +1 -1
- package/types/input/interface/IInput.d.ts +1 -1
- package/types/lighting/DirectLight.d.ts +0 -1
- package/types/lighting/SpotLight.d.ts +0 -1
- package/types/material/BaseMaterial.d.ts +8 -8
- package/types/material/Material.d.ts +3 -7
- package/types/mesh/BlendShape.d.ts +1 -1
- package/types/mesh/BlendShapeFrame.d.ts +28 -6
- package/types/mesh/ModelMesh.d.ts +5 -5
- package/types/mesh/PrimitiveMesh.d.ts +4 -2
- package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +0 -1
- package/types/particle/ParticleRenderer.d.ts +2 -2
- package/types/physics/Collider.d.ts +1 -1
- package/types/physics/Collision.d.ts +4 -0
- package/types/physics/PhysicsManager.d.ts +1 -20
- package/types/physics/joint/Joint.d.ts +2 -2
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
- package/types/renderingHardwareInterface/index.d.ts +1 -0
- package/types/shader/Shader.d.ts +32 -23
- package/types/shader/ShaderData.d.ts +24 -24
- package/types/shader/ShaderMacro.d.ts +16 -0
- package/types/shader/ShaderPart.d.ts +41 -0
- package/types/shader/ShaderPass.d.ts +9 -2
- package/types/shader/ShaderProperty.d.ts +7 -0
- package/types/shader/ShaderTagKey.d.ts +16 -0
- package/types/shader/SubShader.d.ts +19 -0
- package/types/shader/index.d.ts +4 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/sky/SkyBoxMaterial.d.ts +30 -9
- package/types/sky/SkyProceduralMaterial.d.ts +72 -0
- package/types/sky/index.d.ts +1 -0
- package/types/texture/RenderTarget.d.ts +4 -4
- package/types/texture/Texture.d.ts +2 -6
- package/types/texture/Texture2DArray.d.ts +4 -0
- package/types/texture/TextureCube.d.ts +4 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +0 -17
- package/types/RenderPipeline/SpriteElement.d.ts +0 -13
- package/types/RenderPipeline/SpriteMaskElement.d.ts +0 -10
- package/types/RenderPipeline/TextRenderElement.d.ts +0 -6
- package/types/asset/IRefObject.d.ts +0 -2
- package/types/base/Event.d.ts +0 -24
- package/types/base/Util.d.ts +0 -14
- /package/types/2d/{data/RenderData2D.d.ts → assembler/TiledSpriteAssembler.d.ts} +0 -0
package/types/Renderer.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
4
4
|
import { TransformModifyFlags } from "./Transform";
|
|
5
|
-
import { Material } from "./material/Material";
|
|
6
5
|
import { ShaderData } from "./shader/ShaderData";
|
|
6
|
+
import { Material } from "./material";
|
|
7
7
|
/**
|
|
8
8
|
* Basis for all renderers.
|
|
9
|
-
* @decorator `@dependentComponents(Transform)`
|
|
9
|
+
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
10
10
|
*/
|
|
11
11
|
export declare class Renderer extends Component {
|
|
12
12
|
private static _tempVector0;
|
package/types/Scene.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { ShadowResolution } from "./shadow/enum/ShadowResolution";
|
|
|
14
14
|
export declare class Scene extends EngineObject {
|
|
15
15
|
private static _fogColorProperty;
|
|
16
16
|
private static _fogParamsProperty;
|
|
17
|
+
private static _sunlightColorProperty;
|
|
18
|
+
private static _sunlightDirectionProperty;
|
|
17
19
|
/** Scene name. */
|
|
18
20
|
name: string;
|
|
19
21
|
/** The background of the scene. */
|
package/types/Script.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ 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";
|
|
5
6
|
/**
|
|
6
7
|
* Script class, used for logic writing.
|
|
7
8
|
*/
|
|
@@ -22,12 +23,12 @@ export declare class Script extends Component {
|
|
|
22
23
|
onStart(): void;
|
|
23
24
|
/**
|
|
24
25
|
* The main loop, called frame by frame.
|
|
25
|
-
* @param deltaTime - The
|
|
26
|
+
* @param deltaTime - The delta time since last frame in seconds
|
|
26
27
|
*/
|
|
27
28
|
onUpdate(deltaTime: number): void;
|
|
28
29
|
/**
|
|
29
30
|
* Called after the onUpdate finished, called frame by frame.
|
|
30
|
-
* @param deltaTime - The
|
|
31
|
+
* @param deltaTime - The delta time since last frame in seconds
|
|
31
32
|
*/
|
|
32
33
|
onLateUpdate(deltaTime: number): void;
|
|
33
34
|
/**
|
|
@@ -45,37 +46,39 @@ export declare class Script extends Component {
|
|
|
45
46
|
*/
|
|
46
47
|
onPhysicsUpdate(): void;
|
|
47
48
|
/**
|
|
48
|
-
* Called when the
|
|
49
|
+
* Called when the trigger enter.
|
|
49
50
|
* @param other - ColliderShape
|
|
50
51
|
*/
|
|
51
52
|
onTriggerEnter(other: ColliderShape): void;
|
|
52
53
|
/**
|
|
53
|
-
* Called when the
|
|
54
|
-
* @remarks onTriggerStay is called every frame while the collision stay.
|
|
54
|
+
* Called when the trigger exit.
|
|
55
55
|
* @param other - ColliderShape
|
|
56
56
|
*/
|
|
57
57
|
onTriggerExit(other: ColliderShape): void;
|
|
58
58
|
/**
|
|
59
|
-
* Called when the
|
|
59
|
+
* Called when the trigger stay.
|
|
60
|
+
* @remarks onTriggerStay is called every frame while the trigger stay.
|
|
60
61
|
* @param other - ColliderShape
|
|
61
62
|
*/
|
|
62
63
|
onTriggerStay(other: ColliderShape): void;
|
|
63
64
|
/**
|
|
64
65
|
* Called when the collision enter.
|
|
65
|
-
* @param other -
|
|
66
|
+
* @param other - The Collision data associated with this collision event
|
|
67
|
+
* @remarks The Collision data will be invalid after this call, you should copy the data if needed.
|
|
66
68
|
*/
|
|
67
|
-
onCollisionEnter(other:
|
|
69
|
+
onCollisionEnter(other: Collision): void;
|
|
68
70
|
/**
|
|
69
|
-
* Called when the collision
|
|
70
|
-
* @
|
|
71
|
-
* @
|
|
71
|
+
* Called when the collision exit.
|
|
72
|
+
* @param other - The Collision data associated with this collision event
|
|
73
|
+
* @remarks The Collision data will be invalid after this call, you should copy the data if needed.
|
|
72
74
|
*/
|
|
73
|
-
onCollisionExit(other:
|
|
75
|
+
onCollisionExit(other: Collision): void;
|
|
74
76
|
/**
|
|
75
|
-
* Called when the collision
|
|
76
|
-
* @param other -
|
|
77
|
+
* Called when the collision stay.
|
|
78
|
+
* @param other - The Collision data associated with this collision event
|
|
79
|
+
* @remarks The Collision data will be invalid after this call, you should copy the data if needed.
|
|
77
80
|
*/
|
|
78
|
-
onCollisionStay(other:
|
|
81
|
+
onCollisionStay(other: Collision): void;
|
|
79
82
|
/**
|
|
80
83
|
* Called when the pointer is down while over the ColliderShape.
|
|
81
84
|
* @param pointer - The pointer that triggered
|
package/types/Transform.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ 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;
|
|
27
30
|
private _isParentDirty;
|
|
28
31
|
private _parentTransformCache;
|
|
29
32
|
private _dirtyFlag;
|
|
@@ -135,23 +138,17 @@ export declare class Transform extends Component {
|
|
|
135
138
|
*/
|
|
136
139
|
setWorldRotationQuaternion(x: number, y: number, z: number, w: number): void;
|
|
137
140
|
/**
|
|
138
|
-
*
|
|
139
|
-
* @param forward - Forward vector
|
|
140
|
-
* @returns Forward vector
|
|
141
|
+
* The forward direction in world space.
|
|
141
142
|
*/
|
|
142
|
-
|
|
143
|
+
get worldForward(): Vector3;
|
|
143
144
|
/**
|
|
144
|
-
*
|
|
145
|
-
* @param right - Right vector
|
|
146
|
-
* @returns Right vector
|
|
145
|
+
* The right direction in world space.
|
|
147
146
|
*/
|
|
148
|
-
|
|
147
|
+
get worldRight(): Vector3;
|
|
149
148
|
/**
|
|
150
|
-
*
|
|
151
|
-
* @param up - Up vector
|
|
152
|
-
* @returns Up vector
|
|
149
|
+
* The up direction in world space.
|
|
153
150
|
*/
|
|
154
|
-
|
|
151
|
+
get worldUp(): Vector3;
|
|
155
152
|
/**
|
|
156
153
|
* Translate in the direction and distance of the translation.
|
|
157
154
|
* @param translation - Direction and distance of translation
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
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;
|
|
2
29
|
private static _stringToPath;
|
|
30
|
+
private static _formatRelativePath;
|
|
3
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EngineObject } from "../base/EngineObject";
|
|
1
2
|
import { Component } from "../Component";
|
|
2
3
|
import { Entity } from "../Entity";
|
|
3
4
|
import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
|
|
@@ -7,7 +8,7 @@ import { KeyframeValueType } from "./Keyframe";
|
|
|
7
8
|
/**
|
|
8
9
|
* Stores keyframe based animations.
|
|
9
10
|
*/
|
|
10
|
-
export declare class AnimationClip {
|
|
11
|
+
export declare class AnimationClip extends EngineObject {
|
|
11
12
|
readonly name: string;
|
|
12
13
|
private _length;
|
|
13
14
|
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 = "TextureCube",
|
|
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
|
+
GLTF = "GLTF",
|
|
34
34
|
/** Compress Texture. */
|
|
35
|
-
KTX = "
|
|
35
|
+
KTX = "KTX",
|
|
36
36
|
/** Cube Compress Texture. */
|
|
37
|
-
KTXCube = "
|
|
37
|
+
KTXCube = "KTXCube",
|
|
38
38
|
/** Sprite. */
|
|
39
|
-
Sprite = "
|
|
39
|
+
Sprite = "Sprite",
|
|
40
40
|
/** Sprite Atlas. */
|
|
41
|
-
SpriteAtlas = "
|
|
41
|
+
SpriteAtlas = "SpriteAtlas",
|
|
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 = "SourceFont"
|
|
52
52
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EngineObject } from "../base";
|
|
2
|
+
import { AssetPromise } from "./AssetPromise";
|
|
3
|
+
/**
|
|
4
|
+
* ContentRestorer is a base class for all content restore info classes.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class ContentRestorer<T extends EngineObject> {
|
|
7
|
+
resource: T;
|
|
8
|
+
/**
|
|
9
|
+
* @param resource - The resource object of the content restorer
|
|
10
|
+
*/
|
|
11
|
+
constructor(resource: T);
|
|
12
|
+
/**
|
|
13
|
+
* Restore the content of the resource.
|
|
14
|
+
* @returns The promise of the restored content if the content is restored asynchronously, otherwise returns undefined
|
|
15
|
+
*/
|
|
16
|
+
abstract restoreContent(): AssetPromise<T> | void;
|
|
17
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EngineObject } from "../base/EngineObject";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import {
|
|
3
|
+
import { IReferable } from "./IReferable";
|
|
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 ReferResource extends EngineObject implements IReferable {
|
|
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 RefObject extends EngineObject implements IRefObje
|
|
|
14
14
|
get refCount(): number;
|
|
15
15
|
protected constructor(engine: Engine);
|
|
16
16
|
/**
|
|
17
|
+
* @override
|
|
17
18
|
* Destroy self.
|
|
18
19
|
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
19
20
|
* @returns Whether the release was successful.
|
|
20
21
|
*/
|
|
21
22
|
destroy(force?: boolean): boolean;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Subclasses can override this function.
|
|
24
|
+
* @override
|
|
25
25
|
*/
|
|
26
|
-
protected
|
|
26
|
+
protected _onDestroy(): void;
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Engine } from "..";
|
|
1
|
+
import { ContentRestorer, Engine, EngineObject } from "..";
|
|
2
2
|
import { AssetPromise } from "./AssetPromise";
|
|
3
3
|
import { Loader } from "./Loader";
|
|
4
4
|
import { LoadItem } from "./LoadItem";
|
|
@@ -17,14 +17,17 @@ export declare class ResourceManager {
|
|
|
17
17
|
retryInterval: number;
|
|
18
18
|
/** The default timeout period for loading assets, in milliseconds. */
|
|
19
19
|
timeout: number;
|
|
20
|
-
|
|
20
|
+
private _loadingPromises;
|
|
21
|
+
/** Asset path pool, key is the `instanceID` of resource, value is asset path. */
|
|
21
22
|
private _assetPool;
|
|
22
|
-
/** Asset pool,
|
|
23
|
+
/** Asset url pool, key is the asset path and the value is the asset. */
|
|
23
24
|
private _assetUrlPool;
|
|
24
|
-
/**
|
|
25
|
-
private
|
|
26
|
-
/**
|
|
27
|
-
private
|
|
25
|
+
/** Referable resource pool, key is the `instanceID` of resource. */
|
|
26
|
+
private _referResourcePool;
|
|
27
|
+
/** Graphic resource pool, key is the `instanceID` of resource. */
|
|
28
|
+
private _graphicResourcePool;
|
|
29
|
+
/** Restorable resource information pool, key is the `instanceID` of resource. */
|
|
30
|
+
private _contentRestorerPool;
|
|
28
31
|
/**
|
|
29
32
|
* Create a ResourceManager.
|
|
30
33
|
* @param engine - Engine to which the current ResourceManager belongs
|
|
@@ -85,6 +88,11 @@ export declare class ResourceManager {
|
|
|
85
88
|
* @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
|
|
86
89
|
*/
|
|
87
90
|
gc(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Add content restorer.
|
|
93
|
+
* @param restorer - The restorer
|
|
94
|
+
*/
|
|
95
|
+
addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
|
|
88
96
|
private _assignDefaultOptions;
|
|
89
97
|
private _loadSingleItem;
|
|
90
98
|
private _gc;
|
|
@@ -96,6 +104,6 @@ export declare class ResourceManager {
|
|
|
96
104
|
/**
|
|
97
105
|
* Declare ResourceLoader's decorator.
|
|
98
106
|
* @param assetType - Type of asset
|
|
99
|
-
* @param
|
|
107
|
+
* @param extNames - Name of file extension
|
|
100
108
|
*/
|
|
101
|
-
export declare function resourceLoader(assetType: string,
|
|
109
|
+
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,6 +105,7 @@ 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"
|
|
108
|
+
s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc",
|
|
109
|
+
WEBGL_lose_context = "WEBGL_lose_context"
|
|
109
110
|
}
|
|
110
111
|
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Event } from "./Event";
|
|
2
1
|
/**
|
|
3
2
|
* EventDispatcher, which can be inherited as a base class.
|
|
4
3
|
*/
|
|
@@ -44,15 +43,6 @@ export declare class EventDispatcher {
|
|
|
44
43
|
* @returns This
|
|
45
44
|
*/
|
|
46
45
|
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;
|
|
56
46
|
/**
|
|
57
47
|
* Remove the event listener(s) of the specified event name.
|
|
58
48
|
* @param event - Event name
|
|
@@ -71,9 +61,6 @@ export declare class EventDispatcher {
|
|
|
71
61
|
* @param event - Event name, delete all events if not passed
|
|
72
62
|
*/
|
|
73
63
|
removeAllEventListeners(event?: string): void;
|
|
74
|
-
|
|
75
|
-
* @deprecated Use `dispatch` instead.
|
|
76
|
-
*/
|
|
77
|
-
trigger(e: Event): void;
|
|
64
|
+
private _addEventListener;
|
|
78
65
|
private _clearEvent;
|
|
79
66
|
}
|
package/types/base/Time.d.ts
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provide time related information.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Time {
|
|
5
|
-
private
|
|
6
|
-
private
|
|
5
|
+
private static _elapsedTimeProperty;
|
|
6
|
+
private static _deltaTimeProperty;
|
|
7
|
+
private _frameCount;
|
|
7
8
|
private _deltaTime;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
9
|
+
private _actualDeltaTime;
|
|
10
|
+
private _elapsedTime;
|
|
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;
|
|
10
19
|
get frameCount(): number;
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
reset(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Current Time
|
|
18
|
-
*/
|
|
19
|
-
get nowTime(): number;
|
|
20
|
-
/**
|
|
21
|
-
* Time between two ticks
|
|
21
|
+
* The delta time in seconds from the last frame to the current frame.
|
|
22
|
+
*
|
|
23
|
+
* @remarks When the frame rate is low or stutter occurs, `deltaTime` will not exceed the value of `maximumDeltaTime` * `timeScale`.
|
|
22
24
|
*/
|
|
23
25
|
get deltaTime(): number;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* The amount of elapsed time in seconds since the start of the engine.
|
|
26
28
|
*/
|
|
27
|
-
get
|
|
28
|
-
set timeScale(s: number);
|
|
29
|
+
get elapsedTime(): number;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* The actual delta time in seconds from the last frame to the current frame.
|
|
32
|
+
*
|
|
33
|
+
* @remarks The actual delta time is not affected by `maximumDeltaTime` and `timeScale`.
|
|
31
34
|
*/
|
|
32
|
-
get
|
|
35
|
+
get actualDeltaTime(): number;
|
|
33
36
|
/**
|
|
34
|
-
* The elapsed time
|
|
37
|
+
* The amount of actual elapsed time in seconds since the start of the engine.
|
|
35
38
|
*/
|
|
36
|
-
get
|
|
39
|
+
get actualElapsedTime(): number;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
41
|
+
* Constructor of the Time.
|
|
39
42
|
*/
|
|
40
|
-
|
|
43
|
+
constructor();
|
|
41
44
|
}
|
package/types/base/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { Event } from "./Event";
|
|
2
1
|
export { EventDispatcher } from "./EventDispatcher";
|
|
3
2
|
export { Logger } from "./Logger";
|
|
4
3
|
export { Time } from "./Time";
|
|
5
|
-
export { Util, ObjectValues } from "./Util";
|
|
6
4
|
export { EngineObject } from "./EngineObject";
|
|
7
5
|
export * from "./Constant";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { BufferBindFlag } from "./enums/BufferBindFlag";
|
|
4
4
|
import { BufferUsage } from "./enums/BufferUsage";
|
|
@@ -6,14 +6,11 @@ import { SetDataOptions } from "./enums/SetDataOptions";
|
|
|
6
6
|
/**
|
|
7
7
|
* Buffer.
|
|
8
8
|
*/
|
|
9
|
-
export declare class Buffer extends
|
|
10
|
-
_glBindTarget: number;
|
|
11
|
-
_glBufferUsage: number;
|
|
12
|
-
_nativeBuffer: WebGLBuffer;
|
|
13
|
-
private _hardwareRenderer;
|
|
9
|
+
export declare class Buffer extends GraphicsResource {
|
|
14
10
|
private _type;
|
|
15
11
|
private _byteLength;
|
|
16
12
|
private _bufferUsage;
|
|
13
|
+
private _platformBuffer;
|
|
17
14
|
/**
|
|
18
15
|
* Buffer binding flag.
|
|
19
16
|
*/
|
|
@@ -95,11 +92,10 @@ export declare class Buffer extends RefObject {
|
|
|
95
92
|
getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
|
|
96
93
|
/**
|
|
97
94
|
* @override
|
|
98
|
-
* Destroy.
|
|
99
95
|
*/
|
|
100
|
-
|
|
96
|
+
_rebuild(): void;
|
|
101
97
|
/**
|
|
102
98
|
* @deprecated
|
|
103
99
|
*/
|
|
104
|
-
resize(
|
|
100
|
+
resize(byteLength: number): void;
|
|
105
101
|
}
|
package/types/graphic/Mesh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
-
import {
|
|
2
|
+
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
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 GraphicsResource {
|
|
12
12
|
/** Name. */
|
|
13
13
|
name: string;
|
|
14
14
|
private _bounds;
|
|
@@ -58,12 +58,11 @@ export declare abstract class Mesh extends RefObject {
|
|
|
58
58
|
/**
|
|
59
59
|
* @override
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
_addReferCount(value: number): void;
|
|
62
62
|
/**
|
|
63
63
|
* @override
|
|
64
|
-
* Destroy.
|
|
65
64
|
*/
|
|
66
|
-
|
|
65
|
+
_rebuild(): void;
|
|
67
66
|
protected _setVertexElements(elements: VertexElement[]): void;
|
|
68
67
|
protected _setIndexBufferBinding(binding: IndexBufferBinding | null): void;
|
|
69
68
|
private _onBoundsChanged;
|
package/types/index.d.ts
CHANGED
|
@@ -8,23 +8,21 @@ 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 } from "./ComponentsDependencies";
|
|
11
|
+
export { dependentComponents, DependentMode } 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";
|
|
16
17
|
export { request } from "./asset/request";
|
|
17
18
|
export { Loader } from "./asset/Loader";
|
|
19
|
+
export { ContentRestorer } from "./asset/ContentRestorer";
|
|
18
20
|
export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
|
|
19
21
|
export { AssetPromise } from "./asset/AssetPromise";
|
|
20
22
|
export type { LoadItem } from "./asset/LoadItem";
|
|
21
23
|
export { AssetType } from "./asset/AssetType";
|
|
22
|
-
export {
|
|
23
|
-
export
|
|
24
|
-
export { RenderQueue } from "./RenderPipeline/RenderQueue";
|
|
25
|
-
export { RenderPass } from "./RenderPipeline/RenderPass";
|
|
26
|
-
export { MeshRenderElement } from "./RenderPipeline/MeshRenderElement";
|
|
27
|
-
export { SpriteElement } from "./RenderPipeline/SpriteElement";
|
|
24
|
+
export { ReferResource } from "./asset/ReferResource";
|
|
25
|
+
export * from "./RenderPipeline";
|
|
28
26
|
export * from "./base";
|
|
29
27
|
export { Background } from "./Background";
|
|
30
28
|
export { BackgroundMode } from "./enums/BackgroundMode";
|
|
@@ -51,3 +49,6 @@ export * from "./Layer";
|
|
|
51
49
|
export * from "./clone/CloneManager";
|
|
52
50
|
export * from "./renderingHardwareInterface/index";
|
|
53
51
|
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;
|
|
9
10
|
/** Sometimes the input module will not be initialized, such as off-screen rendering. */
|
|
10
11
|
private _initialized;
|
|
11
|
-
private _curFrameCount;
|
|
12
12
|
private _wheelManager;
|
|
13
13
|
private _pointerManager;
|
|
14
14
|
private _keyboardManager;
|