@galacean/engine-core 0.0.0-experimental-double11.4 → 0.0.0-experimental-double11.5
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 +15561 -12275
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +15561 -12275
- package/dist/module.js +16256 -12993
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Background.d.ts +8 -0
- package/types/Camera.d.ts +32 -8
- package/types/Component.d.ts +1 -0
- package/types/ComponentsManager.d.ts +0 -2
- package/types/DisorderedArray.d.ts +8 -1
- package/types/Engine.d.ts +9 -4
- package/types/Entity.d.ts +2 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +2 -3
- package/types/RenderPipeline/RenderData.d.ts +8 -1
- package/types/RenderPipeline/RenderElement.d.ts +2 -4
- package/types/RenderPipeline/RenderQueue.d.ts +4 -2
- package/types/RenderPipeline/enums/PipelineStage.d.ts +2 -0
- package/types/Renderer.d.ts +2 -2
- package/types/Scene.d.ts +9 -4
- package/types/SceneManager.d.ts +28 -5
- package/types/Script.d.ts +0 -1
- package/types/animation/Keyframe.d.ts +4 -3
- package/types/animation/animationCurve/index.d.ts +2 -0
- package/types/animation/index.d.ts +4 -0
- package/types/asset/AssetType.d.ts +5 -1
- package/types/asset/GraphicsResource.d.ts +4 -0
- package/types/asset/Loader.d.ts +3 -1
- package/types/asset/ResourceManager.d.ts +8 -2
- package/types/base/Constant.d.ts +1 -0
- package/types/clone/ComponentCloner.d.ts +4 -1
- package/types/graphic/Buffer.d.ts +22 -6
- package/types/graphic/BufferUtil.d.ts +1 -0
- package/types/graphic/Mesh.d.ts +2 -3
- package/types/graphic/VertexElement.d.ts +10 -6
- package/types/graphic/index.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/input/InputManager.d.ts +2 -2
- 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/BufferMesh.d.ts +2 -2
- package/types/mesh/ModelMesh.d.ts +70 -42
- package/types/mesh/PrimitiveMesh.d.ts +4 -2
- package/types/mesh/Skin.d.ts +3 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +20 -11
- package/types/mesh/index.d.ts +6 -5
- package/types/particle/ParticleGenerator.d.ts +0 -2
- package/types/particle/ParticleRenderer.d.ts +41 -231
- package/types/particle/index.d.ts +22 -1
- package/types/particle/modules/MainModule.d.ts +7 -5
- 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 +1 -0
- package/types/physics/index.d.ts +7 -7
- package/types/physics/joint/HingeJoint.d.ts +1 -1
- package/types/physics/joint/Joint.d.ts +4 -2
- package/types/physics/joint/SpringJoint.d.ts +1 -2
- package/types/physics/shape/BoxColliderShape.d.ts +0 -2
- package/types/physics/shape/CapsuleColliderShape.d.ts +0 -2
- package/types/physics/shape/ColliderShape.d.ts +2 -4
- package/types/physics/shape/PlaneColliderShape.d.ts +0 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -2
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +0 -1
- package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +1 -1
- package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +1 -1
- package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +1 -1
- package/types/shader/Shader.d.ts +22 -0
- package/types/shader/ShaderPart.d.ts +5 -0
- package/types/shader/ShaderPass.d.ts +8 -0
- package/types/shader/SubShader.d.ts +0 -1
- package/types/shader/index.d.ts +1 -0
- package/types/shaderlib/ShaderFactory.d.ts +2 -7
- package/types/shaderlib/ShaderLib.d.ts +11 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -6
- package/types/texture/RenderTarget.d.ts +1 -2
- package/types/texture/Texture2D.d.ts +1 -1
- package/types/texture/Texture2DArray.d.ts +1 -1
- package/types/texture/TextureCube.d.ts +1 -1
- package/types/texture/enums/TextureFormat.d.ts +55 -49
package/types/graphic/Mesh.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import {
|
|
3
|
+
import { ReferResource } from "../asset/ReferResource";
|
|
4
4
|
import { SubMesh } from "../graphic/SubMesh";
|
|
5
5
|
import { MeshTopology } from "../graphic/enums/MeshTopology";
|
|
6
6
|
/**
|
|
7
7
|
* Mesh.
|
|
8
8
|
*/
|
|
9
|
-
export declare abstract class Mesh extends
|
|
9
|
+
export declare abstract class Mesh extends ReferResource {
|
|
10
10
|
/** Name. */
|
|
11
11
|
name: string;
|
|
12
12
|
private _bounds;
|
|
@@ -54,6 +54,5 @@ export declare abstract class Mesh extends GraphicsResource {
|
|
|
54
54
|
*/
|
|
55
55
|
clearSubMesh(): void;
|
|
56
56
|
_addReferCount(value: number): void;
|
|
57
|
-
_rebuild(): void;
|
|
58
57
|
private _onBoundsChanged;
|
|
59
58
|
}
|
|
@@ -4,16 +4,16 @@ import { VertexElementFormat } from "./enums/VertexElementFormat";
|
|
|
4
4
|
* Vertex element.
|
|
5
5
|
*/
|
|
6
6
|
export declare class VertexElement {
|
|
7
|
-
|
|
8
|
-
private
|
|
7
|
+
_formatMetaInfo: ElementInfo;
|
|
8
|
+
private _attributeName;
|
|
9
9
|
private _offset;
|
|
10
10
|
private _format;
|
|
11
11
|
private _bindingIndex;
|
|
12
12
|
private _instanceStepRate;
|
|
13
13
|
/**
|
|
14
|
-
* Vertex
|
|
14
|
+
* Vertex attribute.
|
|
15
15
|
*/
|
|
16
|
-
get
|
|
16
|
+
get attribute(): string;
|
|
17
17
|
/**
|
|
18
18
|
* Vertex data byte offset.
|
|
19
19
|
*/
|
|
@@ -34,11 +34,15 @@ export declare class VertexElement {
|
|
|
34
34
|
get instanceStepRate(): number;
|
|
35
35
|
/**
|
|
36
36
|
* Create vertex element.
|
|
37
|
-
* @param
|
|
37
|
+
* @param attribute - Input attribute
|
|
38
38
|
* @param offset - Vertex data byte offset
|
|
39
39
|
* @param format - Vertex data format
|
|
40
40
|
* @param bindingIndex - Vertex buffer binding index
|
|
41
41
|
* @param instanceStepRate - Instance cadence, the number of instances drawn for each vertex in the buffer, non-instance elements must be 0.
|
|
42
42
|
*/
|
|
43
|
-
constructor(
|
|
43
|
+
constructor(attribute: string, offset: number, format: VertexElementFormat, bindingIndex: number, instanceStepRate?: number);
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated use `attributeName` instead
|
|
46
|
+
*/
|
|
47
|
+
get semantic(): string;
|
|
44
48
|
}
|
package/types/graphic/index.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from "./RenderPipeline/index";
|
|
|
26
26
|
export * from "./base";
|
|
27
27
|
export { Background } from "./Background";
|
|
28
28
|
export { BackgroundMode } from "./enums/BackgroundMode";
|
|
29
|
+
export { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
29
30
|
export { FogMode } from "./enums/FogMode";
|
|
30
31
|
export { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
31
32
|
export { ColorSpace } from "./enums/ColorSpace";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
1
2
|
import { Keys } from "./enums/Keys";
|
|
2
|
-
import { Pointer } from "./pointer/Pointer";
|
|
3
3
|
import { PointerButton } from "./enums/PointerButton";
|
|
4
|
-
import {
|
|
4
|
+
import { Pointer } from "./pointer/Pointer";
|
|
5
5
|
/**
|
|
6
6
|
* InputManager manages device input such as mouse, touch, keyboard, etc.
|
|
7
7
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -27,10 +27,10 @@ export declare class BufferMesh extends Mesh {
|
|
|
27
27
|
setVertexElements(elements: VertexElement[]): void;
|
|
28
28
|
/**
|
|
29
29
|
* Set vertex buffer binding.
|
|
30
|
-
* @param
|
|
30
|
+
* @param vertexBufferBinding - Vertex buffer binding
|
|
31
31
|
* @param index - Vertex buffer index, the default value is 0
|
|
32
32
|
*/
|
|
33
|
-
setVertexBufferBinding(
|
|
33
|
+
setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
|
|
34
34
|
/**
|
|
35
35
|
* Set vertex buffer binding.
|
|
36
36
|
* @param vertexBuffer - Vertex buffer
|
|
@@ -5,6 +5,7 @@ import { Mesh } from "../graphic/Mesh";
|
|
|
5
5
|
import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
|
|
6
6
|
import { VertexElement } from "../graphic/VertexElement";
|
|
7
7
|
import { BlendShape } from "./BlendShape";
|
|
8
|
+
import { VertexAttribute } from "./enums/VertexAttribute";
|
|
8
9
|
/**
|
|
9
10
|
* Mesh containing common vertex elements of the model.
|
|
10
11
|
*/
|
|
@@ -15,12 +16,8 @@ export declare class ModelMesh extends Mesh {
|
|
|
15
16
|
private static _tempVec3;
|
|
16
17
|
private static _tempVec4;
|
|
17
18
|
private _vertexCount;
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private _verticesUint8;
|
|
21
|
-
private _indices;
|
|
22
|
-
private _indicesFormat;
|
|
23
|
-
private _indicesChangeFlag;
|
|
19
|
+
private _vertexCountDirty;
|
|
20
|
+
private _dataVersionCounter;
|
|
24
21
|
private _positions;
|
|
25
22
|
private _normals;
|
|
26
23
|
private _colors;
|
|
@@ -35,18 +32,20 @@ export declare class ModelMesh extends Mesh {
|
|
|
35
32
|
private _uv7;
|
|
36
33
|
private _boneWeights;
|
|
37
34
|
private _boneIndices;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
private _advancedElementUpdateFlag;
|
|
36
|
+
private _advancedDataUpdateFlag;
|
|
37
|
+
private _advancedVertexDataVersions;
|
|
38
|
+
private _advancedDataSyncToBuffer;
|
|
39
|
+
private _internalVertexBufferStride;
|
|
40
|
+
private _internalVertexBufferCreatedInfo;
|
|
41
|
+
private _internalVertexElementsOffset;
|
|
42
|
+
private _internalVertexElementsFlags;
|
|
43
|
+
private _vertexBufferInfos;
|
|
44
|
+
private _indices;
|
|
45
|
+
private _indicesFormat;
|
|
46
|
+
private _indicesChangeFlag;
|
|
48
47
|
/**
|
|
49
|
-
* Vertex count of
|
|
48
|
+
* Vertex count of mesh.
|
|
50
49
|
*/
|
|
51
50
|
get vertexCount(): number;
|
|
52
51
|
/**
|
|
@@ -56,7 +55,7 @@ export declare class ModelMesh extends Mesh {
|
|
|
56
55
|
/**
|
|
57
56
|
* Vertex buffer binding collection.
|
|
58
57
|
*/
|
|
59
|
-
get vertexBufferBindings():
|
|
58
|
+
get vertexBufferBindings(): ReadonlyArray<VertexBufferBinding>;
|
|
60
59
|
/**
|
|
61
60
|
* BlendShapes of this ModelMesh.
|
|
62
61
|
*/
|
|
@@ -73,7 +72,7 @@ export declare class ModelMesh extends Mesh {
|
|
|
73
72
|
constructor(engine: Engine, name?: string);
|
|
74
73
|
/**
|
|
75
74
|
* Set positions for the mesh.
|
|
76
|
-
* @param positions - The positions for the mesh
|
|
75
|
+
* @param positions - The positions for the mesh
|
|
77
76
|
*/
|
|
78
77
|
setPositions(positions: Vector3[] | null): void;
|
|
79
78
|
/**
|
|
@@ -83,7 +82,7 @@ export declare class ModelMesh extends Mesh {
|
|
|
83
82
|
getPositions(): Vector3[] | null;
|
|
84
83
|
/**
|
|
85
84
|
* Set per-vertex normals for the mesh.
|
|
86
|
-
* @param normals - The normals for the mesh
|
|
85
|
+
* @param normals - The normals for the mesh
|
|
87
86
|
*/
|
|
88
87
|
setNormals(normals: Vector3[] | null): void;
|
|
89
88
|
/**
|
|
@@ -93,7 +92,7 @@ export declare class ModelMesh extends Mesh {
|
|
|
93
92
|
getNormals(): Vector3[] | null;
|
|
94
93
|
/**
|
|
95
94
|
* Set per-vertex colors for the mesh.
|
|
96
|
-
* @param colors - The colors for the mesh
|
|
95
|
+
* @param colors - The colors for the mesh
|
|
97
96
|
*/
|
|
98
97
|
setColors(colors: Color[] | null): void;
|
|
99
98
|
/**
|
|
@@ -103,27 +102,27 @@ export declare class ModelMesh extends Mesh {
|
|
|
103
102
|
getColors(): Color[] | null;
|
|
104
103
|
/**
|
|
105
104
|
* Set per-vertex bone weights for the mesh.
|
|
106
|
-
* @param boneWeights - The bone weights for the mesh
|
|
105
|
+
* @param boneWeights - The bone weights for the mesh
|
|
107
106
|
*/
|
|
108
107
|
setBoneWeights(boneWeights: Vector4[] | null): void;
|
|
109
108
|
/**
|
|
110
|
-
* Get weights for the mesh.
|
|
109
|
+
* Get bone weights for the mesh.
|
|
111
110
|
* @remarks Please call the setWeights() method after modification to ensure that the modification takes effect.
|
|
112
111
|
*/
|
|
113
112
|
getBoneWeights(): Vector4[] | null;
|
|
114
113
|
/**
|
|
115
114
|
* Set per-vertex bone indices for the mesh.
|
|
116
|
-
* @param boneIndices - The bone indices for the mesh
|
|
115
|
+
* @param boneIndices - The bone indices for the mesh
|
|
117
116
|
*/
|
|
118
117
|
setBoneIndices(boneIndices: Vector4[] | null): void;
|
|
119
118
|
/**
|
|
120
|
-
* Get
|
|
119
|
+
* Get bone indices for the mesh.
|
|
121
120
|
* @remarks Please call the setBoneIndices() method after modification to ensure that the modification takes effect.
|
|
122
121
|
*/
|
|
123
122
|
getBoneIndices(): Vector4[] | null;
|
|
124
123
|
/**
|
|
125
124
|
* Set per-vertex tangents for the mesh.
|
|
126
|
-
* @param tangents - The tangents for the mesh
|
|
125
|
+
* @param tangents - The tangents for the mesh
|
|
127
126
|
*/
|
|
128
127
|
setTangents(tangents: Vector4[] | null): void;
|
|
129
128
|
/**
|
|
@@ -133,13 +132,13 @@ export declare class ModelMesh extends Mesh {
|
|
|
133
132
|
getTangents(): Vector4[] | null;
|
|
134
133
|
/**
|
|
135
134
|
* Set per-vertex uv for the mesh.
|
|
136
|
-
* @param uv - The uv for the mesh
|
|
135
|
+
* @param uv - The uv for the mesh
|
|
137
136
|
*/
|
|
138
137
|
setUVs(uv: Vector2[] | null): void;
|
|
139
138
|
/**
|
|
140
139
|
* Set per-vertex uv for the mesh by channelIndex.
|
|
141
|
-
* @param uv - The uv for the mesh
|
|
142
|
-
* @param channelIndex - The index of uv channels, in [0 ~ 7] range
|
|
140
|
+
* @param uv - The uv for the mesh
|
|
141
|
+
* @param channelIndex - The index of uv channels, in [0 ~ 7] range
|
|
143
142
|
*/
|
|
144
143
|
setUVs(uv: Vector2[] | null, channelIndex: number): void;
|
|
145
144
|
/**
|
|
@@ -155,7 +154,7 @@ export declare class ModelMesh extends Mesh {
|
|
|
155
154
|
getUVs(channelIndex: number): Vector2[] | null;
|
|
156
155
|
/**
|
|
157
156
|
* Set indices for the mesh.
|
|
158
|
-
* @param indices - The indices for the mesh
|
|
157
|
+
* @param indices - The indices for the mesh
|
|
159
158
|
*/
|
|
160
159
|
setIndices(indices: Uint8Array | Uint16Array | Uint32Array): void;
|
|
161
160
|
/**
|
|
@@ -163,21 +162,20 @@ export declare class ModelMesh extends Mesh {
|
|
|
163
162
|
*/
|
|
164
163
|
getIndices(): Uint8Array | Uint16Array | Uint32Array;
|
|
165
164
|
/**
|
|
166
|
-
* @beta
|
|
167
|
-
* @todo Update buffer should support custom vertex elements.
|
|
168
165
|
* Set vertex elements.
|
|
169
166
|
* @param elements - Vertex element collection
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* Call this method will clear the vertex data set by the setPositions(), setNormals(), setColors(), setBoneWeights(), setBoneIndices(), setTangents(), setUVs() methods.
|
|
170
170
|
*/
|
|
171
171
|
setVertexElements(elements: VertexElement[]): void;
|
|
172
172
|
/**
|
|
173
|
-
* @beta
|
|
174
173
|
* Set vertex buffer binding.
|
|
175
|
-
* @param
|
|
174
|
+
* @param vertexBufferBinding - Vertex buffer binding
|
|
176
175
|
* @param index - Vertex buffer index, the default value is 0
|
|
177
176
|
*/
|
|
178
|
-
setVertexBufferBinding(
|
|
177
|
+
setVertexBufferBinding(vertexBufferBinding: VertexBufferBinding, index?: number): void;
|
|
179
178
|
/**
|
|
180
|
-
* @beta
|
|
181
179
|
* Set vertex buffer binding.
|
|
182
180
|
* @param vertexBuffer - Vertex buffer
|
|
183
181
|
* @param stride - Vertex buffer data stride
|
|
@@ -190,6 +188,12 @@ export declare class ModelMesh extends Mesh {
|
|
|
190
188
|
* @param firstIndex - First vertex buffer index, the default value is 0
|
|
191
189
|
*/
|
|
192
190
|
setVertexBufferBindings(vertexBufferBindings: VertexBufferBinding[], firstIndex?: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get `VertexElement` by attribute.
|
|
193
|
+
* @param attribute - Vertex attribute
|
|
194
|
+
* @returns Vertex element
|
|
195
|
+
*/
|
|
196
|
+
getVertexElement(attribute: VertexAttribute): VertexElement | null;
|
|
193
197
|
/**
|
|
194
198
|
* Add a BlendShape for this ModelMesh.
|
|
195
199
|
* @param blendShape - The BlendShape
|
|
@@ -206,21 +210,45 @@ export declare class ModelMesh extends Mesh {
|
|
|
206
210
|
*/
|
|
207
211
|
getBlendShapeName(index: number): string;
|
|
208
212
|
/**
|
|
209
|
-
* Upload
|
|
210
|
-
*
|
|
213
|
+
* Upload data to GPU set by `setPositions()`, `setNormals()`, `setColors()`, `setBoneWeights()`, `setBoneIndices()`, `setTangents()`, `setUVs()`, `setIndices()` methods.
|
|
214
|
+
* This method will be auto generate vertex element and vertex buffer binding if needed.
|
|
215
|
+
*
|
|
216
|
+
* @param releaseData - Whether to release the data cache, release data can reduce memory usage.
|
|
211
217
|
*/
|
|
212
|
-
uploadData(
|
|
218
|
+
uploadData(releaseData: boolean): void;
|
|
213
219
|
/**
|
|
214
220
|
* Calculate mesh tangent.
|
|
215
221
|
* @remark need to set positions(with or not with indices), normals, uv before calculation.
|
|
216
222
|
* @remark based on http://foundationsofgameenginedev.com/FGED2-sample.pdf
|
|
217
223
|
*/
|
|
218
224
|
calculateTangents(): void;
|
|
219
|
-
private
|
|
225
|
+
private _getVertexElementData;
|
|
226
|
+
private _beforeSetAdvancedVertexData;
|
|
227
|
+
private _updateAdvancedVertexDataMarks;
|
|
228
|
+
private _updateInternalVertexBuffer;
|
|
229
|
+
private _readVector2VertexData;
|
|
230
|
+
private _readVector3VertexData;
|
|
231
|
+
private _readVector4VertexData;
|
|
232
|
+
private _readColorVertexData;
|
|
233
|
+
private _readVertexData;
|
|
234
|
+
private _updateAdvancedVertexElement;
|
|
235
|
+
private _updateAdvancedVertexElements;
|
|
220
236
|
private _updateVertexElements;
|
|
221
|
-
private
|
|
222
|
-
private
|
|
237
|
+
private _writeVector2AdvancedVertexData;
|
|
238
|
+
private _writeVector3AdvancedVertexData;
|
|
239
|
+
private _writeVector4AdvancedVertexData;
|
|
240
|
+
private _writeColorAdvancedVertexData;
|
|
241
|
+
private _writeAdvancedVertexData;
|
|
242
|
+
private _updateAdvancedVertices;
|
|
243
|
+
private _getInternalVertexBufferIndex;
|
|
223
244
|
private _getAttributeFormat;
|
|
224
245
|
private _getAttributeByteLength;
|
|
225
246
|
private _releaseCache;
|
|
247
|
+
/** @deprecated */
|
|
248
|
+
private _accessible;
|
|
249
|
+
/**
|
|
250
|
+
* @deprecated
|
|
251
|
+
* Whether to access data of the mesh.
|
|
252
|
+
*/
|
|
253
|
+
get accessible(): boolean;
|
|
226
254
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
|
+
import { Buffer } from "../graphic/Buffer";
|
|
2
3
|
import { ModelMesh } from "./ModelMesh";
|
|
3
4
|
/**
|
|
4
5
|
* Used to generate common primitive meshes.
|
|
5
6
|
*/
|
|
6
7
|
export declare class PrimitiveMesh {
|
|
8
|
+
private static _tempVec30;
|
|
7
9
|
/**
|
|
8
10
|
* Create a sphere mesh.
|
|
9
11
|
* @param engine - Engine
|
|
@@ -80,8 +82,8 @@ export declare class PrimitiveMesh {
|
|
|
80
82
|
* @returns Capsule model mesh
|
|
81
83
|
*/
|
|
82
84
|
static createCapsule(engine: Engine, radius?: number, height?: number, radialSegments?: number, heightSegments?: number, noLongerAccessible?: boolean): ModelMesh;
|
|
83
|
-
static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean): void;
|
|
84
|
-
static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean): void;
|
|
85
|
+
static _setCylinderData(cylinderMesh: ModelMesh, radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
|
|
86
|
+
static _setCapsuleData(capsuleMesh: ModelMesh, radius: number, height: number, radialSegments: number, heightSegments: number, noLongerAccessible: boolean, isRestoreMode: boolean, restoreVertexBuffer?: Buffer): void;
|
|
85
87
|
private static _initialize;
|
|
86
88
|
private static _generateIndices;
|
|
87
89
|
private static _createCapsuleCap;
|
package/types/mesh/Skin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Matrix } from "@galacean/engine-math";
|
|
2
2
|
import { EngineObject } from "../base/EngineObject";
|
|
3
|
+
import { Entity } from "../Entity";
|
|
3
4
|
/**
|
|
4
5
|
* Mesh skin data, equal glTF skins define
|
|
5
6
|
*/
|
|
@@ -8,6 +9,8 @@ export declare class Skin extends EngineObject {
|
|
|
8
9
|
inverseBindMatrices: Matrix[];
|
|
9
10
|
joints: string[];
|
|
10
11
|
skeleton: string;
|
|
12
|
+
_rootBone: Entity;
|
|
13
|
+
_bones: Entity[];
|
|
11
14
|
/**
|
|
12
15
|
* Constructor of skin
|
|
13
16
|
* @param name - name
|
|
@@ -9,27 +9,20 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
9
9
|
private static _jointCountProperty;
|
|
10
10
|
private static _jointSamplerProperty;
|
|
11
11
|
private static _jointMatrixProperty;
|
|
12
|
-
private _hasInitSkin;
|
|
13
12
|
private _jointDataCreateCache;
|
|
14
|
-
private _skin;
|
|
15
13
|
private _blendShapeWeights;
|
|
16
14
|
private _maxVertexUniformVectors;
|
|
17
15
|
private _rootBone;
|
|
18
16
|
private _localBounds;
|
|
19
17
|
private _jointMatrices;
|
|
20
18
|
private _jointTexture;
|
|
21
|
-
private
|
|
19
|
+
private _bones;
|
|
22
20
|
/**
|
|
23
21
|
* The weights of the BlendShapes.
|
|
24
22
|
* @remarks Array index is BlendShape index.
|
|
25
23
|
*/
|
|
26
24
|
get blendShapeWeights(): Float32Array;
|
|
27
25
|
set blendShapeWeights(value: Float32Array);
|
|
28
|
-
/**
|
|
29
|
-
* Skin Object.
|
|
30
|
-
*/
|
|
31
|
-
get skin(): Skin;
|
|
32
|
-
set skin(value: Skin);
|
|
33
26
|
/**
|
|
34
27
|
* Local bounds.
|
|
35
28
|
*/
|
|
@@ -40,9 +33,25 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
40
33
|
*/
|
|
41
34
|
get rootBone(): Entity;
|
|
42
35
|
set rootBone(value: Entity);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Bones of the SkinnedMeshRenderer.
|
|
38
|
+
*/
|
|
39
|
+
get bones(): ReadonlyArray<Entity>;
|
|
40
|
+
set bones(value: ReadonlyArray<Entity>);
|
|
46
41
|
private _checkBlendShapeWeightLength;
|
|
47
42
|
private _onLocalBoundsChanged;
|
|
43
|
+
private _getEntityHierarchyPath;
|
|
44
|
+
private _skin;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
* Skin Object.
|
|
48
|
+
*
|
|
49
|
+
* If you want get `skeleton`, use {@link SkinnedMeshRenderer.rootBone} instead.
|
|
50
|
+
* If you want get `bones`, use {@link SkinnedMeshRenderer.bones} instead.
|
|
51
|
+
* `inverseBindMatrices` will migrate to mesh in the future.
|
|
52
|
+
*
|
|
53
|
+
* @remarks `rootBone` and `bones` will not update when `skin` changed.
|
|
54
|
+
*/
|
|
55
|
+
get skin(): Skin;
|
|
56
|
+
set skin(value: Skin);
|
|
48
57
|
}
|
package/types/mesh/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export { BlendShape } from "./BlendShape";
|
|
2
|
+
export { BlendShapeFrame } from "./BlendShapeFrame";
|
|
3
|
+
export { BufferMesh } from "./BufferMesh";
|
|
4
|
+
export { MeshRenderer } from "./MeshRenderer";
|
|
1
5
|
export { ModelMesh } from "./ModelMesh";
|
|
6
|
+
export { PrimitiveMesh } from "./PrimitiveMesh";
|
|
2
7
|
export { Skin } from "./Skin";
|
|
3
|
-
export { MeshRenderer } from "./MeshRenderer";
|
|
4
8
|
export { SkinnedMeshRenderer } from "./SkinnedMeshRenderer";
|
|
5
|
-
export {
|
|
6
|
-
export { BufferMesh } from "./BufferMesh";
|
|
7
|
-
export { BlendShape } from "./BlendShape";
|
|
8
|
-
export { BlendShapeFrame } from "./BlendShapeFrame";
|
|
9
|
+
export { VertexAttribute } from "./enums/VertexAttribute";
|
|
@@ -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
|