@galacean/engine-core 1.0.0-alpha.6 → 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 +1523 -869
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1523 -869
- package/dist/module.js +1522 -868
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/types.d.ts +12 -1
- package/types/Scene.d.ts +2 -0
- package/types/Utils.d.ts +28 -0
- package/types/asset/ResourceManager.d.ts +12 -6
- package/types/base/index.d.ts +0 -1
- package/types/graphic/BufferUtil.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/material/BaseMaterial.d.ts +4 -4
- package/types/shaderlib/ShaderLib.d.ts +0 -1
- package/types/sky/SkyBoxMaterial.d.ts +30 -9
- package/types/sky/SkyProceduralMaterial.d.ts +1 -1
- package/types/sky/index.d.ts +1 -0
- package/types/2d/data/RenderData2D.d.ts +0 -1
- 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/asset/RefObject.d.ts +0 -27
- package/types/base/Event.d.ts +0 -24
- package/types/base/Util.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
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.0.0-
|
|
18
|
+
"@galacean/engine-math": "1.0.0-beta.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.0.0-
|
|
21
|
+
"@galacean/engine-design": "1.0.0-beta.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { TextureFormat } from "../../texture";
|
|
1
|
+
import { TextureFilterMode, TextureFormat, TextureWrapMode } from "../../texture";
|
|
2
2
|
/**
|
|
3
3
|
* The original data type of the atlas.
|
|
4
4
|
*/
|
|
5
5
|
export interface AtlasConfig {
|
|
6
|
+
mipmap?: boolean;
|
|
7
|
+
wrapModeV?: TextureWrapMode;
|
|
8
|
+
wrapModeU?: TextureWrapMode;
|
|
9
|
+
filterMode?: TextureFilterMode;
|
|
10
|
+
anisoLevel?: number;
|
|
6
11
|
/** Version of Atlas. */
|
|
7
12
|
version: number;
|
|
8
13
|
/** Texture format. */
|
|
@@ -49,5 +54,11 @@ export interface AtlasSprite {
|
|
|
49
54
|
x: number;
|
|
50
55
|
y: number;
|
|
51
56
|
};
|
|
57
|
+
border: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
z: number;
|
|
61
|
+
w: number;
|
|
62
|
+
};
|
|
52
63
|
pixelsPerUnit: number;
|
|
53
64
|
}
|
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/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
|
}
|
|
@@ -57,6 +57,18 @@ export declare class ResourceManager {
|
|
|
57
57
|
* @returns AssetPromise
|
|
58
58
|
*/
|
|
59
59
|
load(assetItems: LoadItem[]): AssetPromise<Object[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Get the resource from cache by asset url, return the resource object if it loaded, otherwise return null.
|
|
62
|
+
* @param url - Resource url
|
|
63
|
+
* @returns Resource object
|
|
64
|
+
*/
|
|
65
|
+
getFromCache<T>(url: string): T;
|
|
66
|
+
/**
|
|
67
|
+
* Get asset url from instanceId.
|
|
68
|
+
* @param instanceId - Engine instance id
|
|
69
|
+
* @returns Asset url
|
|
70
|
+
*/
|
|
71
|
+
getAssetPath(instanceId: number): string;
|
|
60
72
|
/**
|
|
61
73
|
* Cancel all assets that have not finished loading.
|
|
62
74
|
*/
|
|
@@ -76,12 +88,6 @@ export declare class ResourceManager {
|
|
|
76
88
|
* @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
|
|
77
89
|
*/
|
|
78
90
|
gc(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Get asset url from instanceId.
|
|
81
|
-
* @param instanceId - Engine instance id
|
|
82
|
-
* @returns Asset url
|
|
83
|
-
*/
|
|
84
|
-
getAssetPath(instanceId: number): string;
|
|
85
91
|
/**
|
|
86
92
|
* Add content restorer.
|
|
87
93
|
* @param restorer - The restorer
|
package/types/base/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export interface ElementInfo {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class BufferUtil {
|
|
9
9
|
static _getGLIndexType(indexFormat: IndexFormat): DataType;
|
|
10
|
-
static _getGLIndexByteCount(indexFormat: IndexFormat):
|
|
10
|
+
static _getGLIndexByteCount(indexFormat: IndexFormat): number;
|
|
11
11
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -49,5 +49,6 @@ export * from "./Layer";
|
|
|
49
49
|
export * from "./clone/CloneManager";
|
|
50
50
|
export * from "./renderingHardwareInterface/index";
|
|
51
51
|
export * from "./physics/index";
|
|
52
|
+
export * from "./Utils";
|
|
52
53
|
export { Basic2DBatcher } from "./RenderPipeline/Basic2DBatcher";
|
|
53
54
|
export { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
|
|
@@ -5,17 +5,17 @@ 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 _baseTextureMacro: ShaderMacro;
|
|
9
|
+
protected static _normalTextureMacro: ShaderMacro;
|
|
10
|
+
protected static _emissiveTextureMacro: ShaderMacro;
|
|
11
|
+
protected static _transparentMacro: ShaderMacro;
|
|
8
12
|
protected static _baseColorProp: ShaderProperty;
|
|
9
13
|
protected static _baseTextureProp: ShaderProperty;
|
|
10
|
-
protected static _baseTextureMacro: ShaderMacro;
|
|
11
14
|
protected static _tilingOffsetProp: ShaderProperty;
|
|
12
15
|
protected static _normalTextureProp: ShaderProperty;
|
|
13
16
|
protected static _normalIntensityProp: ShaderProperty;
|
|
14
|
-
protected static _normalTextureMacro: ShaderMacro;
|
|
15
17
|
protected static _emissiveColorProp: ShaderProperty;
|
|
16
18
|
protected static _emissiveTextureProp: ShaderProperty;
|
|
17
|
-
protected static _emissiveTextureMacro: ShaderMacro;
|
|
18
|
-
protected static _transparentMacro: ShaderMacro;
|
|
19
19
|
private static _alphaCutoffProp;
|
|
20
20
|
private static _alphaCutoffMacro;
|
|
21
21
|
private _renderFace;
|
|
@@ -1,25 +1,46 @@
|
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
1
2
|
import { Engine } from "../Engine";
|
|
2
3
|
import { Material } from "../material/Material";
|
|
3
4
|
import { TextureCube } from "../texture";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* SkyBoxMaterial.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SkyBoxMaterial extends Material {
|
|
8
|
-
private
|
|
9
|
+
private static _tintColorProp;
|
|
10
|
+
private static _textureCubeProp;
|
|
11
|
+
private static _rotationProp;
|
|
12
|
+
private static _exposureProp;
|
|
13
|
+
private static _decodeSkyRGBMMacro;
|
|
14
|
+
private _textureDecodeRGBM;
|
|
15
|
+
private _tintColor;
|
|
9
16
|
/**
|
|
10
|
-
* Whether to decode
|
|
17
|
+
* Whether to decode texture with RGBM format.
|
|
11
18
|
*/
|
|
12
19
|
get textureDecodeRGBM(): boolean;
|
|
13
20
|
set textureDecodeRGBM(value: boolean);
|
|
14
21
|
/**
|
|
15
|
-
*
|
|
22
|
+
* Texture of the sky box material.
|
|
16
23
|
*/
|
|
17
|
-
get
|
|
18
|
-
set
|
|
24
|
+
get texture(): TextureCube;
|
|
25
|
+
set texture(value: TextureCube);
|
|
19
26
|
/**
|
|
20
|
-
*
|
|
27
|
+
* The angle to rotate around the y-axis, unit is degree.
|
|
21
28
|
*/
|
|
22
|
-
get
|
|
23
|
-
set
|
|
29
|
+
get rotation(): number;
|
|
30
|
+
set rotation(value: number);
|
|
31
|
+
/**
|
|
32
|
+
* The exposure value of this material.
|
|
33
|
+
*/
|
|
34
|
+
get exposure(): number;
|
|
35
|
+
set exposure(value: number);
|
|
36
|
+
/**
|
|
37
|
+
* The Tint color of this material.
|
|
38
|
+
*/
|
|
39
|
+
get tintColor(): Color;
|
|
40
|
+
set tintColor(value: Color);
|
|
24
41
|
constructor(engine: Engine);
|
|
42
|
+
/**
|
|
43
|
+
* @override
|
|
44
|
+
*/
|
|
45
|
+
clone(): SkyBoxMaterial;
|
|
25
46
|
}
|
package/types/sky/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Mesh } from "../graphic/Mesh";
|
|
2
|
-
import { SubMesh } from "../graphic/SubMesh";
|
|
3
|
-
import { Material } from "../material/Material";
|
|
4
|
-
import { Renderer } from "../Renderer";
|
|
5
|
-
import { ShaderPass } from "../shader/ShaderPass";
|
|
6
|
-
import { RenderState } from "../shader/state/RenderState";
|
|
7
|
-
import { RenderElement } from "./RenderElement";
|
|
8
|
-
/**
|
|
9
|
-
* Render element.
|
|
10
|
-
*/
|
|
11
|
-
export declare class MeshRenderElement extends RenderElement {
|
|
12
|
-
/** Mesh. */
|
|
13
|
-
mesh: Mesh;
|
|
14
|
-
/** Sub mesh. */
|
|
15
|
-
subMesh: SubMesh;
|
|
16
|
-
setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
|
-
import { Material } from "../material/Material";
|
|
3
|
-
import { Renderer } from "../Renderer";
|
|
4
|
-
import { ShaderPass } from "../shader";
|
|
5
|
-
import { RenderState } from "../shader/state/RenderState";
|
|
6
|
-
import { Texture2D } from "../texture";
|
|
7
|
-
import { RenderElement } from "./RenderElement";
|
|
8
|
-
export declare class SpriteElement extends RenderElement {
|
|
9
|
-
renderData: RenderData2D;
|
|
10
|
-
texture: Texture2D;
|
|
11
|
-
constructor();
|
|
12
|
-
setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
13
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
|
-
import { Material } from "../material/Material";
|
|
3
|
-
import { Renderer } from "../Renderer";
|
|
4
|
-
import { RenderElement } from "./RenderElement";
|
|
5
|
-
export declare class SpriteMaskElement extends RenderElement {
|
|
6
|
-
renderData: RenderData2D;
|
|
7
|
-
isAdd: boolean;
|
|
8
|
-
constructor();
|
|
9
|
-
setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
|
|
10
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EngineObject } from "../base/EngineObject";
|
|
2
|
-
import { Engine } from "../Engine";
|
|
3
|
-
import { IRefObject } from "./IRefObject";
|
|
4
|
-
/**
|
|
5
|
-
* The base class of assets, with reference counting capability.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class RefObject extends EngineObject implements IRefObject {
|
|
8
|
-
/** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
|
|
9
|
-
isGCIgnored: boolean;
|
|
10
|
-
private _refCount;
|
|
11
|
-
/**
|
|
12
|
-
* Counted by valid references.
|
|
13
|
-
*/
|
|
14
|
-
get refCount(): number;
|
|
15
|
-
protected constructor(engine: Engine);
|
|
16
|
-
/**
|
|
17
|
-
* Destroy self.
|
|
18
|
-
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
19
|
-
* @returns Whether the release was successful.
|
|
20
|
-
*/
|
|
21
|
-
destroy(force?: boolean): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Called when the resource is destroyed.
|
|
24
|
-
* Subclasses can override this function.
|
|
25
|
-
*/
|
|
26
|
-
protected abstract _onDestroy(): void;
|
|
27
|
-
}
|
package/types/base/Event.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
package/types/base/Util.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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[];
|