@galacean/engine-core 1.4.0-alpha.0 → 1.4.0-alpha.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 +1478 -479
- package/dist/main.js.map +1 -1
- package/dist/module.js +1476 -480
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +1 -3
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +3 -0
- package/types/Renderer.d.ts +0 -2
- package/types/Transform.d.ts +17 -7
- package/types/asset/AssetType.d.ts +3 -1
- 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/PBRMaterial.d.ts +30 -2
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/DynamicCollider.d.ts +25 -2
- package/types/physics/PhysicsMaterial.d.ts +1 -1
- 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 +25 -7
- 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 +2 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
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.1",
|
|
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.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@galacean/engine-design": "1.4.0-alpha.
|
|
24
|
+
"@galacean/engine-design": "1.4.0-alpha.1"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class Camera extends Component {
|
|
|
50
50
|
/**
|
|
51
51
|
* Multi-sample anti-aliasing samples when use independent canvas mode.
|
|
52
52
|
*
|
|
53
|
-
* @remarks
|
|
53
|
+
* @remarks It will take effect when `independentCanvasEnabled` property is `true`, otherwise it will be invalid.
|
|
54
54
|
*/
|
|
55
55
|
msaaSamples: MSAASamples;
|
|
56
56
|
private _priority;
|
|
@@ -68,7 +68,6 @@ export declare class Camera extends Component {
|
|
|
68
68
|
private _enableHDR;
|
|
69
69
|
private _enablePostProcess;
|
|
70
70
|
private _frustumChangeFlag;
|
|
71
|
-
private _transform;
|
|
72
71
|
private _isViewMatrixDirty;
|
|
73
72
|
private _isInvViewProjDirty;
|
|
74
73
|
private _viewport;
|
|
@@ -86,7 +85,6 @@ export declare class Camera extends Component {
|
|
|
86
85
|
set opaqueTextureEnabled(value: boolean);
|
|
87
86
|
/**
|
|
88
87
|
* Whether independent canvas is enabled.
|
|
89
|
-
*
|
|
90
88
|
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
91
89
|
*/
|
|
92
90
|
get independentCanvasEnabled(): boolean;
|
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,9 @@ 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;
|
|
16
19
|
/**
|
|
17
20
|
* Create a basic render pipeline.
|
|
18
21
|
* @param camera - Camera
|
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/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,10 @@ 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
63
|
Project = "project"
|
|
62
64
|
}
|
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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector2 } from "@galacean/engine-math";
|
|
1
|
+
import { Vector2, Color } from "@galacean/engine-math";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { Texture2D } from "../texture/Texture2D";
|
|
4
4
|
import { PBRBaseMaterial } from "./PBRBaseMaterial";
|
|
@@ -17,6 +17,11 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
17
17
|
private static _iridescenceThicknessTextureProp;
|
|
18
18
|
private static _iridescenceTextureProp;
|
|
19
19
|
private _iridescenceRange;
|
|
20
|
+
private _sheenEnabled;
|
|
21
|
+
private static _sheenColorProp;
|
|
22
|
+
private static _sheenRoughnessProp;
|
|
23
|
+
private static _sheenTextureProp;
|
|
24
|
+
private static _sheenRoughnessTextureProp;
|
|
20
25
|
/**
|
|
21
26
|
* Index Of Refraction.
|
|
22
27
|
* @defaultValue `1.5`
|
|
@@ -80,7 +85,7 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
80
85
|
set iridescenceIOR(value: number);
|
|
81
86
|
/**
|
|
82
87
|
* The range of iridescence thickness, x is minimum, y is maximum.
|
|
83
|
-
* @defaultValue `[100, 400]
|
|
88
|
+
* @defaultValue `[100, 400]`
|
|
84
89
|
*/
|
|
85
90
|
get iridescenceThicknessRange(): Vector2;
|
|
86
91
|
set iridescenceThicknessRange(value: Vector2);
|
|
@@ -92,6 +97,29 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
92
97
|
*/
|
|
93
98
|
get iridescenceThicknessTexture(): Texture2D;
|
|
94
99
|
set iridescenceThicknessTexture(value: Texture2D);
|
|
100
|
+
/**
|
|
101
|
+
* Sheen color.
|
|
102
|
+
* @defaultValue `[0,0,0]`
|
|
103
|
+
*/
|
|
104
|
+
get sheenColor(): Color;
|
|
105
|
+
set sheenColor(value: Color);
|
|
106
|
+
/**
|
|
107
|
+
* Sheen roughness, from 0.0 to 1.0.
|
|
108
|
+
* @defaultValue `0.0`
|
|
109
|
+
*/
|
|
110
|
+
get sheenRoughness(): number;
|
|
111
|
+
set sheenRoughness(value: number);
|
|
112
|
+
/**
|
|
113
|
+
* Sheen color texture, multiply ‘sheenColor’.
|
|
114
|
+
*/
|
|
115
|
+
get sheenColorTexture(): Texture2D;
|
|
116
|
+
set sheenColorTexture(value: Texture2D);
|
|
117
|
+
/**
|
|
118
|
+
* Sheen roughness texture.
|
|
119
|
+
* @remarks Use alpha channel, and multiply 'sheenRoughness'.
|
|
120
|
+
*/
|
|
121
|
+
get sheenRoughnessTexture(): Texture2D;
|
|
122
|
+
set sheenRoughnessTexture(value: Texture2D);
|
|
95
123
|
/**
|
|
96
124
|
* Create a pbr metallic-roughness workflow material instance.
|
|
97
125
|
* @param engine - Engine to which the material belongs
|
|
@@ -11,7 +11,8 @@ export declare class CharacterController extends Collider {
|
|
|
11
11
|
private _upDirection;
|
|
12
12
|
private _slopeLimit;
|
|
13
13
|
/**
|
|
14
|
-
* The step offset for the controller.
|
|
14
|
+
* The step offset for the controller, the value must be greater than or equal to 0.
|
|
15
|
+
* @remarks Character can overcome obstacle less than the height(stepOffset + contractOffset of the shape).
|
|
15
16
|
*/
|
|
16
17
|
get stepOffset(): number;
|
|
17
18
|
set stepOffset(value: number);
|
|
@@ -26,7 +27,8 @@ export declare class CharacterController extends Collider {
|
|
|
26
27
|
get upDirection(): Vector3;
|
|
27
28
|
set upDirection(value: Vector3);
|
|
28
29
|
/**
|
|
29
|
-
* The slope limit for the controller.
|
|
30
|
+
* The slope limit for the controller, the value is the cosine value of the maximum slope angle.
|
|
31
|
+
* @defaultValue 0.707(the cosine value of 45 degrees)
|
|
30
32
|
*/
|
|
31
33
|
get slopeLimit(): number;
|
|
32
34
|
set slopeLimit(value: number);
|
|
@@ -43,10 +45,7 @@ export declare class CharacterController extends Collider {
|
|
|
43
45
|
* @param shape - Collider shape
|
|
44
46
|
*/
|
|
45
47
|
addShape(shape: ColliderShape): void;
|
|
46
|
-
|
|
47
|
-
* Remove all shape attached.
|
|
48
|
-
*/
|
|
49
|
-
clearShapes(): void;
|
|
48
|
+
protected _syncNative(): void;
|
|
50
49
|
private _syncWorldPositionFromPhysicalSpace;
|
|
51
50
|
private _setUpDirection;
|
|
52
51
|
}
|
|
@@ -27,5 +27,7 @@ export declare class Collider extends Component implements ICustomClone {
|
|
|
27
27
|
* Remove all shape attached.
|
|
28
28
|
*/
|
|
29
29
|
clearShapes(): void;
|
|
30
|
-
protected
|
|
30
|
+
protected _syncNative(): void;
|
|
31
|
+
protected _addNativeShape(shape: ColliderShape): void;
|
|
32
|
+
protected _removeNativeShape(shape: ColliderShape): void;
|
|
31
33
|
}
|
|
@@ -18,6 +18,8 @@ export declare class DynamicCollider extends Collider {
|
|
|
18
18
|
private _constraints;
|
|
19
19
|
private _collisionDetectionMode;
|
|
20
20
|
private _sleepThreshold;
|
|
21
|
+
private _automaticCenterOfMass;
|
|
22
|
+
private _automaticInertiaTensor;
|
|
21
23
|
/**
|
|
22
24
|
* The linear damping of the dynamic collider.
|
|
23
25
|
*/
|
|
@@ -43,13 +45,27 @@ export declare class DynamicCollider extends Collider {
|
|
|
43
45
|
*/
|
|
44
46
|
get mass(): number;
|
|
45
47
|
set mass(value: number);
|
|
48
|
+
/**
|
|
49
|
+
* Whether or not to calculate the center of mass automatically, if true, the center of mass will be calculated based on the associated shapes.
|
|
50
|
+
* @remarks Affected by the position, rotation of the shapes.
|
|
51
|
+
*/
|
|
52
|
+
get automaticCenterOfMass(): boolean;
|
|
53
|
+
set automaticCenterOfMass(value: boolean);
|
|
46
54
|
/**
|
|
47
55
|
* The center of mass relative to the transform's origin.
|
|
56
|
+
* @remarks The center of mass is automatically calculated, if you want to set it manually, please set automaticCenterOfMass to false.
|
|
48
57
|
*/
|
|
49
58
|
get centerOfMass(): Vector3;
|
|
50
59
|
set centerOfMass(value: Vector3);
|
|
60
|
+
/**
|
|
61
|
+
* Whether or not to calculate the inertia tensor automatically, if true, the inertia tensor will be calculated based on the associated shapes and mass.
|
|
62
|
+
* @remarks Affected by the position, rotation of the shapes and the mass of the collider.
|
|
63
|
+
*/
|
|
64
|
+
get automaticInertiaTensor(): boolean;
|
|
65
|
+
set automaticInertiaTensor(value: boolean);
|
|
51
66
|
/**
|
|
52
67
|
* The diagonal inertia tensor of mass relative to the center of mass.
|
|
68
|
+
* @remarks The inertia tensor is automatically calculated, if you want to set it manually, please set automaticInertiaTensor to false.
|
|
53
69
|
*/
|
|
54
70
|
get inertiaTensor(): Vector3;
|
|
55
71
|
set inertiaTensor(value: Vector3);
|
|
@@ -118,14 +134,21 @@ export declare class DynamicCollider extends Collider {
|
|
|
118
134
|
* Forces a collider to sleep at least one frame.
|
|
119
135
|
*/
|
|
120
136
|
sleep(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Returns whether the collider is sleeping.
|
|
139
|
+
* @returns True if the collider is sleeping, false otherwise.
|
|
140
|
+
*/
|
|
141
|
+
isSleeping(): boolean;
|
|
121
142
|
/**
|
|
122
143
|
* Forces a collider to wake up.
|
|
123
144
|
*/
|
|
124
145
|
wakeUp(): void;
|
|
146
|
+
protected _syncNative(): void;
|
|
147
|
+
private _setMassAndUpdateInertia;
|
|
125
148
|
private _setLinearVelocity;
|
|
126
149
|
private _setAngularVelocity;
|
|
127
|
-
private
|
|
128
|
-
private
|
|
150
|
+
private _handleCenterOfMassChanged;
|
|
151
|
+
private _handleInertiaTensorChanged;
|
|
129
152
|
}
|
|
130
153
|
/**
|
|
131
154
|
* The collision detection mode constants.
|
|
@@ -2,6 +2,7 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Joint } from "./Joint";
|
|
3
3
|
import { JointLimits } from "./JointLimits";
|
|
4
4
|
import { JointMotor } from "./JointMotor";
|
|
5
|
+
import { Entity } from "../../Entity";
|
|
5
6
|
/**
|
|
6
7
|
* A joint which behaves in a similar way to a hinge or axle.
|
|
7
8
|
*/
|
|
@@ -9,18 +10,15 @@ export declare class HingeJoint extends Joint {
|
|
|
9
10
|
private _axis;
|
|
10
11
|
private _hingeFlags;
|
|
11
12
|
private _useSpring;
|
|
12
|
-
private
|
|
13
|
+
private _jointMotor;
|
|
13
14
|
private _limits;
|
|
15
|
+
private _angle;
|
|
16
|
+
private _velocity;
|
|
14
17
|
/**
|
|
15
18
|
* The anchor rotation.
|
|
16
19
|
*/
|
|
17
20
|
get axis(): Vector3;
|
|
18
21
|
set axis(value: Vector3);
|
|
19
|
-
/**
|
|
20
|
-
* The swing offset.
|
|
21
|
-
*/
|
|
22
|
-
get swingOffset(): Vector3;
|
|
23
|
-
set swingOffset(value: Vector3);
|
|
24
22
|
/**
|
|
25
23
|
* The current angle in degrees of the joint relative to its rest position.
|
|
26
24
|
*/
|
|
@@ -54,4 +52,9 @@ export declare class HingeJoint extends Joint {
|
|
|
54
52
|
*/
|
|
55
53
|
get limits(): JointLimits;
|
|
56
54
|
set limits(value: JointLimits);
|
|
55
|
+
constructor(entity: Entity);
|
|
56
|
+
protected _createJoint(): void;
|
|
57
|
+
protected _syncNative(): void;
|
|
58
|
+
private _onMotorChanged;
|
|
59
|
+
private _onLimitsChanged;
|
|
57
60
|
}
|
|
@@ -3,43 +3,55 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
3
3
|
import { Component } from "../../Component";
|
|
4
4
|
import { Entity } from "../../Entity";
|
|
5
5
|
import { Collider } from "../Collider";
|
|
6
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
7
6
|
/**
|
|
8
7
|
* A base class providing common functionality for joints.
|
|
9
8
|
* @decorator `@dependentComponents(Collider, DependentMode.CheckOnly)`
|
|
10
9
|
*/
|
|
11
|
-
export declare class Joint extends Component
|
|
10
|
+
export declare abstract class Joint extends Component {
|
|
11
|
+
private static _tempVector3;
|
|
12
12
|
protected _colliderInfo: JointColliderInfo;
|
|
13
13
|
protected _connectedColliderInfo: JointColliderInfo;
|
|
14
14
|
protected _nativeJoint: IJoint;
|
|
15
15
|
private _force;
|
|
16
16
|
private _torque;
|
|
17
|
+
private _automaticConnectedAnchor;
|
|
17
18
|
/**
|
|
18
19
|
* The connected collider.
|
|
19
20
|
*/
|
|
20
21
|
get connectedCollider(): Collider;
|
|
21
22
|
set connectedCollider(value: Collider);
|
|
23
|
+
/**
|
|
24
|
+
* The connected anchor position.
|
|
25
|
+
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
26
|
+
*/
|
|
27
|
+
get anchor(): Vector3;
|
|
28
|
+
set anchor(value: Vector3);
|
|
22
29
|
/**
|
|
23
30
|
* The connected anchor position.
|
|
24
31
|
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
25
32
|
*/
|
|
26
33
|
get connectedAnchor(): Vector3;
|
|
27
34
|
set connectedAnchor(value: Vector3);
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not to calculate the connectedAnchor automatically, if true, the connectedAnchor will be calculated automatically to match the global position of the anchor property.
|
|
37
|
+
*/
|
|
38
|
+
get automaticConnectedAnchor(): boolean;
|
|
39
|
+
set automaticConnectedAnchor(value: boolean);
|
|
28
40
|
/**
|
|
29
41
|
* The scale to apply to the inverse mass of collider 0 for resolving this constraint.
|
|
30
42
|
*/
|
|
31
43
|
get connectedMassScale(): number;
|
|
32
44
|
set connectedMassScale(value: number);
|
|
33
|
-
/**
|
|
34
|
-
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
35
|
-
*/
|
|
36
|
-
get connectedInertiaScale(): number;
|
|
37
|
-
set connectedInertiaScale(value: number);
|
|
38
45
|
/**
|
|
39
46
|
* The scale to apply to the inverse mass of collider 1 for resolving this constraint.
|
|
40
47
|
*/
|
|
41
48
|
get massScale(): number;
|
|
42
49
|
set massScale(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
52
|
+
*/
|
|
53
|
+
get connectedInertiaScale(): number;
|
|
54
|
+
set connectedInertiaScale(value: number);
|
|
43
55
|
/**
|
|
44
56
|
* The scale to apply to the inverse inertia of collider1 for resolving this constraint.
|
|
45
57
|
*/
|
|
@@ -56,4 +68,10 @@ export declare class Joint extends Component implements ICustomClone {
|
|
|
56
68
|
get breakTorque(): number;
|
|
57
69
|
set breakTorque(value: number);
|
|
58
70
|
constructor(entity: Entity);
|
|
71
|
+
protected abstract _createJoint(): void;
|
|
72
|
+
protected _syncNative(): void;
|
|
73
|
+
private _calculateConnectedAnchor;
|
|
74
|
+
private _onSelfTransformChanged;
|
|
75
|
+
private _onConnectedTransformChanged;
|
|
76
|
+
private _updateActualAnchor;
|
|
59
77
|
}
|