@galacean/engine-core 1.4.0-alpha.0 → 1.4.0-alpha.2
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 +2846 -1091
- package/dist/main.js.map +1 -1
- package/dist/module.js +2833 -1091
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +5 -3
- package/types/Engine.d.ts +12 -0
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
- package/types/RenderPipeline/Blitter.d.ts +28 -0
- package/types/RenderPipeline/index.d.ts +2 -1
- package/types/Renderer.d.ts +0 -2
- package/types/Scene.d.ts +3 -0
- package/types/Transform.d.ts +17 -7
- package/types/asset/AssetType.d.ts +6 -2
- package/types/asset/request.d.ts +10 -3
- package/types/audio/AudioClip.d.ts +24 -0
- package/types/audio/AudioManager.d.ts +1 -0
- package/types/audio/AudioSource.d.ts +72 -0
- package/types/audio/index.d.ts +3 -0
- package/types/index.d.ts +2 -0
- package/types/material/BaseMaterial.d.ts +4 -2
- package/types/material/PBRMaterial.d.ts +97 -4
- package/types/material/enums/Refraction.d.ts +9 -0
- package/types/material/index.d.ts +1 -0
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/Collision.d.ts +18 -0
- package/types/physics/ContactPoint.d.ts +14 -0
- package/types/physics/DynamicCollider.d.ts +33 -4
- package/types/physics/PhysicsMaterial.d.ts +5 -1
- package/types/physics/index.d.ts +2 -0
- package/types/physics/joint/FixedJoint.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +9 -6
- package/types/physics/joint/Joint.d.ts +29 -10
- package/types/physics/joint/JointLimits.d.ts +34 -10
- package/types/physics/joint/JointMotor.d.ts +27 -8
- package/types/physics/joint/SpringJoint.d.ts +2 -6
- package/types/physics/shape/BoxColliderShape.d.ts +1 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
- package/types/physics/shape/ColliderShape.d.ts +11 -3
- package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
- package/types/postProcess/PostProcess.d.ts +60 -0
- package/types/postProcess/PostProcessEffect.d.ts +26 -0
- package/types/postProcess/PostProcessEffectParameter.d.ts +25 -0
- package/types/postProcess/PostProcessManager.d.ts +37 -1
- package/types/postProcess/PostProcessPass.d.ts +50 -0
- package/types/postProcess/PostProcessUberPass.d.ts +25 -0
- package/types/postProcess/effects/BloomEffect.d.ts +22 -64
- package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
- package/types/postProcess/index.d.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-math": "1.4.0-alpha.
|
|
21
|
+
"@galacean/engine-math": "1.4.0-alpha.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@galacean/engine-design": "1.4.0-alpha.
|
|
24
|
+
"@galacean/engine-design": "1.4.0-alpha.2"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ export declare class Camera extends Component {
|
|
|
34
34
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
35
35
|
*/
|
|
36
36
|
cullingMask: Layer;
|
|
37
|
+
/**
|
|
38
|
+
* Determines which PostProcess to use.
|
|
39
|
+
*/
|
|
40
|
+
postProcessMask: Layer;
|
|
37
41
|
/**
|
|
38
42
|
* Depth texture mode.
|
|
39
43
|
* If `DepthTextureMode.PrePass` is used, the depth texture can be accessed in the shader using `camera_DepthTexture`.
|
|
@@ -50,7 +54,7 @@ export declare class Camera extends Component {
|
|
|
50
54
|
/**
|
|
51
55
|
* Multi-sample anti-aliasing samples when use independent canvas mode.
|
|
52
56
|
*
|
|
53
|
-
* @remarks
|
|
57
|
+
* @remarks It will take effect when `independentCanvasEnabled` property is `true`, otherwise it will be invalid.
|
|
54
58
|
*/
|
|
55
59
|
msaaSamples: MSAASamples;
|
|
56
60
|
private _priority;
|
|
@@ -68,7 +72,6 @@ export declare class Camera extends Component {
|
|
|
68
72
|
private _enableHDR;
|
|
69
73
|
private _enablePostProcess;
|
|
70
74
|
private _frustumChangeFlag;
|
|
71
|
-
private _transform;
|
|
72
75
|
private _isViewMatrixDirty;
|
|
73
76
|
private _isInvViewProjDirty;
|
|
74
77
|
private _viewport;
|
|
@@ -86,7 +89,6 @@ export declare class Camera extends Component {
|
|
|
86
89
|
set opaqueTextureEnabled(value: boolean);
|
|
87
90
|
/**
|
|
88
91
|
* Whether independent canvas is enabled.
|
|
89
|
-
*
|
|
90
92
|
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
91
93
|
*/
|
|
92
94
|
get independentCanvasEnabled(): boolean;
|
package/types/Engine.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ColorSpace } from "./enums/ColorSpace";
|
|
|
9
9
|
import { InputManager } from "./input";
|
|
10
10
|
import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
|
|
11
11
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
12
|
+
import { PostProcessPass } from "./postProcess/PostProcessPass";
|
|
12
13
|
import { XRManager } from "./xr/XRManager";
|
|
13
14
|
/**
|
|
14
15
|
* Engine.
|
|
@@ -35,6 +36,8 @@ export declare class Engine extends EventDispatcher {
|
|
|
35
36
|
private _waitingDestroy;
|
|
36
37
|
private _isDeviceLost;
|
|
37
38
|
private _waitingGC;
|
|
39
|
+
private _postProcessPasses;
|
|
40
|
+
private _activePostProcessPasses;
|
|
38
41
|
private _animate;
|
|
39
42
|
/**
|
|
40
43
|
* Settings of Engine.
|
|
@@ -74,6 +77,10 @@ export declare class Engine extends EventDispatcher {
|
|
|
74
77
|
*/
|
|
75
78
|
get targetFrameRate(): number;
|
|
76
79
|
set targetFrameRate(value: number);
|
|
80
|
+
/**
|
|
81
|
+
* All post process passes.
|
|
82
|
+
*/
|
|
83
|
+
get postProcessPasses(): ReadonlyArray<PostProcessPass>;
|
|
77
84
|
/**
|
|
78
85
|
* Indicates whether the engine is destroyed.
|
|
79
86
|
*/
|
|
@@ -111,6 +118,11 @@ export declare class Engine extends EventDispatcher {
|
|
|
111
118
|
* @remarks Used to simulate the phenomenon after the real restore of device.
|
|
112
119
|
*/
|
|
113
120
|
forceRestoreDevice(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Add a post process pass.
|
|
123
|
+
* @param pass - Post process pass to add
|
|
124
|
+
*/
|
|
125
|
+
addPostProcessPass(pass: PostProcessPass): void;
|
|
114
126
|
private _destroy;
|
|
115
127
|
/**
|
|
116
128
|
* Destroy engine.
|
package/types/Entity.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Matrix } from "@galacean/engine-math";
|
|
2
|
+
import { BoolUpdateFlag } from "./BoolUpdateFlag";
|
|
2
3
|
import { Component } from "./Component";
|
|
3
4
|
import { Engine } from "./Engine";
|
|
4
5
|
import { Layer } from "./Layer";
|
|
@@ -13,11 +14,14 @@ export declare class Entity extends EngineObject {
|
|
|
13
14
|
name: string;
|
|
14
15
|
/** The layer the entity belongs to. */
|
|
15
16
|
layer: Layer;
|
|
16
|
-
|
|
17
|
-
readonly transform: Transform;
|
|
17
|
+
private _transform;
|
|
18
18
|
private _templateResource;
|
|
19
19
|
private _parent;
|
|
20
20
|
private _activeChangedComponents;
|
|
21
|
+
/**
|
|
22
|
+
* The transform of this entity.
|
|
23
|
+
*/
|
|
24
|
+
get transform(): Transform;
|
|
21
25
|
/**
|
|
22
26
|
* Whether to activate locally.
|
|
23
27
|
*/
|
|
@@ -53,8 +57,10 @@ export declare class Entity extends EngineObject {
|
|
|
53
57
|
/**
|
|
54
58
|
* Create a entity.
|
|
55
59
|
* @param engine - The engine the entity belongs to
|
|
60
|
+
* @param name - The name of the entity
|
|
61
|
+
* @param components - The types of components you wish to add
|
|
56
62
|
*/
|
|
57
|
-
constructor(engine: Engine, name?: string);
|
|
63
|
+
constructor(engine: Engine, name?: string, ...components: ComponentConstructor[]);
|
|
58
64
|
/**
|
|
59
65
|
* Add component based on the component type.
|
|
60
66
|
* @param type - The type of the component
|
|
@@ -132,6 +138,11 @@ export declare class Entity extends EngineObject {
|
|
|
132
138
|
* @returns Cloned entity
|
|
133
139
|
*/
|
|
134
140
|
clone(): Entity;
|
|
141
|
+
/**
|
|
142
|
+
* Listen for changes in the world pose of this `Entity`.
|
|
143
|
+
* @returns Change flag
|
|
144
|
+
*/
|
|
145
|
+
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
135
146
|
private _createCloneEntity;
|
|
136
147
|
private _parseCloneEntity;
|
|
137
148
|
/**
|
|
@@ -153,4 +164,5 @@ export declare class Entity extends EngineObject {
|
|
|
153
164
|
getInvModelMatrix(): Matrix;
|
|
154
165
|
}
|
|
155
166
|
type ComponentArguments<T extends new (entity: Entity, ...args: any[]) => Component> = T extends new (entity: Entity, ...args: infer P) => Component ? P : never;
|
|
167
|
+
type ComponentConstructor = new (entity: Entity) => Component;
|
|
156
168
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,10 @@ export declare class BasicRenderPipeline {
|
|
|
13
13
|
private _cascadedShadowCasterPass;
|
|
14
14
|
private _depthOnlyPass;
|
|
15
15
|
private _opaqueTexturePass;
|
|
16
|
+
private _grabTexture;
|
|
17
|
+
private _canUseBlitFrameBuffer;
|
|
18
|
+
private _shouldGrabColor;
|
|
19
|
+
private _sourceScaleOffset;
|
|
16
20
|
/**
|
|
17
21
|
* Create a basic render pipeline.
|
|
18
22
|
* @param camera - Camera
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { RenderTarget, Texture2D } from "../texture";
|
|
5
|
+
/**
|
|
6
|
+
* A helper class to blit texture to destination render target.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Blitter {
|
|
9
|
+
private static _blitTextureProperty;
|
|
10
|
+
private static _blitMipLevelProperty;
|
|
11
|
+
private static _blitTexelSizeProperty;
|
|
12
|
+
private static _sourceScaleOffsetProperty;
|
|
13
|
+
private static _rendererShaderData;
|
|
14
|
+
private static _texelSize;
|
|
15
|
+
private static _defaultScaleOffset;
|
|
16
|
+
/**
|
|
17
|
+
* Blit texture to destination render target using a triangle.
|
|
18
|
+
* @param engine - Engine
|
|
19
|
+
* @param source - Source texture
|
|
20
|
+
* @param destination - Destination render target
|
|
21
|
+
* @param mipLevel - Mip level to blit
|
|
22
|
+
* @param viewport - Viewport
|
|
23
|
+
* @param material - The material to use when blit
|
|
24
|
+
* @param passIndex - Pass index to use of the provided material
|
|
25
|
+
* @param flipYOfSource - Whether flip Y axis of source texture
|
|
26
|
+
*/
|
|
27
|
+
static blitTexture(engine: Engine, source: Texture2D, destination: RenderTarget | null, mipLevel?: number, viewport?: Vector4, material?: Material, passIndex?: number, sourceScaleOffset?: Vector4): void;
|
|
28
|
+
}
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
4
|
-
import { Transform } from "./Transform";
|
|
5
4
|
import { IComponentCustomClone } from "./clone/ComponentCloner";
|
|
6
5
|
import { Material } from "./material";
|
|
7
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
@@ -24,7 +23,6 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
24
23
|
protected _materials: Material[];
|
|
25
24
|
protected _dirtyUpdateFlag: number;
|
|
26
25
|
protected _rendererLayer: Vector4;
|
|
27
|
-
protected _transform: Transform;
|
|
28
26
|
private _shaderData;
|
|
29
27
|
private _mvMatrix;
|
|
30
28
|
private _mvpMatrix;
|
package/types/Scene.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { FogMode } from "./enums/FogMode";
|
|
|
7
7
|
import { DirectLight } from "./lighting";
|
|
8
8
|
import { AmbientLight } from "./lighting/AmbientLight";
|
|
9
9
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
10
|
+
import { PostProcessManager } from "./postProcess";
|
|
10
11
|
import { ShaderData } from "./shader/ShaderData";
|
|
11
12
|
import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode";
|
|
12
13
|
import { ShadowResolution } from "./shadow/enum/ShadowResolution";
|
|
@@ -35,6 +36,8 @@ export declare class Scene extends EngineObject {
|
|
|
35
36
|
* @remarks Value 0 is used for no shadow fade.
|
|
36
37
|
*/
|
|
37
38
|
shadowFadeBorder: number;
|
|
39
|
+
/** Post process manager. */
|
|
40
|
+
readonly postProcessManager: PostProcessManager;
|
|
38
41
|
private _background;
|
|
39
42
|
private _shaderData;
|
|
40
43
|
private _shadowCascades;
|
package/types/Transform.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ export declare class Transform extends Component {
|
|
|
18
18
|
private _rotation;
|
|
19
19
|
private _rotationQuaternion;
|
|
20
20
|
private _scale;
|
|
21
|
+
private _localUniformScaling;
|
|
21
22
|
private _worldPosition;
|
|
22
23
|
private _worldRotation;
|
|
23
24
|
private _worldRotationQuaternion;
|
|
25
|
+
private _worldUniformScaling;
|
|
24
26
|
private _lossyWorldScale;
|
|
25
27
|
private _localMatrix;
|
|
26
28
|
private _worldMatrix;
|
|
@@ -69,8 +71,8 @@ export declare class Transform extends Component {
|
|
|
69
71
|
set scale(value: Vector3);
|
|
70
72
|
/**
|
|
71
73
|
* Local lossy scaling.
|
|
72
|
-
* @remarks The value obtained may not be correct under certain conditions(for example, the parent node has scaling,
|
|
73
|
-
* and the child node has a rotation), the scaling will be tilted.
|
|
74
|
+
* @remarks The value obtained may not be correct under certain conditions(for example, the parent node has non-uniform world scaling,
|
|
75
|
+
* and the child node has a rotation), the scaling will be tilted.
|
|
74
76
|
*/
|
|
75
77
|
get lossyWorldScale(): Vector3;
|
|
76
78
|
/**
|
|
@@ -190,11 +192,6 @@ export declare class Transform extends Component {
|
|
|
190
192
|
* @param worldUp - Up direction in world space, default is Vector3(0, 1, 0)
|
|
191
193
|
*/
|
|
192
194
|
lookAt(targetPosition: Vector3, worldUp?: Vector3): void;
|
|
193
|
-
/**
|
|
194
|
-
* Register world transform change flag.
|
|
195
|
-
* @returns Change flag
|
|
196
|
-
*/
|
|
197
|
-
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
198
195
|
protected _onDestroy(): void;
|
|
199
196
|
/**
|
|
200
197
|
* Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
|
|
@@ -207,6 +204,7 @@ export declare class Transform extends Component {
|
|
|
207
204
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
208
205
|
* Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities.
|
|
209
206
|
* Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities.
|
|
207
|
+
* Get worldScale: Will trigger the scaling update of itself and all parent entities.
|
|
210
208
|
* In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.
|
|
211
209
|
*/
|
|
212
210
|
private _updateWorldRotationFlag;
|
|
@@ -215,7 +213,9 @@ export declare class Transform extends Component {
|
|
|
215
213
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
216
214
|
* Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities.
|
|
217
215
|
* Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities.
|
|
216
|
+
* Get worldScale: Will trigger the scaling update of itself and all parent entities.
|
|
218
217
|
* In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.
|
|
218
|
+
* @param flags - Dirty flag
|
|
219
219
|
*/
|
|
220
220
|
private _updateWorldPositionAndRotationFlag;
|
|
221
221
|
/**
|
|
@@ -223,6 +223,7 @@ export declare class Transform extends Component {
|
|
|
223
223
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
224
224
|
* Get worldScale: Will trigger the scaling update of itself and all parent entities.
|
|
225
225
|
* In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.
|
|
226
|
+
* @param flags - Dirty flag
|
|
226
227
|
*/
|
|
227
228
|
private _updateWorldScaleFlag;
|
|
228
229
|
/**
|
|
@@ -230,10 +231,12 @@ export declare class Transform extends Component {
|
|
|
230
231
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
231
232
|
* Get worldScale: Will trigger the scaling update of itself and all parent entities.
|
|
232
233
|
* In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.
|
|
234
|
+
* @param flags - Dirty flag
|
|
233
235
|
*/
|
|
234
236
|
private _updateWorldPositionAndScaleFlag;
|
|
235
237
|
/**
|
|
236
238
|
* Update all world transform property dirty flag, the principle is the same as above.
|
|
239
|
+
* @param flags - Dirty flag
|
|
237
240
|
*/
|
|
238
241
|
private _updateAllWorldFlag;
|
|
239
242
|
private _getParentTransform;
|
|
@@ -253,4 +256,11 @@ export declare class Transform extends Component {
|
|
|
253
256
|
private _onRotationQuaternionChanged;
|
|
254
257
|
private _onWorldRotationQuaternionChanged;
|
|
255
258
|
private _onScaleChanged;
|
|
259
|
+
private _getWorldUniformScaling;
|
|
260
|
+
/**
|
|
261
|
+
* @deprecated
|
|
262
|
+
* Listen for changes in the world pose of this `Entity`.
|
|
263
|
+
* @returns Change flag
|
|
264
|
+
*/
|
|
265
|
+
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
256
266
|
}
|
|
@@ -55,8 +55,12 @@ export declare enum AssetType {
|
|
|
55
55
|
HDR = "HDR",
|
|
56
56
|
/** Font. */
|
|
57
57
|
Font = "Font",
|
|
58
|
-
/** Source Font, include ttf
|
|
58
|
+
/** Source Font, include ttf, otf and woff. */
|
|
59
59
|
SourceFont = "SourceFont",
|
|
60
|
+
/** AudioClip, include ogg, wav and mp3. */
|
|
61
|
+
Audio = "Audio",
|
|
60
62
|
/** Project asset. */
|
|
61
|
-
Project = "project"
|
|
63
|
+
Project = "project",
|
|
64
|
+
/** PhysicsMaterial. */
|
|
65
|
+
PhysicsMaterial = "PhysicsMaterial"
|
|
62
66
|
}
|
package/types/asset/request.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { AssetPromise } from "./AssetPromise";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for `request`.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This type extends the standard `RequestInit` options with additional
|
|
6
|
+
* properties for handling retries, timeouts, and custom response types.
|
|
7
|
+
*/
|
|
2
8
|
export type RequestConfig = {
|
|
3
9
|
type?: XMLHttpRequestResponseType | "image";
|
|
4
10
|
retryCount?: number;
|
|
@@ -6,9 +12,10 @@ export type RequestConfig = {
|
|
|
6
12
|
timeout?: number;
|
|
7
13
|
} & RequestInit;
|
|
8
14
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @param url - The
|
|
11
|
-
* @param config -
|
|
15
|
+
* Sends a request to the specified URL and returns a promise for the response.
|
|
16
|
+
* @param url - The URL to send the request to
|
|
17
|
+
* @param config - Configuration options for the request
|
|
18
|
+
* @returns A promise that resolves with the response of type `T`
|
|
12
19
|
*/
|
|
13
20
|
export declare function request<T>(url: string, config?: RequestConfig): AssetPromise<T>;
|
|
14
21
|
export declare class MultiExecutor {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { ReferResource } from "../asset/ReferResource";
|
|
3
|
+
/**
|
|
4
|
+
* Audio Clip.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AudioClip extends ReferResource {
|
|
7
|
+
private _audioBuffer;
|
|
8
|
+
/** Name of clip. */
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Number of discrete audio channels.
|
|
12
|
+
*/
|
|
13
|
+
get channels(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Sample rate, in samples per second.
|
|
16
|
+
*/
|
|
17
|
+
get sampleRate(): number;
|
|
18
|
+
/**
|
|
19
|
+
* Duration, in seconds.
|
|
20
|
+
*/
|
|
21
|
+
get duration(): number;
|
|
22
|
+
constructor(engine: Engine, name?: string);
|
|
23
|
+
protected _onDestroy(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Component } from "../Component";
|
|
2
|
+
import { AudioClip } from "./AudioClip";
|
|
3
|
+
/**
|
|
4
|
+
* Audio Source Component.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AudioSource extends Component {
|
|
7
|
+
/** If set to true, the audio component automatically begins to play on startup. */
|
|
8
|
+
playOnEnabled: boolean;
|
|
9
|
+
private _isPlaying;
|
|
10
|
+
private _clip;
|
|
11
|
+
private _gainNode;
|
|
12
|
+
private _sourceNode;
|
|
13
|
+
private _pausedTime;
|
|
14
|
+
private _playTime;
|
|
15
|
+
private _volume;
|
|
16
|
+
private _lastVolume;
|
|
17
|
+
private _playbackRate;
|
|
18
|
+
private _loop;
|
|
19
|
+
/**
|
|
20
|
+
* The audio clip to play.
|
|
21
|
+
*/
|
|
22
|
+
get clip(): AudioClip;
|
|
23
|
+
set clip(value: AudioClip);
|
|
24
|
+
/**
|
|
25
|
+
* Whether the clip playing right now.
|
|
26
|
+
*/
|
|
27
|
+
get isPlaying(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The volume of the audio source, ranging from 0 to 1.
|
|
30
|
+
* @defaultValue `1`
|
|
31
|
+
*/
|
|
32
|
+
get volume(): number;
|
|
33
|
+
set volume(value: number);
|
|
34
|
+
/**
|
|
35
|
+
* The playback rate of the audio source.
|
|
36
|
+
* @defaultValue `1`
|
|
37
|
+
*/
|
|
38
|
+
get playbackRate(): number;
|
|
39
|
+
set playbackRate(value: number);
|
|
40
|
+
/**
|
|
41
|
+
* Mutes or unmute the audio source.
|
|
42
|
+
* Mute sets volume as 0, unmute restore volume.
|
|
43
|
+
*/
|
|
44
|
+
get mute(): boolean;
|
|
45
|
+
set mute(value: boolean);
|
|
46
|
+
/**
|
|
47
|
+
* Whether the audio clip looping.
|
|
48
|
+
* @defaultValue `false`
|
|
49
|
+
*/
|
|
50
|
+
get loop(): boolean;
|
|
51
|
+
set loop(value: boolean);
|
|
52
|
+
/**
|
|
53
|
+
* Playback position in seconds.
|
|
54
|
+
*/
|
|
55
|
+
get time(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Play the clip.
|
|
58
|
+
*/
|
|
59
|
+
play(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Stops playing the clip.
|
|
62
|
+
*/
|
|
63
|
+
stop(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Pauses playing the clip.
|
|
66
|
+
*/
|
|
67
|
+
pause(): void;
|
|
68
|
+
private _onPlayEnd;
|
|
69
|
+
private _initSourceNode;
|
|
70
|
+
private _clearSourceNode;
|
|
71
|
+
private _canPlay;
|
|
72
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { BoolUpdateFlag } from "./BoolUpdateFlag";
|
|
|
16
16
|
export type { EngineSettings } from "./EngineSettings";
|
|
17
17
|
export type { EngineConfiguration } from "./Engine";
|
|
18
18
|
export { request } from "./asset/request";
|
|
19
|
+
export type { RequestConfig } from "./asset/request";
|
|
19
20
|
export { Loader } from "./asset/Loader";
|
|
20
21
|
export { ContentRestorer } from "./asset/ContentRestorer";
|
|
21
22
|
export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
|
|
@@ -59,5 +60,6 @@ export * from "./clone/CloneManager";
|
|
|
59
60
|
export * from "./renderingHardwareInterface/index";
|
|
60
61
|
export * from "./physics/index";
|
|
61
62
|
export * from "./Utils";
|
|
63
|
+
export * from "./audio/index";
|
|
62
64
|
export { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
|
|
63
65
|
export * from "./postProcess";
|
|
@@ -16,10 +16,10 @@ export declare class BaseMaterial extends Material {
|
|
|
16
16
|
protected static _normalIntensityProp: ShaderProperty;
|
|
17
17
|
protected static _emissiveColorProp: ShaderProperty;
|
|
18
18
|
protected static _emissiveTextureProp: ShaderProperty;
|
|
19
|
-
|
|
19
|
+
protected static _alphaCutoffProp: ShaderProperty;
|
|
20
20
|
private static _alphaCutoffMacro;
|
|
21
21
|
private _renderFace;
|
|
22
|
-
|
|
22
|
+
protected _isTransparent: boolean;
|
|
23
23
|
private _blendMode;
|
|
24
24
|
/**
|
|
25
25
|
* Shader used by the material.
|
|
@@ -83,4 +83,6 @@ export declare class BaseMaterial extends Material {
|
|
|
83
83
|
* @param target - target material
|
|
84
84
|
*/
|
|
85
85
|
cloneTo(target: BaseMaterial): void;
|
|
86
|
+
protected _seIsTransparent(value: boolean): void;
|
|
87
|
+
protected _setAlphaCutoff(value: number): void;
|
|
86
88
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Vector2 } from "@galacean/engine-math";
|
|
1
|
+
import { Color, Vector2 } from "@galacean/engine-math";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { Texture2D } from "../texture/Texture2D";
|
|
4
4
|
import { PBRBaseMaterial } from "./PBRBaseMaterial";
|
|
5
|
+
import { RefractionMode } from "./enums/Refraction";
|
|
5
6
|
/**
|
|
6
7
|
* PBR (Metallic-Roughness Workflow) Material.
|
|
7
8
|
*/
|
|
@@ -12,11 +13,27 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
12
13
|
private static _iorProp;
|
|
13
14
|
private static _anisotropyInfoProp;
|
|
14
15
|
private static _anisotropyTextureProp;
|
|
15
|
-
private _anisotropyRotation;
|
|
16
16
|
private static _iridescenceInfoProp;
|
|
17
17
|
private static _iridescenceThicknessTextureProp;
|
|
18
18
|
private static _iridescenceTextureProp;
|
|
19
|
+
private static _sheenColorProp;
|
|
20
|
+
private static _sheenRoughnessProp;
|
|
21
|
+
private static _sheenTextureProp;
|
|
22
|
+
private static _sheenRoughnessTextureProp;
|
|
23
|
+
private static _transmissionMacro;
|
|
24
|
+
private static _thicknessMacro;
|
|
25
|
+
private static _thicknessTextureMacro;
|
|
26
|
+
private static _transmissionTextureMacro;
|
|
27
|
+
private static _transmissionProp;
|
|
28
|
+
private static _transmissionTextureProp;
|
|
29
|
+
private static _attenuationColorProp;
|
|
30
|
+
private static _attenuationDistanceProp;
|
|
31
|
+
private static _thicknessProp;
|
|
32
|
+
private static _thicknessTextureProp;
|
|
33
|
+
private _refractionMode;
|
|
34
|
+
private _anisotropyRotation;
|
|
19
35
|
private _iridescenceRange;
|
|
36
|
+
private _sheenEnabled;
|
|
20
37
|
/**
|
|
21
38
|
* Index Of Refraction.
|
|
22
39
|
* @defaultValue `1.5`
|
|
@@ -80,7 +97,7 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
80
97
|
set iridescenceIOR(value: number);
|
|
81
98
|
/**
|
|
82
99
|
* The range of iridescence thickness, x is minimum, y is maximum.
|
|
83
|
-
* @defaultValue `[100, 400]
|
|
100
|
+
* @defaultValue `[100, 400]`
|
|
84
101
|
*/
|
|
85
102
|
get iridescenceThicknessRange(): Vector2;
|
|
86
103
|
set iridescenceThicknessRange(value: Vector2);
|
|
@@ -92,14 +109,90 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
92
109
|
*/
|
|
93
110
|
get iridescenceThicknessTexture(): Texture2D;
|
|
94
111
|
set iridescenceThicknessTexture(value: Texture2D);
|
|
112
|
+
/**
|
|
113
|
+
* Sheen color.
|
|
114
|
+
* @defaultValue `[0,0,0]`
|
|
115
|
+
*/
|
|
116
|
+
get sheenColor(): Color;
|
|
117
|
+
set sheenColor(value: Color);
|
|
118
|
+
/**
|
|
119
|
+
* Sheen roughness, from 0.0 to 1.0.
|
|
120
|
+
* @defaultValue `0.0`
|
|
121
|
+
*/
|
|
122
|
+
get sheenRoughness(): number;
|
|
123
|
+
set sheenRoughness(value: number);
|
|
124
|
+
/**
|
|
125
|
+
* Sheen color texture, multiply ‘sheenColor’.
|
|
126
|
+
*/
|
|
127
|
+
get sheenColorTexture(): Texture2D;
|
|
128
|
+
set sheenColorTexture(value: Texture2D);
|
|
129
|
+
/**
|
|
130
|
+
* Sheen roughness texture.
|
|
131
|
+
* @remarks Use alpha channel, and multiply 'sheenRoughness'.
|
|
132
|
+
*/
|
|
133
|
+
get sheenRoughnessTexture(): Texture2D;
|
|
134
|
+
set sheenRoughnessTexture(value: Texture2D);
|
|
135
|
+
/**
|
|
136
|
+
* Refraction switch.
|
|
137
|
+
* @remarks Use refractionMode to set the refraction shape.
|
|
138
|
+
*/
|
|
139
|
+
get refractionMode(): RefractionMode;
|
|
140
|
+
set refractionMode(value: RefractionMode);
|
|
141
|
+
/**
|
|
142
|
+
* @inheritdoc
|
|
143
|
+
*/
|
|
144
|
+
get isTransparent(): boolean;
|
|
145
|
+
set isTransparent(value: boolean);
|
|
146
|
+
/**
|
|
147
|
+
* @inheritdoc
|
|
148
|
+
*/
|
|
149
|
+
get alphaCutoff(): number;
|
|
150
|
+
set alphaCutoff(value: number);
|
|
151
|
+
/**
|
|
152
|
+
* Transmission factor.
|
|
153
|
+
* @defaultValue `0.0`
|
|
154
|
+
*/
|
|
155
|
+
get transmission(): number;
|
|
156
|
+
set transmission(value: number);
|
|
157
|
+
/**
|
|
158
|
+
* Transmission texture.
|
|
159
|
+
* @remarks Use red channel, and multiply 'transmission'.
|
|
160
|
+
*/
|
|
161
|
+
get transmissionTexture(): Texture2D;
|
|
162
|
+
set transmissionTexture(value: Texture2D);
|
|
163
|
+
/**
|
|
164
|
+
* Attenuation color.
|
|
165
|
+
* @defaultValue `[1,1,1]`
|
|
166
|
+
*/
|
|
167
|
+
get attenuationColor(): Color;
|
|
168
|
+
set attenuationColor(value: Color);
|
|
169
|
+
/**
|
|
170
|
+
* Attenuation distance, greater than 0.0.
|
|
171
|
+
* @defaultValue `infinity`
|
|
172
|
+
*/
|
|
173
|
+
get attenuationDistance(): number;
|
|
174
|
+
set attenuationDistance(value: number);
|
|
175
|
+
/**
|
|
176
|
+
* Thickness, greater than or equal to 0.0.
|
|
177
|
+
* @defaultValue `0.0`
|
|
178
|
+
*/
|
|
179
|
+
get thickness(): number;
|
|
180
|
+
set thickness(value: number);
|
|
181
|
+
/**
|
|
182
|
+
* Thickness texture.
|
|
183
|
+
* @remarks Use green channel, and multiply 'thickness', range is 0.0 to 1.0.
|
|
184
|
+
*/
|
|
185
|
+
get thicknessTexture(): Texture2D;
|
|
186
|
+
set thicknessTexture(value: Texture2D);
|
|
95
187
|
/**
|
|
96
188
|
* Create a pbr metallic-roughness workflow material instance.
|
|
97
189
|
* @param engine - Engine to which the material belongs
|
|
98
190
|
*/
|
|
99
191
|
constructor(engine: Engine);
|
|
100
|
-
private _onIridescenceRangeChanged;
|
|
101
192
|
/**
|
|
102
193
|
* @inheritdoc
|
|
103
194
|
*/
|
|
104
195
|
clone(): PBRMaterial;
|
|
196
|
+
private _onIridescenceRangeChanged;
|
|
197
|
+
private _onSheenColorChanged;
|
|
105
198
|
}
|