@galacean/engine-core 1.0.0-beta.1 → 1.0.0-beta.11

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.
Files changed (58) hide show
  1. package/dist/main.js +936 -356
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +936 -356
  4. package/dist/module.js +931 -357
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/atlas/SpriteAtlas.d.ts +0 -1
  8. package/types/2d/sprite/Sprite.d.ts +12 -3
  9. package/types/2d/sprite/SpriteMask.d.ts +16 -17
  10. package/types/2d/sprite/SpriteRenderer.d.ts +17 -11
  11. package/types/2d/text/Font.d.ts +0 -1
  12. package/types/2d/text/TextRenderer.d.ts +1 -9
  13. package/types/Camera.d.ts +5 -6
  14. package/types/Component.d.ts +0 -1
  15. package/types/Engine.d.ts +0 -2
  16. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  17. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  18. package/types/RenderPipeline/MeshRenderData.d.ts +3 -1
  19. package/types/RenderPipeline/RenderElement.d.ts +3 -1
  20. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +3 -1
  21. package/types/RenderPipeline/SpriteRenderData.d.ts +3 -1
  22. package/types/RenderPipeline/TextRenderData.d.ts +3 -1
  23. package/types/Renderer.d.ts +8 -13
  24. package/types/SafeLoopArray.d.ts +37 -0
  25. package/types/Scene.d.ts +10 -4
  26. package/types/Script.d.ts +0 -1
  27. package/types/animation/Animator.d.ts +2 -3
  28. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  29. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  30. package/types/asset/GraphicsResource.d.ts +0 -1
  31. package/types/asset/ReferResource.d.ts +0 -1
  32. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  33. package/types/env-probe/CubeProbe.d.ts +0 -1
  34. package/types/graphic/Buffer.d.ts +0 -1
  35. package/types/graphic/Mesh.d.ts +2 -6
  36. package/types/graphic/SubMesh.d.ts +3 -1
  37. package/types/index.d.ts +1 -1
  38. package/types/lighting/Light.d.ts +0 -1
  39. package/types/material/Material.d.ts +9 -2
  40. package/types/material/PBRMaterial.d.ts +11 -2
  41. package/types/mesh/MeshRenderer.d.ts +8 -8
  42. package/types/mesh/ModelMesh.d.ts +0 -1
  43. package/types/mesh/SkinnedMeshRenderer.d.ts +0 -4
  44. package/types/physics/Collider.d.ts +0 -1
  45. package/types/physics/PhysicsScene.d.ts +75 -0
  46. package/types/shader/index.d.ts +1 -0
  47. package/types/shader/state/index.d.ts +6 -0
  48. package/types/shadow/CascadedShadowCasterPass.d.ts +1 -0
  49. package/types/sky/Sky.d.ts +12 -4
  50. package/types/texture/RenderTarget.d.ts +0 -1
  51. package/types/texture/Texture.d.ts +0 -1
  52. package/types/trail/TrailRenderer.d.ts +0 -2
  53. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  54. package/types/utils/DisorderedArray.d.ts +18 -0
  55. package/types/utils/SafeLoopArray.d.ts +41 -0
  56. package/types/utils/UpdateFlag.d.ts +20 -0
  57. package/types/utils/UpdateFlagManager.d.ts +1 -0
  58. package/types/utils/Utils.d.ts +31 -0
