@galacean/engine-core 1.1.0-beta.2 → 1.1.0-beta.20
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 +7718 -7223
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +7718 -7223
- package/dist/module.js +7708 -7225
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/types.d.ts +3 -0
- package/types/2d/enums/SpriteModifyFlags.d.ts +2 -1
- package/types/Background.d.ts +8 -0
- package/types/Component.d.ts +1 -1
- package/types/DisorderedArray.d.ts +1 -1
- package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
- package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
- package/types/Scene.d.ts +6 -0
- package/types/asset/AssetPromise.d.ts +1 -0
- package/types/asset/ResourceManager.d.ts +0 -1
- package/types/lighting/DirectLight.d.ts +8 -1
- package/types/lighting/Light.d.ts +0 -4
- package/types/lighting/LightManager.d.ts +7 -0
- package/types/lighting/PointLight.d.ts +9 -1
- package/types/lighting/SpotLight.d.ts +12 -1
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
- package/types/mesh/SubModelMesh.d.ts +260 -0
- package/types/particle/ParticleGenerator.d.ts +0 -2
- package/types/particle/index.d.ts +10 -0
- package/types/particle/modules/EmissionModule.d.ts +0 -1
- package/types/particle/modules/MainModule.d.ts +7 -6
- package/types/particle/modules/ParticleGeneratorModule.d.ts +0 -1
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +1 -1
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +0 -4
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/PhysicsMaterial.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +1 -1
- package/types/physics/joint/Joint.d.ts +4 -3
- package/types/physics/shape/ColliderShape.d.ts +2 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -0
- package/types/shader/Shader.d.ts +1 -1
- package/types/xr/IXRDevice.d.ts +26 -0
- package/types/xr/XRManager.d.ts +89 -24
- package/types/xr/XRModule.d.ts +126 -0
- package/types/xr/component/XRPoseDriver.d.ts +5 -5
- package/types/xr/component/XRTrackingMode.d.ts +15 -0
- package/types/xr/component/trackable/XRAnchor.d.ts +4 -0
- package/types/xr/component/trackable/XRImage.d.ts +6 -0
- package/types/xr/component/trackable/XRPlane.d.ts +7 -0
- package/types/xr/component/trackable/XRTracked.d.ts +13 -0
- package/types/xr/feature/XRFeatureManager.d.ts +65 -0
- package/types/xr/feature/XRFeatureType.d.ts +17 -0
- package/types/xr/feature/XRPlatformFeature.d.ts +17 -0
- package/types/xr/feature/camera/IXRCameraDescriptor.d.ts +7 -0
- package/types/xr/feature/camera/XRCameraManager.d.ts +35 -0
- package/types/xr/feature/camera/XRPlatformCamera.d.ts +5 -0
- package/types/xr/feature/hitTest/XRHItTestType.d.ts +16 -0
- package/types/xr/feature/hitTest/XRHitTestManager.d.ts +38 -0
- package/types/xr/feature/movementTracking/IXRMovementTrackingDescriptor.d.ts +9 -0
- package/types/xr/feature/movementTracking/XRMovementTrackingManager.d.ts +8 -0
- package/types/xr/feature/movementTracking/XRMovementTrackingMode.d.ts +5 -0
- package/types/xr/feature/movementTracking/XRPlatformMovementTracking.d.ts +10 -0
- package/types/xr/feature/trackable/XRRequestTrackingState.d.ts +11 -0
- package/types/xr/feature/trackable/XRTrackableManager.d.ts +41 -0
- package/types/xr/feature/trackable/XRTrackablePlatformFeature.d.ts +29 -0
- package/types/xr/feature/trackable/XRTracked.d.ts +9 -0
- package/types/xr/feature/trackable/XRTrackedUpdateFlag.d.ts +11 -0
- package/types/xr/feature/trackable/XRTrackingState.d.ts +11 -0
- package/types/xr/feature/trackable/anchor/IXRAnchorTrackingDescriptor.d.ts +8 -0
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingManager.d.ts +22 -0
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingMode.d.ts +4 -0
- package/types/xr/feature/trackable/anchor/XRPlatformAnchorTracking.d.ts +12 -0
- package/types/xr/feature/trackable/anchor/XRRequestTrackingAnchor.d.ts +10 -0
- package/types/xr/feature/trackable/image/IXRImageTrackingDescriptor.d.ts +5 -0
- package/types/xr/feature/trackable/image/XRImageTrackingManager.d.ts +33 -0
- package/types/xr/feature/trackable/image/XRPlatformImageTracking.d.ts +14 -0
- package/types/xr/feature/trackable/image/XRReferenceImage.d.ts +14 -0
- package/types/xr/feature/trackable/image/XRRequestTrackingImage.d.ts +11 -0
- package/types/xr/feature/trackable/image/XRTrackedImage.d.ts +5 -0
- package/types/xr/feature/trackable/plane/IXRPlaneTrackingDescriptor.d.ts +9 -0
- package/types/xr/feature/trackable/plane/XRPlaneDetectionMode.d.ts +13 -0
- package/types/xr/feature/trackable/plane/XRPlaneMode.d.ts +13 -0
- package/types/xr/feature/trackable/plane/XRPlaneTrackingManager.d.ts +14 -0
- package/types/xr/feature/trackable/plane/XRPlatformPlaneTracking.d.ts +11 -0
- package/types/xr/feature/trackable/plane/XRRequestTrackingPlane.d.ts +11 -0
- package/types/xr/feature/trackable/plane/XRTrackedPlane.d.ts +11 -0
- package/types/xr/index.d.ts +39 -18
- package/types/xr/input/XRCamera.d.ts +28 -0
- package/types/xr/input/XRController.d.ts +38 -0
- package/types/xr/input/XRControllerPoseMode.d.ts +9 -0
- package/types/xr/input/XRInput.d.ts +14 -0
- package/types/xr/input/XRInputButton.d.ts +19 -0
- package/types/xr/input/XRInputEvent.d.ts +24 -0
- package/types/xr/input/XRInputEventType.d.ts +11 -0
- package/types/xr/input/XRInputManager.d.ts +58 -0
- package/types/xr/input/XRInputType.d.ts +23 -0
- package/types/xr/input/XRTargetRayMode.d.ts +12 -0
- package/types/xr/input/XRTrackedUpdateFlag.d.ts +11 -0
- package/types/xr/input/XRTrackingState.d.ts +11 -0
- package/types/xr/session/XRSessionManager.d.ts +76 -0
- package/types/xr/session/XRSessionState.d.ts +13 -0
- package/types/xr/session/XRSessionType.d.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-math": "1.1.0-beta.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-beta.20"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-beta.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-beta.20"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetType } from "../../asset/AssetType";
|
|
1
2
|
import { TextureFilterMode, TextureFormat, TextureWrapMode } from "../../texture";
|
|
2
3
|
/**
|
|
3
4
|
* The original data type of the atlas.
|
|
@@ -16,6 +17,8 @@ export interface AtlasConfig {
|
|
|
16
17
|
atlasItems: {
|
|
17
18
|
/** The url of the sub atlas. */
|
|
18
19
|
img: string;
|
|
20
|
+
/** Image type. */
|
|
21
|
+
type: AssetType;
|
|
19
22
|
/** Sprites contained in the sub atlas. */
|
|
20
23
|
sprites: AtlasSprite[];
|
|
21
24
|
}[];
|
package/types/Background.d.ts
CHANGED
|
@@ -33,11 +33,19 @@ export declare class Background {
|
|
|
33
33
|
*/
|
|
34
34
|
get texture(): Texture2D;
|
|
35
35
|
set texture(value: Texture2D);
|
|
36
|
+
/**
|
|
37
|
+
* Background texture fill mode.
|
|
38
|
+
* @remarks When `mode` is `BackgroundMode.Texture`, the property will take effects.
|
|
39
|
+
* @defaultValue `BackgroundTextureFillMode.FitHeight`
|
|
40
|
+
*/
|
|
41
|
+
get textureFillMode(): BackgroundTextureFillMode;
|
|
36
42
|
set textureFillMode(value: BackgroundTextureFillMode);
|
|
37
43
|
/**
|
|
38
44
|
* Constructor of Background.
|
|
39
45
|
* @param _engine Engine Which the background belongs to.
|
|
40
46
|
*/
|
|
41
47
|
constructor(_engine: Engine);
|
|
48
|
+
private _initMesh;
|
|
49
|
+
private _initMaterial;
|
|
42
50
|
private _createPlane;
|
|
43
51
|
}
|
package/types/Component.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { Scene } from "./Scene";
|
|
|
5
5
|
* The base class of the components.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Component extends EngineObject {
|
|
8
|
+
protected _phasedActiveInScene: boolean;
|
|
8
9
|
private _phasedActive;
|
|
9
|
-
private _phasedActiveInScene;
|
|
10
10
|
private _enabled;
|
|
11
11
|
/**
|
|
12
12
|
* Indicates whether the component is enabled.
|
|
@@ -17,7 +17,7 @@ export declare class DisorderedArray<T> {
|
|
|
17
17
|
* @returns The replaced item is used to reset its index
|
|
18
18
|
*/
|
|
19
19
|
deleteByIndex(index: number): T;
|
|
20
|
-
forEach(callbackFn: (
|
|
20
|
+
forEach(callbackFn: (element: T) => void, swapFn: (element: T, index: number) => void): void;
|
|
21
21
|
forEachAndClean(callbackFn: (e: T) => void): void;
|
|
22
22
|
garbageCollection(): void;
|
|
23
23
|
private _startLoop;
|
|
@@ -4,14 +4,16 @@ import { Material } from "../material/Material";
|
|
|
4
4
|
import { Renderer } from "../Renderer";
|
|
5
5
|
import { ShaderPass } from "../shader/ShaderPass";
|
|
6
6
|
import { RenderState } from "../shader/state/RenderState";
|
|
7
|
+
import { IPoolElement } from "./IPoolElement";
|
|
7
8
|
import { RenderElement } from "./RenderElement";
|
|
8
9
|
/**
|
|
9
10
|
* Render element.
|
|
10
11
|
*/
|
|
11
|
-
export declare class MeshRenderElement extends RenderElement {
|
|
12
|
+
export declare class MeshRenderElement extends RenderElement implements IPoolElement {
|
|
12
13
|
/** Mesh. */
|
|
13
14
|
mesh: Mesh;
|
|
14
15
|
/** Sub mesh. */
|
|
15
16
|
subMesh: SubMesh;
|
|
16
17
|
setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
18
|
+
dispose(): void;
|
|
17
19
|
}
|
|
@@ -4,10 +4,12 @@ import { Renderer } from "../Renderer";
|
|
|
4
4
|
import { ShaderPass } from "../shader";
|
|
5
5
|
import { RenderState } from "../shader/state/RenderState";
|
|
6
6
|
import { Texture2D } from "../texture";
|
|
7
|
+
import { IPoolElement } from "./IPoolElement";
|
|
7
8
|
import { RenderElement } from "./RenderElement";
|
|
8
|
-
export declare class SpriteElement extends RenderElement {
|
|
9
|
+
export declare class SpriteElement extends RenderElement implements IPoolElement {
|
|
9
10
|
renderData: RenderData2D;
|
|
10
11
|
texture: Texture2D;
|
|
11
12
|
constructor();
|
|
12
13
|
setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
14
|
+
dispose(): void;
|
|
13
15
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
2
|
import { Material } from "../material/Material";
|
|
3
3
|
import { Renderer } from "../Renderer";
|
|
4
|
+
import { IPoolElement } from "./IPoolElement";
|
|
4
5
|
import { RenderElement } from "./RenderElement";
|
|
5
|
-
export declare class SpriteMaskElement extends RenderElement {
|
|
6
|
+
export declare class SpriteMaskElement extends RenderElement implements IPoolElement {
|
|
6
7
|
renderData: RenderData2D;
|
|
7
8
|
isAdd: boolean;
|
|
8
9
|
constructor();
|
|
9
10
|
setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
|
|
11
|
+
dispose(): void;
|
|
10
12
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IPoolElement } from "./IPoolElement";
|
|
1
2
|
import { RenderElement } from "./RenderElement";
|
|
2
3
|
import { SpriteElement } from "./SpriteElement";
|
|
3
|
-
export declare class TextRenderElement extends RenderElement {
|
|
4
|
+
export declare class TextRenderElement extends RenderElement implements IPoolElement {
|
|
4
5
|
charElements: SpriteElement[];
|
|
5
6
|
constructor();
|
|
7
|
+
dispose(): void;
|
|
6
8
|
}
|
package/types/Scene.d.ts
CHANGED
|
@@ -41,6 +41,12 @@ export declare class Scene extends EngineObject {
|
|
|
41
41
|
private _fogEnd;
|
|
42
42
|
private _fogDensity;
|
|
43
43
|
private _fogParams;
|
|
44
|
+
private _isActive;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the scene is active.
|
|
47
|
+
*/
|
|
48
|
+
get isActive(): boolean;
|
|
49
|
+
set isActive(value: boolean);
|
|
44
50
|
/**
|
|
45
51
|
* Scene-related shader data.
|
|
46
52
|
*/
|
|
@@ -7,7 +7,6 @@ export declare class DirectLight extends Light {
|
|
|
7
7
|
private static _cullingMaskProperty;
|
|
8
8
|
private static _colorProperty;
|
|
9
9
|
private static _directionProperty;
|
|
10
|
-
private static _combinedData;
|
|
11
10
|
private _reverseDirection;
|
|
12
11
|
/**
|
|
13
12
|
* Get direction.
|
|
@@ -18,3 +17,11 @@ export declare class DirectLight extends Light {
|
|
|
18
17
|
*/
|
|
19
18
|
get reverseDirection(): Vector3;
|
|
20
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Shader properties data of direct lights in the scene.
|
|
22
|
+
*/
|
|
23
|
+
export interface IDirectLightShaderData {
|
|
24
|
+
cullingMask: Int32Array;
|
|
25
|
+
color: Float32Array;
|
|
26
|
+
direction: Float32Array;
|
|
27
|
+
}
|
|
@@ -6,10 +6,6 @@ import { ShadowType } from "../shadow";
|
|
|
6
6
|
* Light base class.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class Light extends Component {
|
|
9
|
-
/**
|
|
10
|
-
* Each type of light source is at most 10, beyond which it will not take effect.
|
|
11
|
-
* */
|
|
12
|
-
protected static _maxLight: number;
|
|
13
9
|
/** Light Intensity */
|
|
14
10
|
intensity: number;
|
|
15
11
|
/**
|
|
@@ -2,5 +2,12 @@
|
|
|
2
2
|
* Light manager.
|
|
3
3
|
*/
|
|
4
4
|
export declare class LightManager {
|
|
5
|
+
/**
|
|
6
|
+
* Each type of light source is at most 10, beyond which it will not take effect.
|
|
7
|
+
* */
|
|
8
|
+
private static _maxLight;
|
|
9
|
+
private _directData;
|
|
10
|
+
private _pointData;
|
|
11
|
+
private _spotData;
|
|
5
12
|
private _getSunLightIndex;
|
|
6
13
|
}
|
|
@@ -8,7 +8,6 @@ export declare class PointLight extends Light {
|
|
|
8
8
|
private static _colorProperty;
|
|
9
9
|
private static _positionProperty;
|
|
10
10
|
private static _distanceProperty;
|
|
11
|
-
private static _combinedData;
|
|
12
11
|
/** Defines a distance cutoff at which the light's intensity must be considered zero. */
|
|
13
12
|
distance: number;
|
|
14
13
|
/**
|
|
@@ -16,3 +15,12 @@ export declare class PointLight extends Light {
|
|
|
16
15
|
*/
|
|
17
16
|
get position(): Vector3;
|
|
18
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Shader properties data of point lights in the scene.
|
|
20
|
+
*/
|
|
21
|
+
export interface IPointLightShaderData {
|
|
22
|
+
cullingMask: Int32Array;
|
|
23
|
+
color: Float32Array;
|
|
24
|
+
position: Float32Array;
|
|
25
|
+
distance: Float32Array;
|
|
26
|
+
}
|
|
@@ -11,7 +11,6 @@ export declare class SpotLight extends Light {
|
|
|
11
11
|
private static _distanceProperty;
|
|
12
12
|
private static _angleCosProperty;
|
|
13
13
|
private static _penumbraCosProperty;
|
|
14
|
-
private static _combinedData;
|
|
15
14
|
/** Defines a distance cutoff at which the light's intensity must be considered zero. */
|
|
16
15
|
distance: number;
|
|
17
16
|
/** Angle, in radians, from centre of spotlight where falloff begins. */
|
|
@@ -33,3 +32,15 @@ export declare class SpotLight extends Light {
|
|
|
33
32
|
*/
|
|
34
33
|
get reverseDirection(): Vector3;
|
|
35
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Shader properties data of spot lights in the scene.
|
|
37
|
+
*/
|
|
38
|
+
export interface ISpotLightShaderData {
|
|
39
|
+
cullingMask: Int32Array;
|
|
40
|
+
color: Float32Array;
|
|
41
|
+
position: Float32Array;
|
|
42
|
+
direction: Float32Array;
|
|
43
|
+
distance: Float32Array;
|
|
44
|
+
angleCos: Float32Array;
|
|
45
|
+
penumbraCos: Float32Array;
|
|
46
|
+
}
|
|
@@ -9,11 +9,11 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
9
9
|
private static _jointCountProperty;
|
|
10
10
|
private static _jointSamplerProperty;
|
|
11
11
|
private static _jointMatrixProperty;
|
|
12
|
+
private _localBounds;
|
|
12
13
|
private _jointDataCreateCache;
|
|
13
14
|
private _blendShapeWeights;
|
|
14
15
|
private _maxVertexUniformVectors;
|
|
15
16
|
private _rootBone;
|
|
16
|
-
private _localBounds;
|
|
17
17
|
private _jointMatrices;
|
|
18
18
|
private _jointTexture;
|
|
19
19
|
private _bones;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { Buffer } from "../graphic/Buffer";
|
|
4
|
+
import { Mesh } from "../graphic/Mesh";
|
|
5
|
+
import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
|
|
6
|
+
import { VertexElement } from "../graphic/VertexElement";
|
|
7
|
+
import { BlendShape } from "./BlendShape";
|
|
8
|
+
import { VertexAttribute } from "./enums/VertexAttribute";
|
|
9
|
+
import { MeshTopology } from "../graphic/enums/MeshTopology";
|
|
10
|
+
/**
|
|
11
|
+
* Sub-model mesh.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SubModelMesh extends Mesh {
|
|
14
|
+
private static _tempVec0;
|
|
15
|
+
private static _tempVec1;
|
|
16
|
+
private static _tempVec2;
|
|
17
|
+
private static _tempVec3;
|
|
18
|
+
private static _tempVec4;
|
|
19
|
+
private _vertexCount;
|
|
20
|
+
private _vertexCountDirty;
|
|
21
|
+
private _dataVersionCounter;
|
|
22
|
+
private _positions;
|
|
23
|
+
private _normals;
|
|
24
|
+
private _colors;
|
|
25
|
+
private _tangents;
|
|
26
|
+
private _uv;
|
|
27
|
+
private _uv1;
|
|
28
|
+
private _uv2;
|
|
29
|
+
private _uv3;
|
|
30
|
+
private _uv4;
|
|
31
|
+
private _uv5;
|
|
32
|
+
private _uv6;
|
|
33
|
+
private _uv7;
|
|
34
|
+
private _boneWeights;
|
|
35
|
+
private _boneIndices;
|
|
36
|
+
private _advancedElementUpdateFlag;
|
|
37
|
+
private _advancedDataUpdateFlag;
|
|
38
|
+
private _advancedVertexDataVersions;
|
|
39
|
+
private _advancedDataSyncToBuffer;
|
|
40
|
+
private _internalVertexBufferStride;
|
|
41
|
+
private _internalVertexBufferCreatedInfo;
|
|
42
|
+
private _internalVertexElementsOffset;
|
|
43
|
+
private _internalVertexElementsFlags;
|
|
44
|
+
private _vertexBufferInfos;
|
|
45
|
+
private _indices;
|
|
46
|
+
private _indicesFormat;
|
|
47
|
+
private _indicesChangeFlag;
|
|
48
|
+
/** Start drawing offset. */
|
|
49
|
+
start: number;
|
|
50
|
+
/** Drawing count. */
|
|
51
|
+
count: number;
|
|
52
|
+
/** Drawing topology. */
|
|
53
|
+
topology: MeshTopology;
|
|
54
|
+
/**
|
|
55
|
+
* Vertex count of mesh.
|
|
56
|
+
*/
|
|
57
|
+
get vertexCount(): number;
|
|
58
|
+
/**
|
|
59
|
+
* Vertex element collection.
|
|
60
|
+
*/
|
|
61
|
+
get vertexElements(): Readonly<VertexElement[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Vertex buffer binding collection.
|
|
64
|
+
*/
|
|
65
|
+
get vertexBufferBindings(): ReadonlyArray<VertexBufferBinding>;
|
|
66
|
+
/**
|
|
67
|
+
* BlendShapes of this ModelMesh.
|
|
68
|
+
*/
|
|
69
|
+
get blendShapes(): Readonly<BlendShape[]>;
|
|
70
|
+
/**
|
|
71
|
+
* BlendShape count of this ModelMesh.
|
|
72
|
+
*/
|
|
73
|
+
get blendShapeCount(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Create a model mesh.
|
|
76
|
+
* @param engine - Engine to which the mesh belongs
|
|
77
|
+
*/
|
|
78
|
+
constructor(engine: Engine);
|
|
79
|
+
/**
|
|
80
|
+
* Set positions for the mesh.
|
|
81
|
+
* @param positions - The positions for the mesh
|
|
82
|
+
*/
|
|
83
|
+
setPositions(positions: Vector3[] | null): void;
|
|
84
|
+
/**
|
|
85
|
+
* Get positions for the mesh.
|
|
86
|
+
* @remarks Please call the setPositions() method after modification to ensure that the modification takes effect.
|
|
87
|
+
*/
|
|
88
|
+
getPositions(): Vector3[] | null;
|
|
89
|
+
/**
|
|
90
|
+
* Set per-vertex normals for the mesh.
|
|
91
|
+
* @param normals - The normals for the mesh
|
|
92
|
+
*/
|
|
93
|
+
setNormals(normals: Vector3[] | null): void;
|
|
94
|
+
/**
|
|
95
|
+
* Get normals for the mesh.
|
|
96
|
+
* @remarks Please call the setNormals() method after modification to ensure that the modification takes effect.
|
|
97
|
+
*/
|
|
98
|
+
getNormals(): Vector3[] | null;
|
|
99
|
+
/**
|
|
100
|
+
* Set per-vertex colors for the mesh.
|
|
101
|
+
* @param colors - The colors for the mesh
|
|
102
|
+
*/
|
|
103
|
+
setColors(colors: Color[] | null): void;
|
|
104
|
+
/**
|
|
105
|
+
* Get colors for the mesh.
|
|
106
|
+
* @remarks Please call the setColors() method after modification to ensure that the modification takes effect.
|
|
107
|
+
*/
|
|
108
|
+
getColors(): Color[] | null;
|
|
109
|
+
/**
|
|
110
|
+
* Set per-vertex bone weights for the mesh.
|
|
111
|
+
* @param boneWeights - The bone weights for the mesh
|
|
112
|
+
*/
|
|
113
|
+
setBoneWeights(boneWeights: Vector4[] | null): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get bone weights for the mesh.
|
|
116
|
+
* @remarks Please call the setWeights() method after modification to ensure that the modification takes effect.
|
|
117
|
+
*/
|
|
118
|
+
getBoneWeights(): Vector4[] | null;
|
|
119
|
+
/**
|
|
120
|
+
* Set per-vertex bone indices for the mesh.
|
|
121
|
+
* @param boneIndices - The bone indices for the mesh
|
|
122
|
+
*/
|
|
123
|
+
setBoneIndices(boneIndices: Vector4[] | null): void;
|
|
124
|
+
/**
|
|
125
|
+
* Get bone indices for the mesh.
|
|
126
|
+
* @remarks Please call the setBoneIndices() method after modification to ensure that the modification takes effect.
|
|
127
|
+
*/
|
|
128
|
+
getBoneIndices(): Vector4[] | null;
|
|
129
|
+
/**
|
|
130
|
+
* Set per-vertex tangents for the mesh.
|
|
131
|
+
* @param tangents - The tangents for the mesh
|
|
132
|
+
*/
|
|
133
|
+
setTangents(tangents: Vector4[] | null): void;
|
|
134
|
+
/**
|
|
135
|
+
* Get tangents for the mesh.
|
|
136
|
+
* @remarks Please call the setTangents() method after modification to ensure that the modification takes effect.
|
|
137
|
+
*/
|
|
138
|
+
getTangents(): Vector4[] | null;
|
|
139
|
+
/**
|
|
140
|
+
* Set per-vertex uv for the mesh.
|
|
141
|
+
* @param uv - The uv for the mesh
|
|
142
|
+
*/
|
|
143
|
+
setUVs(uv: Vector2[] | null): void;
|
|
144
|
+
/**
|
|
145
|
+
* Set per-vertex uv for the mesh by channelIndex.
|
|
146
|
+
* @param uv - The uv for the mesh
|
|
147
|
+
* @param channelIndex - The index of uv channels, in [0 ~ 7] range
|
|
148
|
+
*/
|
|
149
|
+
setUVs(uv: Vector2[] | null, channelIndex: number): void;
|
|
150
|
+
/**
|
|
151
|
+
* Get uv for the mesh.
|
|
152
|
+
* @remarks Please call the setUV() method after modification to ensure that the modification takes effect.
|
|
153
|
+
*/
|
|
154
|
+
getUVs(): Vector2[] | null;
|
|
155
|
+
/**
|
|
156
|
+
* Get uv for the mesh by channelIndex.
|
|
157
|
+
* @param channelIndex - The index of uv channels, in [0 ~ 7] range.
|
|
158
|
+
* @remarks Please call the setUV() method after modification to ensure that the modification takes effect.
|
|
159
|
+
*/
|
|
160
|
+
getUVs(channelIndex: number): Vector2[] | null;
|
|
161
|
+
/**
|
|
162
|
+
* Set indices for the mesh.
|
|
163
|
+
* @param indices - The indices for the mesh
|
|
164
|
+
*/
|
|
165
|
+
setIndices(indices: Uint8Array | Uint16Array | Uint32Array): void;
|
|
166
|
+
/**
|
|
167
|
+
* Get indices for the mesh.
|
|
168
|
+
*/
|
|
169
|
+
getIndices(): Uint8Array | Uint16Array | Uint32Array;
|
|
170
|
+
/**
|
|
171
|
+
* Set vertex elements.
|
|
172
|
+
* @param elements - Vertex element collection
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* Call this method will clear the vertex data set by the setPositions(), setNormals(), setColors(), setBoneWeights(), setBoneIndices(), setTangents(), setUVs() methods.
|
|
176
|
+
*/
|
|
177
|
+
setVertexElements(elements: VertexElement[]): void;
|
|
178
|
+
/**
|
|
179
|
+
* Set vertex buffer binding.
|
|
180
|
+
* @param vertexBufferBinding - Vertex buffer binding
|
|
181
|
+
* @param index - Vertex buffer index, the default value is 0
|
|
182
|
+
*/
|
|
183
|
+
setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
|
|
184
|
+
/**
|
|
185
|
+
* Set vertex buffer binding.
|
|
186
|
+
* @param vertexBuffer - Vertex buffer
|
|
187
|
+
* @param stride - Vertex buffer data stride
|
|
188
|
+
* @param index - Vertex buffer index, the default value is 0
|
|
189
|
+
*/
|
|
190
|
+
setVertexBufferBinding(vertexBuffer: Buffer, stride: number, index?: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Set vertex buffer binding.
|
|
193
|
+
* @param vertexBufferBindings - Vertex buffer binding
|
|
194
|
+
* @param firstIndex - First vertex buffer index, the default value is 0
|
|
195
|
+
*/
|
|
196
|
+
setVertexBufferBindings(vertexBufferBindings: VertexBufferBinding[], firstIndex?: number): void;
|
|
197
|
+
/**
|
|
198
|
+
* Get `VertexElement` by attribute.
|
|
199
|
+
* @param attribute - Vertex attribute
|
|
200
|
+
* @returns Vertex element
|
|
201
|
+
*/
|
|
202
|
+
getVertexElement(attribute: VertexAttribute): VertexElement | null;
|
|
203
|
+
/**
|
|
204
|
+
* Add a BlendShape for this ModelMesh.
|
|
205
|
+
* @param blendShape - The BlendShape
|
|
206
|
+
*/
|
|
207
|
+
addBlendShape(blendShape: BlendShape): void;
|
|
208
|
+
/**
|
|
209
|
+
* Clear all BlendShapes.
|
|
210
|
+
*/
|
|
211
|
+
clearBlendShapes(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Get name of BlendShape by given index.
|
|
214
|
+
* @param index - The index of BlendShape
|
|
215
|
+
* @returns The name of BlendShape
|
|
216
|
+
*/
|
|
217
|
+
getBlendShapeName(index: number): string;
|
|
218
|
+
/**
|
|
219
|
+
* Upload data to GPU set by `setPositions()`, `setNormals()`, `setColors()`, `setBoneWeights()`, `setBoneIndices()`, `setTangents()`, `setUVs()`, `setIndices()` methods.
|
|
220
|
+
* This method will be auto generate vertex element and vertex buffer binding if needed.
|
|
221
|
+
*
|
|
222
|
+
* @param releaseData - Whether to release the data cache, release data can reduce memory usage.
|
|
223
|
+
*/
|
|
224
|
+
uploadData(releaseData: boolean): void;
|
|
225
|
+
/**
|
|
226
|
+
* Calculate mesh tangent.
|
|
227
|
+
* @remark need to set positions(with or not with indices), normals, uv before calculation.
|
|
228
|
+
* @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
|
|
229
|
+
*/
|
|
230
|
+
calculateTangents(): void;
|
|
231
|
+
private _getVertexElementData;
|
|
232
|
+
private _beforeSetAdvancedVertexData;
|
|
233
|
+
private _updateAdvancedVertexDataMarks;
|
|
234
|
+
private _updateInternalVertexBuffer;
|
|
235
|
+
private _readVector2VertexData;
|
|
236
|
+
private _readVector3VertexData;
|
|
237
|
+
private _readVector4VertexData;
|
|
238
|
+
private _readColorVertexData;
|
|
239
|
+
private _readVertexData;
|
|
240
|
+
private _updateAdvancedVertexElement;
|
|
241
|
+
private _updateAdvancedVertexElements;
|
|
242
|
+
private _updateVertexElements;
|
|
243
|
+
private _writeVector2AdvancedVertexData;
|
|
244
|
+
private _writeVector3AdvancedVertexData;
|
|
245
|
+
private _writeVector4AdvancedVertexData;
|
|
246
|
+
private _writeColorAdvancedVertexData;
|
|
247
|
+
private _writeAdvancedVertexData;
|
|
248
|
+
private _updateAdvancedVertices;
|
|
249
|
+
private _getInternalVertexBufferIndex;
|
|
250
|
+
private _getAttributeFormat;
|
|
251
|
+
private _getAttributeByteLength;
|
|
252
|
+
private _releaseCache;
|
|
253
|
+
/** @deprecated */
|
|
254
|
+
private _accessible;
|
|
255
|
+
/**
|
|
256
|
+
* @deprecated
|
|
257
|
+
* Whether to access data of the mesh.
|
|
258
|
+
*/
|
|
259
|
+
get accessible(): boolean;
|
|
260
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ParticleRenderer } from "./ParticleRenderer";
|
|
2
1
|
import { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
3
2
|
import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
4
3
|
import { EmissionModule } from "./modules/EmissionModule";
|
|
@@ -47,7 +46,6 @@ export declare class ParticleGenerator {
|
|
|
47
46
|
*/
|
|
48
47
|
get randomSeed(): number;
|
|
49
48
|
set randomSeed(value: number);
|
|
50
|
-
constructor(renderer: ParticleRenderer);
|
|
51
49
|
/**
|
|
52
50
|
* Start emitting particles.
|
|
53
51
|
* @param withChildren - Whether to start the particle generator of the child entity
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { ParticleGenerator } from "./ParticleGenerator";
|
|
1
2
|
export { ParticleMaterial } from "./ParticleMaterial";
|
|
2
3
|
export { ParticleRenderer } from "./ParticleRenderer";
|
|
3
4
|
export { ParticleCurveMode } from "./enums/ParticleCurveMode";
|
|
@@ -7,6 +8,15 @@ export { ParticleScaleMode } from "./enums/ParticleScaleMode";
|
|
|
7
8
|
export { ParticleSimulationSpace } from "./enums/ParticleSimulationSpace";
|
|
8
9
|
export { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
9
10
|
export { Burst } from "./modules/Burst";
|
|
11
|
+
export { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
12
|
+
export { EmissionModule } from "./modules/EmissionModule";
|
|
13
|
+
export { MainModule } from "./modules/MainModule";
|
|
10
14
|
export { ParticleCompositeCurve } from "./modules/ParticleCompositeCurve";
|
|
15
|
+
export { ParticleCompositeGradient } from "./modules/ParticleCompositeGradient";
|
|
11
16
|
export { CurveKey, ParticleCurve } from "./modules/ParticleCurve";
|
|
17
|
+
export { GradientAlphaKey, GradientColorKey, ParticleGradient } from "./modules/ParticleGradient";
|
|
18
|
+
export { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
|
|
19
|
+
export { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
20
|
+
export { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
|
|
21
|
+
export { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
|
|
12
22
|
export * from "./modules/shape/index";
|
|
@@ -26,22 +26,19 @@ export declare class MainModule implements ICustomClone {
|
|
|
26
26
|
startSpeed: ParticleCompositeCurve;
|
|
27
27
|
/** A flag to enable specifying particle size individually for each axis. */
|
|
28
28
|
startSize3D: boolean;
|
|
29
|
-
/** The initial size of particles when the Particle Generator first spawns them. */
|
|
30
|
-
startSize: ParticleCompositeCurve;
|
|
31
29
|
/** The initial size of particles along the x-axis when the Particle Generator first spawns them. */
|
|
32
30
|
startSizeX: ParticleCompositeCurve;
|
|
33
31
|
/** The initial size of particles along the y-axis when the Particle Generator first spawns them. */
|
|
34
32
|
startSizeY: ParticleCompositeCurve;
|
|
35
33
|
/** The initial size of particles along the z-axis when the Particle Generator first spawns them. */
|
|
36
34
|
startSizeZ: ParticleCompositeCurve;
|
|
37
|
-
/** A flag to enable 3D particle rotation. */
|
|
35
|
+
/** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */
|
|
38
36
|
startRotation3D: boolean;
|
|
39
|
-
/** The initial rotation of particles when the Particle Generator first spawns them. */
|
|
40
|
-
startRotation: ParticleCompositeCurve;
|
|
41
37
|
/** The initial rotation of particles around the x-axis when emitted.*/
|
|
42
38
|
startRotationX: ParticleCompositeCurve;
|
|
43
39
|
/** The initial rotation of particles around the y-axis when emitted. */
|
|
44
40
|
startRotationY: ParticleCompositeCurve;
|
|
41
|
+
/** The initial rotation of particles around the z-axis when emitted. */
|
|
45
42
|
startRotationZ: ParticleCompositeCurve;
|
|
46
43
|
/** Makes some particles spin in the opposite direction. */
|
|
47
44
|
flipRotation: number;
|
|
@@ -57,7 +54,6 @@ export declare class MainModule implements ICustomClone {
|
|
|
57
54
|
scalingMode: ParticleScaleMode;
|
|
58
55
|
/** If set to true, the Particle Generator automatically begins to play on startup. */
|
|
59
56
|
playOnEnabled: boolean;
|
|
60
|
-
private _maxParticles;
|
|
61
57
|
private _generator;
|
|
62
58
|
private _gravity;
|
|
63
59
|
/**
|
|
@@ -65,4 +61,9 @@ export declare class MainModule implements ICustomClone {
|
|
|
65
61
|
*/
|
|
66
62
|
get maxParticles(): number;
|
|
67
63
|
set maxParticles(value: number);
|
|
64
|
+
/**
|
|
65
|
+
* The initial size of particles when the Particle Generator first spawns them.
|
|
66
|
+
*/
|
|
67
|
+
get startSize(): ParticleCompositeCurve;
|
|
68
|
+
set startSize(value: ParticleCompositeCurve);
|
|
68
69
|
}
|
|
@@ -7,6 +7,5 @@ export declare abstract class ParticleGeneratorModule {
|
|
|
7
7
|
/** Specifies whether the module is enabled or not. */
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
protected _generator: ParticleGenerator;
|
|
10
|
-
constructor(generator: ParticleGenerator);
|
|
11
10
|
protected _enableMacro(shaderData: ShaderData, lastEnableMacro: ShaderMacro, enableMacro: ShaderMacro): ShaderMacro;
|
|
12
11
|
}
|
|
@@ -18,7 +18,7 @@ export declare class RotationOverLifetimeModule extends ParticleGeneratorModule
|
|
|
18
18
|
static readonly _maxCurveXProperty: ShaderProperty;
|
|
19
19
|
static readonly _maxCurveYProperty: ShaderProperty;
|
|
20
20
|
static readonly _maxCurveZProperty: ShaderProperty;
|
|
21
|
-
/** Specifies whether the rotation is separate on each axis, when disabled only
|
|
21
|
+
/** Specifies whether the rotation is separate on each axis, when disabled, only `rotationZ` is used. */
|
|
22
22
|
separateAxes: boolean;
|
|
23
23
|
/** Rotation over lifetime for z axis. */
|
|
24
24
|
rotationX: ParticleCompositeCurve;
|
|
@@ -26,10 +26,6 @@ export declare class TextureSheetAnimationModule extends ParticleGeneratorModule
|
|
|
26
26
|
* */
|
|
27
27
|
get tiling(): Vector2;
|
|
28
28
|
set tiling(value: Vector2);
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
cloneTo(dest: TextureSheetAnimationModule): void;
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
35
31
|
* Texture sheet animation type.
|