@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.0.0-alpha.6",
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-alpha.6"
18
+ "@galacean/engine-math": "1.0.0-beta.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.0.0-alpha.6"
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
@@ -1,6 +1,5 @@
1
1
  export { EventDispatcher } from "./EventDispatcher";
2
2
  export { Logger } from "./Logger";
3
3
  export { Time } from "./Time";
4
- export { Util, ObjectValues } from "./Util";
5
4
  export { EngineObject } from "./EngineObject";
6
5
  export * from "./Constant";
@@ -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): DataType;
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;
@@ -19,7 +19,6 @@ export declare const ShaderLib: {
19
19
  normal_share: string;
20
20
  uv_share: string;
21
21
  worldpos_share: string;
22
- RendererFragmentDeclaration: string;
23
22
  FogVertexDeclaration: string;
24
23
  FogFragmentDeclaration: string;
25
24
  begin_normal_vert: string;
@@ -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
- * SkyboxMaterial
6
+ * SkyBoxMaterial.
6
7
  */
7
8
  export declare class SkyBoxMaterial extends Material {
8
- private _decodeParam;
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 from texture with RGBM format.
17
+ * Whether to decode texture with RGBM format.
11
18
  */
12
19
  get textureDecodeRGBM(): boolean;
13
20
  set textureDecodeRGBM(value: boolean);
14
21
  /**
15
- * RGBM decode factor, default 5.0.
22
+ * Texture of the sky box material.
16
23
  */
17
- get RGBMDecodeFactor(): number;
18
- set RGBMDecodeFactor(value: number);
24
+ get texture(): TextureCube;
25
+ set texture(value: TextureCube);
19
26
  /**
20
- * Texture cube map of the sky box material.
27
+ * The angle to rotate around the y-axis, unit is degree.
21
28
  */
22
- get textureCubeMap(): TextureCube;
23
- set textureCubeMap(v: TextureCube);
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
  }
@@ -1,4 +1,4 @@
1
- import { Color } from "@oasis-engine/math";
1
+ import { Color } from "@galacean/engine-math";
2
2
  import { Engine } from "../Engine";
3
3
  import { Material } from "../material/Material";
4
4
  /**
@@ -1,2 +1,3 @@
1
1
  export { Sky } from "./Sky";
2
2
  export { SkyBoxMaterial } from "./SkyBoxMaterial";
3
+ export { SkyProceduralMaterial, SunMode } from "./SkyProceduralMaterial";
@@ -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,6 +0,0 @@
1
- import { RenderElement } from "./RenderElement";
2
- import { SpriteElement } from "./SpriteElement";
3
- export declare class TextRenderElement extends RenderElement {
4
- charElements: SpriteElement[];
5
- constructor();
6
- }
@@ -1,2 +0,0 @@
1
- export interface IRefObject {
2
- }
@@ -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
- }
@@ -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
- }
@@ -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[];