@@ -10,8 +10,11 @@ import { RenderState } from "../shader/state/RenderState";
10
10
  export declare class Material extends ReferResource implements IClone {
11
11
  /** Name. */
12
12
  name: string;
13
- /** Shader data. */
14
- readonly shaderData: ShaderData;
13
+ private _shaderData;
14
+ /**
15
+ * Shader data.
16
+ */
17
+ get shaderData(): ShaderData;
15
18
  /**
16
19
  * Shader used by the material.
17
20
  */
@@ -41,4 +44,8 @@ export declare class Material extends ReferResource implements IClone {
41
44
  */
42
45
  cloneTo(target: Material): void;
43
46
  _addReferCount(value: number): void;
47
+ /**
48
+ * @override
49
+ */
50
+ protected _onDestroy(): void;
44
51
  }
@@ -8,13 +8,22 @@ export declare class PBRMaterial extends PBRBaseMaterial {
8
8
  private static _metallicProp;
9
9
  private static _roughnessProp;
10
10
  private static _roughnessMetallicTextureProp;
11
+ private static _iorProp;
11
12
  /**
12
- * Metallic, default 1.0.
13
+ * Index Of Refraction.
14
+ * @defaultValue `1.5`
15
+ */
16
+ get ior(): number;
17
+ set ior(v: number);
18
+ /**
19
+ * Metallic.
20
+ * @defaultValue `1.0`
13
21
  */
14
22
  get metallic(): number;
15
23
  set metallic(value: number);
16
24
  /**
17
- * Roughness, default 1.0.
25
+ * Roughness. default 1.0.
26
+ * @defaultValue `1.0`
18
27
  */
19
28
  get roughness(): number;
20
29
  set roughness(value: number);
@@ -1,25 +1,25 @@
1
- import { BoundingBox } from "@galacean/engine-math";
2
- import { RenderContext } from "../RenderPipeline/RenderContext";
3
1
  import { Renderer } from "../Renderer";
4
- import { ICustomClone } from "../clone/ComponentCloner";
5
2
  import { Mesh } from "../graphic/Mesh";
6
3
  /**
7
4
  * MeshRenderer Component.
8
5
  */
9
- export declare class MeshRenderer extends Renderer implements ICustomClone {
6
+ export declare class MeshRenderer extends Renderer {
10
7
  private static _uvMacro;
11
8
  private static _uv1Macro;
12
9
  private static _normalMacro;
13
10
  private static _tangentMacro;
14
- private static _vertexColorMacro;
11
+ private static _enableVertexColorMacro;
12
+ private _enableVertexColor;
15
13
  /**
16
14
  * Mesh assigned to the renderer.
17
15
  */
18
16
  get mesh(): Mesh;
19
17
  set mesh(value: Mesh);
20
- protected _onDestroy(): void;
21
- protected _updateBounds(worldBounds: BoundingBox): void;
22
- protected _render(context: RenderContext): void;
18
+ /**
19
+ * Whether enable vertex color.
20
+ */
21
+ get enableVertexColor(): boolean;
22
+ set enableVertexColor(value: boolean);
23
23
  private _setMesh;
24
24
  private _onMeshChanged;
25
25
  }
@@ -216,7 +216,6 @@ export declare class ModelMesh extends Mesh {
216
216
  * @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
217
217
  */
218
218
  calculateTangents(): void;
219
- protected _onDestroy(): void;
220
219
  private _supplementaryVertexElements;
221
220
  private _updateVertexElements;
222
221
  private _updateVertices;
@@ -1,6 +1,5 @@
1
1
  import { BoundingBox } from "@galacean/engine-math";
2
2
  import { Entity } from "../Entity";
3
- import { RenderContext } from "../RenderPipeline/RenderContext";
4
3
  import { MeshRenderer } from "./MeshRenderer";
5
4
  import { Skin } from "./Skin";
6
5
  /**
@@ -41,9 +40,6 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
41
40
  */
42
41
  get rootBone(): Entity;
43
42
  set rootBone(value: Entity);
44
- protected _updateShaderData(context: RenderContext): void;
45
- protected _registerEntityTransformListener(): void;
46
- protected _updateBounds(worldBounds: BoundingBox): void;
47
43
  private _initSkin;
48
44
  private _computeApproximateBindMatrix;
49
45
  private _findByEntityName;
@@ -26,5 +26,4 @@ export declare class Collider extends Component {
26
26
  * Remove all shape attached.
27
27
  */
28
28
  clearShapes(): void;
29
- protected _onDestroy(): void;
30
29
  }
@@ -0,0 +1,75 @@
1
+ import { Ray, Vector3 } from "@galacean/engine-math";
2
+ import { Layer } from "../Layer";
3
+ import { Scene } from "../Scene";
4
+ import { HitResult } from "./HitResult";
5
+ /**
6
+ * A physics scene is a collection of colliders and constraints which can interact.
7
+ */
8
+ export declare class PhysicsScene {
9
+ private static _collision;
10
+ private _scene;
11
+ private _restTime;
12
+ private _colliders;
13
+ private _gravity;
14
+ private _nativePhysicsScene;
15
+ private _onContactEnter;
16
+ private _onContactExit;
17
+ private _onContactStay;
18
+ private _onTriggerEnter;
19
+ private _onTriggerExit;
20
+ private _onTriggerStay;
21
+ /** The fixed time step in seconds at which physics are performed. */
22
+ fixedTimeStep: number;
23
+ /**
24
+ * The gravity of physics scene.
25
+ */
26
+ get gravity(): Vector3;
27
+ set gravity(value: Vector3);
28
+ constructor(scene: Scene);
29
+ /**
30
+ * Casts a ray through the Scene and returns the first hit.
31
+ * @param ray - The ray
32
+ * @returns Returns True if the ray intersects with a collider, otherwise false
33
+ */
34
+ raycast(ray: Ray): boolean;
35
+ /**
36
+ * Casts a ray through the Scene and returns the first hit.
37
+ * @param ray - The ray
38
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
39
+ * @returns Returns True if the ray intersects with a collider, otherwise false
40
+ */
41
+ raycast(ray: Ray, outHitResult: HitResult): boolean;
42
+ /**
43
+ * Casts a ray through the Scene and returns the first hit.
44
+ * @param ray - The ray
45
+ * @param distance - The max distance the ray should check
46
+ * @returns Returns True if the ray intersects with a collider, otherwise false
47
+ */
48
+ raycast(ray: Ray, distance: number): boolean;
49
+ /**
50
+ * Casts a ray through the Scene and returns the first hit.
51
+ * @param ray - The ray
52
+ * @param distance - The max distance the ray should check
53
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
54
+ * @returns Returns True if the ray intersects with a collider, otherwise false
55
+ */
56
+ raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
57
+ /**
58
+ * Casts a ray through the Scene and returns the first hit.
59
+ * @param ray - The ray
60
+ * @param distance - The max distance the ray should check
61
+ * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
62
+ * @returns Returns True if the ray intersects with a collider, otherwise false
63
+ */
64
+ raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
65
+ /**
66
+ * Casts a ray through the Scene and returns the first hit.
67
+ * @param ray - The ray
68
+ * @param distance - The max distance the ray should check
69
+ * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
70
+ * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
71
+ * @returns Returns True if the ray intersects with a collider, otherwise false.
72
+ */
73
+ raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
74
+ private _setGravity;
75
+ }
@@ -13,3 +13,4 @@ export { ShaderPass } from "./ShaderPass";
13
13
  export { ShaderProperty } from "./ShaderProperty";
14
14
  export { ShaderTagKey } from "./ShaderTagKey";
15
15
  export { SubShader } from "./SubShader";
16
+ export * from "./state";
@@ -0,0 +1,6 @@
1
+ export { BlendState } from "./BlendState";
2
+ export { DepthState } from "./DepthState";
3
+ export { RasterState } from "./RasterState";
4
+ export { RenderState } from "./RenderState";
5
+ export { RenderTargetBlendState } from "./RenderTargetBlendState";
6
+ export { StencilState } from "./StencilState";
@@ -12,6 +12,7 @@ export declare class CascadedShadowCasterPass {
12
12
  private static _shadowSplitSpheresProperty;
13
13
  private static _maxCascades;
14
14
  private static _cascadesSplitDistance;
15
+ private static _viewport;
15
16
  private static _clearColor;
16
17
  private static _tempVector;
17
18
  private static _tempMatrix0;
@@ -7,8 +7,16 @@ export declare class Sky {
7
7
  private static _epsilon;
8
8
  private static _viewProjMatrix;
9
9
  private static _projectionMatrix;
10
- /** Material of the sky. */
11
- material: Material;
12
- /** Mesh of the sky. */
13
- mesh: Mesh;
10
+ private _material;
11
+ private _mesh;
12
+ /**
13
+ * Material of the sky.
14
+ */
15
+ get material(): Material;
16
+ set material(value: Material);
17
+ /**
18
+ * Mesh of the sky.
19
+ */
20
+ get mesh(): Mesh;
21
+ set mesh(value: Mesh);
14
22
  }
@@ -88,5 +88,4 @@ export declare class RenderTarget extends GraphicsResource {
88
88
  * Generate the mipmap of each attachment texture of the renderTarget according to the configuration.
89
89
  */
90
90
  generateMipmaps(): void;
91
- protected _onDestroy(): void;
92
91
  }
@@ -64,7 +64,6 @@ export declare abstract class Texture extends GraphicsResource {
64
64
  * Generate multi-level textures based on the 0th level data.
65
65
  */
66
66
  generateMipmaps(): void;
67
- protected _onDestroy(): void;
68
67
  /**
69
68
  * Get the maximum mip level of the corresponding size:rounding down.
70
69
  * @remarks http://download.nvidia.com/developer/Papers/2005/NP2_Mipmapping/NP2_Mipmap_Creation.pdf
@@ -1,5 +1,4 @@
1
1
  import { Entity } from "../Entity";
2
- import { RenderContext } from "../RenderPipeline/RenderContext";
3
2
  import { MeshRenderer } from "../mesh/MeshRenderer";
4
3
  import { Texture2D } from "../texture";
5
4
  /**
@@ -28,7 +27,6 @@ export declare class TrailRenderer extends MeshRenderer {
28
27
  * @param texture
29
28
  */
30
29
  setTexture(texture: Texture2D): void;
31
- protected _render(context: RenderContext): void;
32
30
  private _initGeometry;
33
31
  private _updateStrapVertices;
34
32
  private _updateStrapCoords;
@@ -0,0 +1,12 @@
1
+ import { UpdateFlag } from "./UpdateFlag";
2
+ /**
3
+ * Bool update flag.
4
+ */
5
+ export declare class BoolUpdateFlag extends UpdateFlag {
6
+ /** Bool flag. */
7
+ flag: boolean;
8
+ /**
9
+ * @inheritdoc
10
+ */
11
+ dispatch(): void;
12
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.
3
+ */
4
+ export declare class DisorderedArray<T> {
5
+ _elements: T[];
6
+ length: number;
7
+ constructor(count?: number);
8
+ add(element: T): void;
9
+ delete(element: T): void;
10
+ get(index: number): T;
11
+ /**
12
+ *
13
+ * @param index
14
+ * @returns The replaced item is used to reset its index.
15
+ */
16
+ deleteByIndex(index: number): T;
17
+ garbageCollection(): void;
18
+ }
@@ -0,0 +1,41 @@
1
+ export declare class SafeLoopArray<T> {
2
+ private _array;
3
+ private _loopArray;
4
+ private _loopArrayDirty;
5
+ /**
6
+ * Get the length of the array.
7
+ */
8
+ get length(): number;
9
+ /**
10
+ * Push item to the array.
11
+ * @param item - The item which want to be pushed
12
+ */
13
+ push(item: T): void;
14
+ /**
15
+ * Add item to the array.
16
+ * @param index - The index of the array
17
+ * @param item - The item which want to be added
18
+ */
19
+ add(index: number, item: T): void;
20
+ /**
21
+ * Remove item from the array.
22
+ * @param index - The index of the array
23
+ */
24
+ removeByIndex(index: number): void;
25
+ /**
26
+ * The index of the item.
27
+ * @param item - The item which want to get the index
28
+ * @returns Index of the item
29
+ */
30
+ indexOf(item: T): number;
31
+ /**
32
+ * Get the array.
33
+ * @returns The array
34
+ */
35
+ getArray(): ReadonlyArray<T>;
36
+ /**
37
+ * Get the array use for loop.
38
+ * @returns The array use for loop
39
+ */
40
+ getLoopArray(): ReadonlyArray<T>;
41
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Used to update tags.
3
+ */
4
+ export declare abstract class UpdateFlag {
5
+ /**
6
+ * Dispatch.
7
+ * @param bit - Bit
8
+ * @param param - Parameter
9
+ */
10
+ abstract dispatch(bit?: number, param?: Object): void;
11
+ /**
12
+ * Clear.
13
+ */
14
+ clearFromManagers(): void;
15
+ /**
16
+ * Destroy.
17
+ */
18
+ destroy(): void;
19
+ private _removeFromManagers;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
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
+ private static _stringToPath;
30
+ private static _formatRelativePath;
31
+ }