@galacean/engine-core 0.0.0-experimental-0.9-plus.8 → 0.0.0-experimental-double11.1
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 +15851 -13975
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +15851 -13975
- package/dist/module.js +15837 -13971
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
- package/types/2d/enums/SpriteDirtyFlag.d.ts +13 -0
- package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
- package/types/2d/index.d.ts +1 -0
- package/types/2d/sprite/Sprite.d.ts +5 -2
- package/types/2d/sprite/SpriteMask.d.ts +0 -11
- package/types/2d/sprite/SpriteRenderer.d.ts +15 -11
- package/types/2d/text/Font.d.ts +2 -7
- package/types/2d/text/TextRenderer.d.ts +0 -11
- package/types/2d/text/index.d.ts +1 -0
- package/types/Camera.d.ts +27 -8
- package/types/Component.d.ts +0 -8
- package/types/ComponentsDependencies.d.ts +17 -9
- package/types/ComponentsManager.d.ts +3 -2
- package/types/DisorderedArray.d.ts +4 -3
- package/types/Engine.d.ts +35 -43
- package/types/Entity.d.ts +2 -2
- package/types/ListenerUpdateFlag.d.ts +12 -0
- package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
- package/types/RenderPipeline/PipelinePass.d.ts +16 -0
- package/types/RenderPipeline/RenderElement.d.ts +8 -8
- 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/Renderer.d.ts +3 -12
- package/types/Scene.d.ts +0 -1
- package/types/Script.d.ts +18 -15
- package/types/Transform.d.ts +10 -12
- package/types/Utils.d.ts +28 -0
- package/types/animation/AnimationClip.d.ts +2 -1
- package/types/animation/Animator.d.ts +7 -4
- package/types/animation/AnimatorStateTransition.d.ts +12 -0
- package/types/animation/AnimatorTransitionBase.d.ts +10 -0
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
- package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
- package/types/animation/enums/LayerState.d.ts +3 -1
- package/types/animation/enums/StateMachineState.d.ts +13 -0
- package/types/animation/index.d.ts +0 -4
- package/types/animation/internal/AnimatorPlayableObject.d.ts +23 -0
- package/types/animation/internal/CrossCurveData.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/IAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/asset/AssetType.d.ts +16 -16
- package/types/asset/LoadItem.d.ts +16 -9
- package/types/asset/ResourceManager.d.ts +17 -9
- package/types/asset/request.d.ts +7 -3
- package/types/base/Constant.d.ts +2 -1
- package/types/base/EngineObject.d.ts +1 -0
- package/types/base/EventDispatcher.d.ts +2 -15
- package/types/base/Time.d.ts +25 -24
- package/types/base/index.d.ts +0 -2
- package/types/enums/DepthTextureMode.d.ts +7 -0
- package/types/env-probe/CubeProbe.d.ts +0 -7
- package/types/env-probe/Probe.d.ts +0 -6
- package/types/fog/EXP2Fog.d.ts +15 -0
- package/types/fog/Fog.d.ts +14 -0
- package/types/fog/LinearFog.d.ts +22 -0
- package/types/fog/index.d.ts +3 -0
- package/types/graphic/Buffer.d.ts +5 -12
- package/types/graphic/Mesh.d.ts +5 -16
- package/types/graphic/Primitive.d.ts +1 -0
- package/types/graphic/SubPrimitive.d.ts +9 -0
- 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/AmbientLight.d.ts +4 -1
- package/types/lighting/DirectLight.d.ts +0 -1
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +1 -0
- package/types/lighting/SpotLight.d.ts +0 -1
- package/types/material/BaseMaterial.d.ts +8 -10
- package/types/material/BlinnPhongMaterial.d.ts +0 -3
- package/types/material/Material.d.ts +3 -6
- package/types/material/PBRMaterial.d.ts +1 -1
- package/types/material/PBRSpecularMaterial.d.ts +1 -1
- package/types/material/UnlitMaterial.d.ts +1 -1
- package/types/mesh/BlendShape.d.ts +1 -1
- package/types/mesh/BlendShapeFrame.d.ts +28 -6
- package/types/mesh/MeshRenderer.d.ts +1 -11
- package/types/mesh/ModelMesh.d.ts +5 -5
- package/types/mesh/PrimitiveMesh.d.ts +4 -2
- package/types/mesh/SkinnedMeshRenderer.d.ts +0 -15
- package/types/particle/ParticleBufferUtils.d.ts +1 -0
- package/types/particle/ParticleGenerator.d.ts +72 -0
- package/types/particle/ParticleMaterial.d.ts +28 -0
- package/types/particle/ParticleRenderer.d.ts +2 -2
- package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
- package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
- package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enums/ParticleStopMode.d.ts +6 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
- package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
- package/types/particle/modules/Burst.d.ts +14 -0
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/modules/EmissionModule.d.ts +45 -0
- package/types/particle/modules/MainModule.d.ts +68 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
- package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
- package/types/particle/modules/ParticleCurve.d.ts +56 -0
- package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
- package/types/particle/modules/ParticleGradient.d.ts +94 -0
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/shape/BaseShape.d.ts +12 -0
- package/types/particle/modules/shape/BoxShape.d.ts +11 -0
- package/types/particle/modules/shape/CircleShape.d.ts +17 -0
- package/types/particle/modules/shape/ConeShape.d.ts +28 -0
- package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/modules/shape/SphereShape.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/modules/shape/index.d.ts +6 -0
- package/types/physics/CharacterController.d.ts +0 -2
- package/types/physics/Collider.d.ts +3 -2
- package/types/physics/PhysicsManager.d.ts +5 -22
- package/types/physics/PhysicsScene.d.ts +6 -2
- package/types/physics/joint/HingeJoint.d.ts +2 -2
- package/types/physics/joint/Joint.d.ts +3 -4
- package/types/physics/joint/SpringJoint.d.ts +3 -2
- package/types/physics/shape/BoxColliderShape.d.ts +2 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +2 -0
- package/types/physics/shape/ColliderShape.d.ts +4 -1
- package/types/physics/shape/PlaneColliderShape.d.ts +1 -0
- package/types/physics/shape/SphereColliderShape.d.ts +2 -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/ShaderPass.d.ts +9 -2
- package/types/shader/ShaderProperty.d.ts +7 -0
- package/types/shader/enums/RenderStateElementKey.d.ts +58 -0
- package/types/shader/index.d.ts +5 -1
- package/types/shaderlib/particle/index.d.ts +14 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/shadow/enum/ShadowMode.d.ts +13 -0
- package/types/sky/SkyBoxMaterial.d.ts +27 -9
- package/types/sky/index.d.ts +1 -0
- package/types/texture/RenderTarget.d.ts +2 -6
- package/types/texture/Texture.d.ts +8 -6
- package/types/texture/Texture2D.d.ts +3 -1
- package/types/texture/index.d.ts +1 -0
- package/types/trail/TrailRenderer.d.ts +0 -5
- package/types/SafeLoopArray.d.ts +0 -37
- /package/types/{animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts → RenderPipeline/CullingResults.d.ts} +0 -0
- /package/types/{animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts → RenderPipeline/DepthOnlyPass.d.ts} +0 -0
- /package/types/{animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts → RenderPipeline/PipelineUtils.d.ts} +0 -0
- /package/types/animation/{internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts → AnimatorStatePlayData.d.ts} +0 -0
- /package/types/animation/internal/{animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts → AnimatorStateInfo.d.ts} +0 -0
- /package/types/animation/internal/{animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts → AnimatorStateMachineData.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-double11.1",
|
|
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": "0.0.0-experimental-
|
|
18
|
+
"@galacean/engine-math": "0.0.0-experimental-double11.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "0.0.0-experimental-
|
|
21
|
+
"@galacean/engine-design": "0.0.0-experimental-double11.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
2
2
|
import { Engine } from "../../Engine";
|
|
3
3
|
import { Sprite } from "../sprite/Sprite";
|
|
4
4
|
/**
|
|
5
5
|
* Sprite Atlas.
|
|
6
6
|
*/
|
|
7
|
-
export declare class SpriteAtlas extends
|
|
7
|
+
export declare class SpriteAtlas extends ReferResource {
|
|
8
8
|
private _sprites;
|
|
9
9
|
private _spriteNamesToIndex;
|
|
10
10
|
/**
|
|
@@ -29,8 +29,4 @@ export declare class SpriteAtlas extends RefObject {
|
|
|
29
29
|
* @param engine - Engine to which the SpriteAtlas belongs
|
|
30
30
|
*/
|
|
31
31
|
constructor(engine: Engine);
|
|
32
|
-
/**
|
|
33
|
-
* @override
|
|
34
|
-
*/
|
|
35
|
-
_onDestroy(): void;
|
|
36
32
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
export declare enum SpriteDrawMode {
|
|
5
5
|
/** Overall scaling when modifying size. */
|
|
6
6
|
Simple = 0,
|
|
7
|
-
/** When modifying the size, it
|
|
8
|
-
Sliced = 1
|
|
7
|
+
/** When modifying the size of the renderer, it scales to fill the range according to the sprite border settings. */
|
|
8
|
+
Sliced = 1,
|
|
9
|
+
/** When modifying the size of the renderer, it will tile to fill the range according to the sprite border settings. */
|
|
10
|
+
Tiled = 2
|
|
9
11
|
}
|
package/types/2d/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export { OverflowMode } from "./enums/TextOverflow";
|
|
|
5
5
|
export { FontStyle } from "./enums/FontStyle";
|
|
6
6
|
export { SpriteAtlas } from "./atlas/SpriteAtlas";
|
|
7
7
|
export { SpriteDrawMode } from "./enums/SpriteDrawMode";
|
|
8
|
+
export { SpriteTileMode } from "./enums/SpriteTileMode";
|
|
8
9
|
export * from "./sprite/index";
|
|
9
10
|
export * from "./text/index";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Rect, Vector2, Vector4 } from "@galacean/engine-math";
|
|
2
|
-
import { RefObject } from "../../asset/RefObject";
|
|
3
2
|
import { Engine } from "../../Engine";
|
|
3
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
4
4
|
import { Texture2D } from "../../texture/Texture2D";
|
|
5
5
|
/**
|
|
6
6
|
* 2D sprite.
|
|
7
7
|
*/
|
|
8
|
-
export declare class Sprite extends
|
|
8
|
+
export declare class Sprite extends ReferResource {
|
|
9
9
|
/** The name of sprite. */
|
|
10
10
|
name: string;
|
|
11
11
|
private _automaticWidth;
|
|
@@ -100,4 +100,7 @@ export declare class Sprite extends RefObject {
|
|
|
100
100
|
private _updatePositions;
|
|
101
101
|
private _updateUVs;
|
|
102
102
|
private _dispatchSpriteChange;
|
|
103
|
+
private _onRegionChange;
|
|
104
|
+
private _onPivotChange;
|
|
105
|
+
private _onBorderChange;
|
|
103
106
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
1
|
import { Renderer } from "../../Renderer";
|
|
4
2
|
import { Sprite } from "./Sprite";
|
|
5
3
|
/**
|
|
@@ -54,15 +52,6 @@ export declare class SpriteMask extends Renderer {
|
|
|
54
52
|
*/
|
|
55
53
|
get alphaCutoff(): number;
|
|
56
54
|
set alphaCutoff(value: number);
|
|
57
|
-
/**
|
|
58
|
-
* @override
|
|
59
|
-
*/
|
|
60
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
61
|
-
/**
|
|
62
|
-
* @override
|
|
63
|
-
* @inheritdoc
|
|
64
|
-
*/
|
|
65
|
-
protected _render(context: RenderContext): void;
|
|
66
55
|
private _calDefaultSize;
|
|
67
56
|
private _onSpriteChange;
|
|
68
57
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
3
2
|
import { Renderer } from "../../Renderer";
|
|
4
3
|
import { SpriteDrawMode } from "../enums/SpriteDrawMode";
|
|
5
4
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
5
|
+
import { SpriteTileMode } from "../enums/SpriteTileMode";
|
|
6
6
|
import { Sprite } from "./Sprite";
|
|
7
7
|
/**
|
|
8
8
|
* Renders a Sprite for 2D graphics.
|
|
@@ -10,6 +10,8 @@ import { Sprite } from "./Sprite";
|
|
|
10
10
|
export declare class SpriteRenderer extends Renderer {
|
|
11
11
|
private _drawMode;
|
|
12
12
|
private _assembler;
|
|
13
|
+
private _tileMode;
|
|
14
|
+
private _tiledAdaptiveThreshold;
|
|
13
15
|
private _color;
|
|
14
16
|
private _sprite;
|
|
15
17
|
private _automaticWidth;
|
|
@@ -24,7 +26,17 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
24
26
|
* The draw mode of the sprite renderer.
|
|
25
27
|
*/
|
|
26
28
|
get drawMode(): SpriteDrawMode;
|
|
27
|
-
set drawMode(
|
|
29
|
+
set drawMode(value: SpriteDrawMode);
|
|
30
|
+
/**
|
|
31
|
+
* The tiling mode of the sprite renderer. (Only works in tiled mode.)
|
|
32
|
+
*/
|
|
33
|
+
get tileMode(): SpriteTileMode;
|
|
34
|
+
set tileMode(value: SpriteTileMode);
|
|
35
|
+
/**
|
|
36
|
+
* Stretch Threshold in Tile Adaptive Mode, specified in normalized. (Only works in tiled adaptive mode.)
|
|
37
|
+
*/
|
|
38
|
+
get tiledAdaptiveThreshold(): number;
|
|
39
|
+
set tiledAdaptiveThreshold(value: number);
|
|
28
40
|
/**
|
|
29
41
|
* The Sprite to render.
|
|
30
42
|
*/
|
|
@@ -73,14 +85,6 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
73
85
|
*/
|
|
74
86
|
get maskInteraction(): SpriteMaskInteraction;
|
|
75
87
|
set maskInteraction(value: SpriteMaskInteraction);
|
|
76
|
-
/**
|
|
77
|
-
* @override
|
|
78
|
-
*/
|
|
79
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
80
|
-
/**
|
|
81
|
-
* @override
|
|
82
|
-
*/
|
|
83
|
-
protected _render(context: RenderContext): void;
|
|
84
88
|
private _calDefaultSize;
|
|
85
89
|
private _updateStencilState;
|
|
86
90
|
private _onSpriteChange;
|
package/types/2d/text/Font.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
2
2
|
import { Engine } from "../../Engine";
|
|
3
3
|
/**
|
|
4
4
|
* Font.
|
|
5
5
|
*/
|
|
6
|
-
export declare class Font extends
|
|
7
|
-
private static _fontMap;
|
|
6
|
+
export declare class Font extends ReferResource {
|
|
8
7
|
/**
|
|
9
8
|
* Create a system font.
|
|
10
9
|
* @param engine - Engine to which the font belongs
|
|
@@ -19,8 +18,4 @@ export declare class Font extends RefObject {
|
|
|
19
18
|
*/
|
|
20
19
|
get name(): string;
|
|
21
20
|
constructor(engine: Engine, name?: string);
|
|
22
|
-
/**
|
|
23
|
-
* @override
|
|
24
|
-
*/
|
|
25
|
-
_onDestroy(): void;
|
|
26
21
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../../Entity";
|
|
3
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
4
3
|
import { Renderer } from "../../Renderer";
|
|
5
|
-
import { TransformModifyFlags } from "../../Transform";
|
|
6
4
|
import { FontStyle } from "../enums/FontStyle";
|
|
7
5
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
8
6
|
import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
|
|
@@ -106,17 +104,8 @@ export declare class TextRenderer extends Renderer {
|
|
|
106
104
|
*/
|
|
107
105
|
get bounds(): BoundingBox;
|
|
108
106
|
constructor(entity: Entity);
|
|
109
|
-
/**
|
|
110
|
-
* @override
|
|
111
|
-
*/
|
|
112
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
113
|
-
/**
|
|
114
|
-
* @override
|
|
115
|
-
*/
|
|
116
|
-
protected _render(context: RenderContext): void;
|
|
117
107
|
private _updateStencilState;
|
|
118
108
|
private _resetSubFont;
|
|
119
109
|
private _updatePosition;
|
|
120
110
|
private _updateLocalData;
|
|
121
|
-
protected _onTransformChanged(bit: TransformModifyFlags): void;
|
|
122
111
|
}
|
package/types/2d/text/index.d.ts
CHANGED
package/types/Camera.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { Matrix, Ray, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
4
4
|
import { Layer } from "./Layer";
|
|
5
|
+
import { Shader } from "./shader/Shader";
|
|
5
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
7
|
+
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
6
8
|
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
7
9
|
import { RenderTarget } from "./texture/RenderTarget";
|
|
8
10
|
/**
|
|
9
11
|
* Camera component, as the entrance to the three-dimensional world.
|
|
10
|
-
* @decorator `@dependentComponents(Transform)`
|
|
12
|
+
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
11
13
|
*/
|
|
12
14
|
export declare class Camera extends Component {
|
|
13
15
|
/** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */
|
|
@@ -181,20 +183,37 @@ export declare class Camera extends Component {
|
|
|
181
183
|
*/
|
|
182
184
|
render(cubeFace?: TextureCubeFace, mipLevel?: number): void;
|
|
183
185
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @
|
|
186
|
+
* Set the replacement shader.
|
|
187
|
+
* @param shader - Replacement shader
|
|
188
|
+
* @param replacementTagName - Sub shader tag name
|
|
189
|
+
*
|
|
190
|
+
* @remarks
|
|
191
|
+
* If replacementTagName is not specified, the first sub shader will be replaced.
|
|
192
|
+
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
186
193
|
*/
|
|
187
|
-
|
|
194
|
+
setReplacementShader(shader: Shader, replacementTagName?: string): any;
|
|
195
|
+
/**
|
|
196
|
+
* Set the replacement shader.
|
|
197
|
+
* @param shader - Replacement shader
|
|
198
|
+
* @param replacementTag - Sub shader tag
|
|
199
|
+
*
|
|
200
|
+
* @remarks
|
|
201
|
+
* If replacementTag is not specified, the first sub shader will be replaced.
|
|
202
|
+
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
203
|
+
*/
|
|
204
|
+
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey): any;
|
|
205
|
+
/**
|
|
206
|
+
* Reset and clear the replacement shader.
|
|
207
|
+
*/
|
|
208
|
+
resetReplacementShader(): void;
|
|
188
209
|
/**
|
|
189
|
-
* @override
|
|
190
210
|
* @inheritdoc
|
|
191
211
|
*/
|
|
192
|
-
|
|
212
|
+
_onEnable(): void;
|
|
193
213
|
/**
|
|
194
|
-
* @override
|
|
195
214
|
* @inheritdoc
|
|
196
215
|
*/
|
|
197
|
-
|
|
216
|
+
_onDisable(): void;
|
|
198
217
|
private _projMatChange;
|
|
199
218
|
private _innerViewportToWorldPoint;
|
|
200
219
|
private _updateShaderData;
|
package/types/Component.d.ts
CHANGED
|
@@ -12,10 +12,6 @@ export declare class Component extends EngineObject {
|
|
|
12
12
|
*/
|
|
13
13
|
get enabled(): boolean;
|
|
14
14
|
set enabled(value: boolean);
|
|
15
|
-
/**
|
|
16
|
-
* Indicates whether the component is destroyed.
|
|
17
|
-
*/
|
|
18
|
-
get destroyed(): boolean;
|
|
19
15
|
/**
|
|
20
16
|
* The entity which the component belongs to.
|
|
21
17
|
*/
|
|
@@ -25,8 +21,4 @@ export declare class Component extends EngineObject {
|
|
|
25
21
|
*/
|
|
26
22
|
get scene(): Scene;
|
|
27
23
|
constructor(entity: Entity);
|
|
28
|
-
/**
|
|
29
|
-
* Destroy this instance.
|
|
30
|
-
*/
|
|
31
|
-
destroy(): void;
|
|
32
24
|
}
|
|
@@ -2,16 +2,24 @@ import { Component } from "./Component";
|
|
|
2
2
|
import { Entity } from "./Entity";
|
|
3
3
|
type ComponentConstructor = new (entity: Entity) => Component;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Declare dependent component.
|
|
6
|
+
* @param component - Dependent component
|
|
7
|
+
* @param dependentMode - Dependent mode
|
|
6
8
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export declare function dependentComponents(component: ComponentConstructor, dependentMode?: DependentMode): any;
|
|
10
|
+
/**
|
|
11
|
+
* Declare dependent components.
|
|
12
|
+
* @param components - Dependent components
|
|
13
|
+
* @param dependentMode - Dependent mode
|
|
14
|
+
*/
|
|
15
|
+
export declare function dependentComponents(components: ComponentConstructor[], dependentMode?: DependentMode): any;
|
|
12
16
|
/**
|
|
13
|
-
* Dependent
|
|
14
|
-
* @param components - Dependent components
|
|
17
|
+
* Dependent mode.
|
|
15
18
|
*/
|
|
16
|
-
export declare
|
|
19
|
+
export declare enum DependentMode {
|
|
20
|
+
/** Check only, throw error if dependent components do not exist. */
|
|
21
|
+
CheckOnly = 0,
|
|
22
|
+
/** Auto add if dependent components do not exist. */
|
|
23
|
+
AutoAdd = 1
|
|
24
|
+
}
|
|
17
25
|
export {};
|
|
@@ -2,6 +2,7 @@ import { Camera } from "./Camera";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { Renderer } from "./Renderer";
|
|
4
4
|
import { Script } from "./Script";
|
|
5
|
+
import { Animator } from "./animation";
|
|
5
6
|
/**
|
|
6
7
|
* The manager of the components.
|
|
7
8
|
*/
|
|
@@ -26,8 +27,8 @@ export declare class ComponentsManager {
|
|
|
26
27
|
removeOnLateUpdateScript(script: Script): void;
|
|
27
28
|
addOnPhysicsUpdateScript(script: Script): void;
|
|
28
29
|
removeOnPhysicsUpdateScript(script: Script): void;
|
|
29
|
-
addOnUpdateAnimations(animation:
|
|
30
|
-
removeOnUpdateAnimations(animation:
|
|
30
|
+
addOnUpdateAnimations(animation: Animator): void;
|
|
31
|
+
removeOnUpdateAnimations(animation: Animator): void;
|
|
31
32
|
addOnUpdateRenderers(renderer: Renderer): void;
|
|
32
33
|
removeOnUpdateRenderers(renderer: Renderer): void;
|
|
33
34
|
addDisableScript(component: Script): void;
|
|
@@ -7,11 +7,12 @@ export declare class DisorderedArray<T> {
|
|
|
7
7
|
constructor(count?: number);
|
|
8
8
|
add(element: T): void;
|
|
9
9
|
delete(element: T): void;
|
|
10
|
+
set(index: number, element: T): void;
|
|
10
11
|
get(index: number): T;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param index
|
|
14
|
-
* @returns The replaced item is used to reset its index
|
|
13
|
+
* Delete the element at the specified index.
|
|
14
|
+
* @param index - The index of the element to be deleted
|
|
15
|
+
* @returns The replaced item is used to reset its index
|
|
15
16
|
*/
|
|
16
17
|
deleteByIndex(index: number): T;
|
|
17
18
|
garbageCollection(): void;
|
package/types/Engine.d.ts
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResourceManager } from "./asset/ResourceManager";
|
|
3
|
-
import { EventDispatcher, Time } from "./base";
|
|
1
|
+
import { IPhysics } from "@galacean/engine-design";
|
|
4
2
|
import { Canvas } from "./Canvas";
|
|
5
|
-
import { ComponentsManager } from "./ComponentsManager";
|
|
6
3
|
import { EngineSettings } from "./EngineSettings";
|
|
7
4
|
import { Entity } from "./Entity";
|
|
5
|
+
import { SceneManager } from "./SceneManager";
|
|
6
|
+
import { ResourceManager } from "./asset/ResourceManager";
|
|
7
|
+
import { EventDispatcher, Time } from "./base";
|
|
8
|
+
import { ColorSpace } from "./enums/ColorSpace";
|
|
8
9
|
import { InputManager } from "./input";
|
|
9
|
-
import { LightManager } from "./lighting/LightManager";
|
|
10
|
-
import { Material } from "./material/Material";
|
|
11
10
|
import { PhysicsManager } from "./physics";
|
|
12
11
|
import { IHardwareRenderer } from "./renderingHardwareInterface";
|
|
13
|
-
import { ClassPool } from "./RenderPipeline/ClassPool";
|
|
14
|
-
import { MeshRenderElement } from "./RenderPipeline/MeshRenderElement";
|
|
15
|
-
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
16
|
-
import { SpriteElement } from "./RenderPipeline/SpriteElement";
|
|
17
|
-
import { SpriteMaskElement } from "./RenderPipeline/SpriteMaskElement";
|
|
18
|
-
import { TextRenderElement } from "./RenderPipeline/TextRenderElement";
|
|
19
|
-
import { Scene } from "./Scene";
|
|
20
|
-
import { SceneManager } from "./SceneManager";
|
|
21
|
-
import { RenderState } from "./shader/state/RenderState";
|
|
22
12
|
/**
|
|
23
13
|
* Engine.
|
|
24
14
|
*/
|
|
25
15
|
export declare class Engine extends EventDispatcher {
|
|
26
16
|
/** Physics manager of Engine. */
|
|
27
17
|
readonly physicsManager: PhysicsManager;
|
|
18
|
+
/** Input manager of Engine. */
|
|
28
19
|
readonly inputManager: InputManager;
|
|
29
|
-
_lightManager: LightManager;
|
|
30
|
-
_componentsManager: ComponentsManager;
|
|
31
|
-
_hardwareRenderer: IHardwareRenderer;
|
|
32
|
-
_lastRenderState: RenderState;
|
|
33
|
-
_renderElementPool: ClassPool<MeshRenderElement>;
|
|
34
|
-
_spriteElementPool: ClassPool<SpriteElement>;
|
|
35
|
-
_spriteMaskElementPool: ClassPool<SpriteMaskElement>;
|
|
36
|
-
_textElementPool: ClassPool<TextRenderElement>;
|
|
37
|
-
_spriteDefaultMaterial: Material;
|
|
38
|
-
_spriteMaskDefaultMaterial: Material;
|
|
39
|
-
_textDefaultFont: Font;
|
|
40
|
-
_renderContext: RenderContext;
|
|
41
|
-
protected _canvas: Canvas;
|
|
42
20
|
private _settings;
|
|
43
21
|
private _resourceManager;
|
|
44
22
|
private _sceneManager;
|
|
@@ -52,7 +30,9 @@ export declare class Engine extends EventDispatcher {
|
|
|
52
30
|
private _targetFrameInterval;
|
|
53
31
|
private _destroyed;
|
|
54
32
|
private _frameInProcess;
|
|
55
|
-
private
|
|
33
|
+
private _waitingDestroy;
|
|
34
|
+
private _isDeviceLost;
|
|
35
|
+
private _waitingGC;
|
|
56
36
|
private _animate;
|
|
57
37
|
/**
|
|
58
38
|
* Settings of Engine.
|
|
@@ -63,15 +43,15 @@ export declare class Engine extends EventDispatcher {
|
|
|
63
43
|
*/
|
|
64
44
|
get canvas(): Canvas;
|
|
65
45
|
/**
|
|
66
|
-
*
|
|
46
|
+
* The resource manager.
|
|
67
47
|
*/
|
|
68
48
|
get resourceManager(): ResourceManager;
|
|
69
49
|
/**
|
|
70
|
-
*
|
|
50
|
+
* The scene manager.
|
|
71
51
|
*/
|
|
72
52
|
get sceneManager(): SceneManager;
|
|
73
53
|
/**
|
|
74
|
-
*
|
|
54
|
+
* The time information of the engine.
|
|
75
55
|
*/
|
|
76
56
|
get time(): Time;
|
|
77
57
|
/**
|
|
@@ -96,13 +76,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
96
76
|
* Indicates whether the engine is destroyed.
|
|
97
77
|
*/
|
|
98
78
|
get destroyed(): boolean;
|
|
99
|
-
|
|
100
|
-
* Create engine.
|
|
101
|
-
* @param canvas - The canvas to use for rendering
|
|
102
|
-
* @param hardwareRenderer - Graphics API renderer
|
|
103
|
-
* @param settings - Engine Settings
|
|
104
|
-
*/
|
|
105
|
-
constructor(canvas: Canvas, hardwareRenderer: IHardwareRenderer, settings?: EngineSettings);
|
|
79
|
+
protected constructor(canvas: Canvas, hardwareRenderer: IHardwareRenderer, configuration: EngineConfiguration);
|
|
106
80
|
/**
|
|
107
81
|
* Create an entity.
|
|
108
82
|
* @param name - The name of the entity
|
|
@@ -125,16 +99,34 @@ export declare class Engine extends EventDispatcher {
|
|
|
125
99
|
* Execution engine loop.
|
|
126
100
|
*/
|
|
127
101
|
run(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Force lose graphic device.
|
|
104
|
+
* @remarks Used to simulate the phenomenon after the real loss of device.
|
|
105
|
+
*/
|
|
106
|
+
forceLoseDevice(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Force restore graphic device.
|
|
109
|
+
* @remarks Used to simulate the phenomenon after the real restore of device.
|
|
110
|
+
*/
|
|
111
|
+
forceRestoreDevice(): void;
|
|
128
112
|
private _destroy;
|
|
129
113
|
/**
|
|
130
114
|
* Destroy engine.
|
|
131
115
|
* @remarks If call during frame execution will delay until the end of the frame
|
|
132
116
|
*/
|
|
133
117
|
destroy(): void;
|
|
134
|
-
/**
|
|
135
|
-
* @intenral
|
|
136
|
-
*/
|
|
137
|
-
_render(scene: Scene): void;
|
|
138
118
|
private _createSpriteMaterial;
|
|
139
119
|
private _createSpriteMaskMaterial;
|
|
120
|
+
private _onDeviceLost;
|
|
121
|
+
private _onDeviceRestored;
|
|
122
|
+
private _gc;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Engine configuration.
|
|
126
|
+
*/
|
|
127
|
+
export interface EngineConfiguration {
|
|
128
|
+
/** Physics. */
|
|
129
|
+
physics?: IPhysics;
|
|
130
|
+
/** Color space. */
|
|
131
|
+
colorSpace?: ColorSpace;
|
|
140
132
|
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Matrix } from "@galacean/engine-math";
|
|
2
|
-
import { EngineObject } from "./base";
|
|
3
2
|
import { Component } from "./Component";
|
|
4
3
|
import { Engine } from "./Engine";
|
|
5
4
|
import { Layer } from "./Layer";
|
|
6
5
|
import { Scene } from "./Scene";
|
|
7
6
|
import { Transform } from "./Transform";
|
|
7
|
+
import { EngineObject } from "./base";
|
|
8
8
|
/**
|
|
9
9
|
* Entity, be used as components container.
|
|
10
10
|
*/
|
|
@@ -65,7 +65,7 @@ export declare class Entity extends EngineObject {
|
|
|
65
65
|
* @param type - The type of the component
|
|
66
66
|
* @returns The first component which match type
|
|
67
67
|
*/
|
|
68
|
-
getComponent<T extends Component>(type: new (entity: Entity) => T): T;
|
|
68
|
+
getComponent<T extends Component>(type: new (entity: Entity) => T): T | null;
|
|
69
69
|
/**
|
|
70
70
|
* Get components which match the type.
|
|
71
71
|
* @param type - The type of the component
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SpriteMaskElement } from "./SpriteMaskElement";
|
|
6
|
-
import { TextRenderElement } from "./TextRenderElement";
|
|
3
|
+
import { ShaderTagKey } from "../shader/ShaderTagKey";
|
|
4
|
+
import { RenderElement } from "./RenderElement";
|
|
7
5
|
export declare abstract class Basic2DBatcher {
|
|
6
|
+
protected static _disableBatchTag: ShaderTagKey;
|
|
8
7
|
/** The maximum number of vertex. */
|
|
9
8
|
static MAX_VERTEX_COUNT: number;
|
|
10
9
|
static _canUploadSameBuffer: boolean;
|
|
11
10
|
constructor(engine: Engine);
|
|
12
|
-
drawElement(element:
|
|
13
|
-
|
|
14
|
-
flush(camera: Camera, replaceMaterial: Material): void;
|
|
11
|
+
drawElement(element: RenderElement, camera: Camera): void;
|
|
12
|
+
flush(camera: Camera): void;
|
|
15
13
|
clear(): void;
|
|
16
14
|
destroy(): void;
|
|
15
|
+
private _drawSubElement;
|
|
17
16
|
private _createMesh;
|
|
18
17
|
private _updateData;
|
|
19
18
|
private _getSubMeshFromPool;
|
|
@@ -3,14 +3,14 @@ import { Layer } from "../Layer";
|
|
|
3
3
|
import { Material } from "../material";
|
|
4
4
|
import { RenderTarget, TextureCubeFace } from "../texture";
|
|
5
5
|
import { RenderContext } from "./RenderContext";
|
|
6
|
-
import {
|
|
6
|
+
import { RenderData } from "./RenderData";
|
|
7
7
|
import { RenderPass } from "./RenderPass";
|
|
8
8
|
/**
|
|
9
9
|
* Basic render pipeline.
|
|
10
10
|
*/
|
|
11
11
|
export declare class BasicRenderPipeline {
|
|
12
|
-
private static
|
|
13
|
-
private static
|
|
12
|
+
private static _shadowCasterPipelineStageTagValue;
|
|
13
|
+
private static _forwardPipelineStageTagValue;
|
|
14
14
|
private _camera;
|
|
15
15
|
private _defaultPass;
|
|
16
16
|
private _renderPassArray;
|
|
@@ -57,10 +57,12 @@ export declare class BasicRenderPipeline {
|
|
|
57
57
|
render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number): void;
|
|
58
58
|
private _drawRenderPass;
|
|
59
59
|
/**
|
|
60
|
-
* Push
|
|
61
|
-
* @param
|
|
60
|
+
* Push render data to render queue.
|
|
61
|
+
* @param context - Render context
|
|
62
|
+
* @param data - Render data
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
+
pushRenderData(context: RenderContext, data: RenderData): void;
|
|
65
|
+
private pushRenderDataWihShader;
|
|
64
66
|
private _drawBackgroundTexture;
|
|
65
67
|
private _callRender;
|
|
66
68
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { CullingResults } from "../RenderPipeline/CullingResults";
|
|
3
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
4
|
+
/**
|
|
5
|
+
* PipelinePass is a base class for all pipeline passes.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class PipelinePass {
|
|
8
|
+
protected _engine: Engine;
|
|
9
|
+
constructor(engine: Engine);
|
|
10
|
+
/**
|
|
11
|
+
* Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
|
|
12
|
+
* @param context - Rendering context
|
|
13
|
+
* @param cullingResults - Culling results
|
|
14
|
+
*/
|
|
15
|
+
abstract onRender(context: RenderContext, cullingResults: CullingResults): void;
|
|
16
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Renderer } from "../Renderer";
|
|
3
|
-
import { ShaderPass } from "../shader";
|
|
1
|
+
import { ShaderPass } from "../shader/ShaderPass";
|
|
4
2
|
import { RenderState } from "../shader/state/RenderState";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
renderState: RenderState;
|
|
3
|
+
import { IPoolElement } from "./IPoolElement";
|
|
4
|
+
import { RenderData } from "./RenderData";
|
|
5
|
+
export declare class RenderElement implements IPoolElement {
|
|
6
|
+
data: RenderData;
|
|
10
7
|
shaderPass: ShaderPass;
|
|
8
|
+
renderState: RenderState;
|
|
9
|
+
set(data: RenderData, shaderPass: ShaderPass, renderState: RenderState): void;
|
|
10
|
+
dispose(): void;
|
|
11
11
|
}
|
|
@@ -23,7 +23,7 @@ declare class RenderPass {
|
|
|
23
23
|
* @param name - Pass name
|
|
24
24
|
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
25
25
|
* @param renderTarget - The specified Render Target
|
|
26
|
-
* @param replaceMaterial -
|
|
26
|
+
* @param replaceMaterial - Replaced material
|
|
27
27
|
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
28
28
|
*/
|
|
29
29
|
constructor(name?: string, priority?: number, renderTarget?: any, replaceMaterial?: any, mask?: any);
|