@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.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/README.md +2 -10
- package/es/animation-clip-data.d.ts +26 -0
- package/es/animation-clip-data.js +1 -0
- package/{dist/src → es}/binary.d.ts +3 -1
- package/es/binary.js +1 -0
- package/es/buitin-object-guid.d.ts +5 -0
- package/es/buitin-object-guid.js +5 -0
- package/es/components.d.ts +204 -0
- package/es/components.js +129 -0
- package/{dist/src → es}/composition.d.ts +32 -46
- package/es/composition.js +42 -0
- package/es/constants.js +11 -0
- package/{dist/src → es}/image.d.ts +21 -27
- package/es/image.js +9 -0
- package/{dist/src → es}/index.d.ts +4 -2
- package/es/index.js +28 -0
- package/{dist/src → es}/item/base-item.d.ts +9 -6
- package/es/item/base-item.js +11 -0
- package/{dist/src → es}/item/camera-item.d.ts +4 -4
- package/es/item/camera-item.js +1 -0
- package/{dist/src → es}/item/composition-item.d.ts +2 -2
- package/es/item/composition-item.js +1 -0
- package/es/item/effect-item.d.ts +35 -0
- package/es/item/effect-item.js +1 -0
- package/{dist/src → es}/item/interact-item.d.ts +1 -1
- package/es/item/interact-item.js +1 -0
- package/es/item/model/binary.js +1 -0
- package/es/item/model/camera.js +5 -0
- package/es/item/model/index.js +35 -0
- package/es/item/model/light.js +19 -0
- package/{dist/src → es}/item/model/material.d.ts +3 -3
- package/es/item/model/material.js +16 -0
- package/{dist/src → es}/item/model/mesh.d.ts +7 -6
- package/es/item/model/mesh.js +5 -0
- package/es/item/model/render.js +42 -0
- package/{dist/src → es}/item/model/skybox.d.ts +7 -1
- package/es/item/model/skybox.js +1 -0
- package/{dist/src → es}/item/model/tree.d.ts +10 -0
- package/es/item/model/tree.js +1 -0
- package/es/item/null-item.d.ts +46 -0
- package/es/item/null-item.js +1 -0
- package/{dist/src → es}/item/particle-item.d.ts +18 -21
- package/es/item/particle-item.js +14 -0
- package/es/item/particle-shape.js +19 -0
- package/{dist/src → es}/item/plugin-item.d.ts +1 -1
- package/es/item/plugin-item.js +1 -0
- package/{dist/src → es}/item/spine-item.d.ts +42 -18
- package/es/item/spine-item.js +1 -0
- package/{dist/src → es}/item/sprite-item.d.ts +1 -1
- package/es/item/sprite-item.js +1 -0
- package/{dist/src → es}/item/text-item.d.ts +1 -1
- package/es/item/text-item.js +1 -0
- package/{dist/src → es}/item.d.ts +2 -5
- package/es/item.js +1 -0
- package/{dist/src → es}/number-expression.d.ts +21 -8
- package/es/number-expression.js +91 -0
- package/{dist/src → es}/scene.d.ts +19 -19
- package/es/scene.js +1 -0
- package/{dist/src → es}/text.d.ts +3 -55
- package/es/text.js +84 -0
- package/es/timeline/index.d.ts +5 -0
- package/es/timeline/index.js +5 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
- package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
- package/es/timeline/playables/transform-playable-asset-data.js +1 -0
- package/es/timeline/timeline-asset-data.d.ts +8 -0
- package/es/timeline/timeline-asset-data.js +1 -0
- package/es/timeline/timeline-clip-data.d.ts +9 -0
- package/es/timeline/timeline-clip-data.js +1 -0
- package/es/timeline/track/track-asset-data.d.ts +9 -0
- package/es/timeline/track/track-asset-data.js +1 -0
- package/{dist/src → es}/type.d.ts +45 -20
- package/es/type.js +342 -0
- package/{dist/src → es}/vfx-item-data.d.ts +8 -9
- package/es/vfx-item-data.js +1 -0
- package/package.json +26 -47
- package/dist/fallback/camera.d.ts +0 -2
- package/dist/fallback/filter.d.ts +0 -2
- package/dist/fallback/index.d.ts +0 -12
- package/dist/fallback/interact.d.ts +0 -2
- package/dist/fallback/migration.d.ts +0 -13
- package/dist/fallback/particle.d.ts +0 -2
- package/dist/fallback/sprite.d.ts +0 -3
- package/dist/fallback/utils.d.ts +0 -36
- package/dist/fallback.js +0 -2155
- package/dist/fallback.js.map +0 -1
- package/dist/fallback.mjs +0 -2127
- package/dist/fallback.mjs.map +0 -1
- package/dist/index.js +0 -758
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -743
- package/dist/index.mjs.map +0 -1
- package/dist/src/components.d.ts +0 -93
- package/dist/src/item/effect-item.d.ts +0 -17
- package/dist/src/item/filter-item.d.ts +0 -99
- package/dist/src/item/null-item.d.ts +0 -94
- /package/{dist/src → es}/constants.d.ts +0 -0
- /package/{dist/src → es}/item/model/binary.d.ts +0 -0
- /package/{dist/src → es}/item/model/camera.d.ts +0 -0
- /package/{dist/src → es}/item/model/index.d.ts +0 -0
- /package/{dist/src → es}/item/model/light.d.ts +0 -0
- /package/{dist/src → es}/item/model/render.d.ts +0 -0
- /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
package/README.md
CHANGED
|
@@ -8,15 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
``` bash
|
|
10
10
|
# 1. Install dependencies (first time)
|
|
11
|
-
|
|
11
|
+
pnpm install
|
|
12
12
|
# 2. Build
|
|
13
|
-
|
|
13
|
+
pnpm run build
|
|
14
14
|
```
|
|
15
|
-
|
|
16
|
-
## Testing
|
|
17
|
-
|
|
18
|
-
``` bash
|
|
19
|
-
npm run test
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
> Open browser and open: http://localhost:9003/test/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { EffectsObjectData } from './components';
|
|
2
|
+
import type { FixedNumberExpression, FixedVec3Expression, FixedQuatExpression } from './number-expression';
|
|
3
|
+
export interface AnimationClipData extends EffectsObjectData {
|
|
4
|
+
positionCurves: PositionCurveData[];
|
|
5
|
+
rotationCurves: RotationCurveData[];
|
|
6
|
+
scaleCurves: ScaleCurveData[];
|
|
7
|
+
floatCurves: FloatCurveData[];
|
|
8
|
+
}
|
|
9
|
+
export interface PositionCurveData {
|
|
10
|
+
path: string;
|
|
11
|
+
keyFrames: FixedVec3Expression;
|
|
12
|
+
}
|
|
13
|
+
export interface RotationCurveData {
|
|
14
|
+
path: string;
|
|
15
|
+
keyFrames: FixedQuatExpression;
|
|
16
|
+
}
|
|
17
|
+
export interface ScaleCurveData {
|
|
18
|
+
path: string;
|
|
19
|
+
keyFrames: FixedVec3Expression;
|
|
20
|
+
}
|
|
21
|
+
export interface FloatCurveData {
|
|
22
|
+
path: string;
|
|
23
|
+
property: string;
|
|
24
|
+
className: string;
|
|
25
|
+
keyFrames: FixedNumberExpression;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataType } from './components';
|
|
1
2
|
import type { RenderLevel } from './type';
|
|
2
3
|
import type { ValueType } from './number-expression';
|
|
3
4
|
/**
|
|
@@ -19,12 +20,13 @@ import type { ValueType } from './number-expression';
|
|
|
19
20
|
*/
|
|
20
21
|
export type BinaryPointerContent = [index: number, start?: number, byteLength?: number, type?: BinaryType];
|
|
21
22
|
export type BinaryPointer = [ValueType.BINARY, BinaryPointerContent];
|
|
22
|
-
export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | 'f64' |
|
|
23
|
+
export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | 'f64' | '';
|
|
23
24
|
/**
|
|
24
25
|
* 线上二进制地址
|
|
25
26
|
*/
|
|
26
27
|
export interface BinaryFile {
|
|
27
28
|
url: string;
|
|
29
|
+
dataType: DataType.BinaryAsset;
|
|
28
30
|
renderLevel?: RenderLevel;
|
|
29
31
|
}
|
|
30
32
|
export type BinaryEnv = 'studio' | 'runtime' | 'json';
|
package/es/binary.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { Vector2Data } from './item/base-item';
|
|
2
|
+
export declare enum DataType {
|
|
3
|
+
VFXItemData = "VFXItemData",
|
|
4
|
+
EffectComponent = "EffectComponent",
|
|
5
|
+
Material = "Material",
|
|
6
|
+
Shader = "Shader",
|
|
7
|
+
SpriteComponent = "SpriteComponent",
|
|
8
|
+
ParticleSystem = "ParticleSystem",
|
|
9
|
+
InteractComponent = "InteractComponent",
|
|
10
|
+
CameraController = "CameraController",
|
|
11
|
+
Geometry = "Geometry",
|
|
12
|
+
Texture = "Texture",
|
|
13
|
+
AnimationClip = "AnimationClip",
|
|
14
|
+
TextComponent = "TextComponent",
|
|
15
|
+
BinaryAsset = "BinaryAsset",
|
|
16
|
+
TrackAsset = "TrackAsset",
|
|
17
|
+
TimelineAsset = "TimelineAsset",
|
|
18
|
+
ObjectBindingTrack = "ObjectBindingTrack",
|
|
19
|
+
TransformTrack = "TransformTrack",
|
|
20
|
+
SpriteColorTrack = "SpriteColorTrack",
|
|
21
|
+
ActivationTrack = "ActivationTrack",
|
|
22
|
+
SubCompositionTrack = "SubCompositionTrack",
|
|
23
|
+
TransformPlayableAsset = "TransformPlayableAsset",
|
|
24
|
+
SpriteColorPlayableAsset = "SpriteColorPlayableAsset",
|
|
25
|
+
ActivationPlayableAsset = "ActivationPlayableAsset",
|
|
26
|
+
SubCompositionPlayableAsset = "SubCompositionPlayableAsset",
|
|
27
|
+
MeshComponent = "MeshComponent",
|
|
28
|
+
SkyboxComponent = "SkyboxComponent",
|
|
29
|
+
LightComponent = "LightComponent",
|
|
30
|
+
CameraComponent = "CameraComponent",
|
|
31
|
+
ModelPluginComponent = "ModelPluginComponent",
|
|
32
|
+
TreeComponent = "TreeComponent",
|
|
33
|
+
AnimationComponent = "AnimationComponent",
|
|
34
|
+
SpineComponent = "SpineComponent",
|
|
35
|
+
TimelineClip = "TimelineClip"
|
|
36
|
+
}
|
|
37
|
+
export interface DataPath {
|
|
38
|
+
id: string;
|
|
39
|
+
}
|
|
40
|
+
export interface EffectsObjectData {
|
|
41
|
+
id: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
dataType: DataType;
|
|
44
|
+
}
|
|
45
|
+
export interface ComponentData extends EffectsObjectData {
|
|
46
|
+
item: DataPath;
|
|
47
|
+
}
|
|
48
|
+
export interface ColorData {
|
|
49
|
+
r: number;
|
|
50
|
+
g: number;
|
|
51
|
+
b: number;
|
|
52
|
+
a: number;
|
|
53
|
+
}
|
|
54
|
+
export interface Vector4Data {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
z: number;
|
|
58
|
+
w: number;
|
|
59
|
+
}
|
|
60
|
+
export interface MaterialTextureProperty {
|
|
61
|
+
texture: DataPath;
|
|
62
|
+
offset?: Vector2Data;
|
|
63
|
+
scale?: Vector2Data;
|
|
64
|
+
}
|
|
65
|
+
export interface MaterialData extends EffectsObjectData {
|
|
66
|
+
shader: DataPath;
|
|
67
|
+
blending?: boolean;
|
|
68
|
+
zWrite?: boolean;
|
|
69
|
+
zTest?: boolean;
|
|
70
|
+
stringTags: Record<string, string>;
|
|
71
|
+
macros: string[];
|
|
72
|
+
ints: Record<string, number>;
|
|
73
|
+
floats: Record<string, number>;
|
|
74
|
+
vector4s: Record<string, Vector4Data>;
|
|
75
|
+
colors: Record<string, ColorData>;
|
|
76
|
+
textures: Record<string, MaterialTextureProperty>;
|
|
77
|
+
}
|
|
78
|
+
export interface GeometryData extends EffectsObjectData {
|
|
79
|
+
vertexData: VertexData;
|
|
80
|
+
indexFormat: IndexFormatType;
|
|
81
|
+
indexOffset: number;
|
|
82
|
+
subMeshes: SubMesh[];
|
|
83
|
+
/**
|
|
84
|
+
* 模型绘制模式,默认为 GeometryType.TRIANGLES(三角形)
|
|
85
|
+
* @default GeometryType.TRIANGLES
|
|
86
|
+
*/
|
|
87
|
+
mode: GeometryType;
|
|
88
|
+
/**
|
|
89
|
+
* 存放 position, uv, normal, indices 的打包数据
|
|
90
|
+
*/
|
|
91
|
+
buffer: string;
|
|
92
|
+
/**
|
|
93
|
+
* 所有的骨骼名称
|
|
94
|
+
*/
|
|
95
|
+
boneNames?: string[];
|
|
96
|
+
rootBoneName?: string;
|
|
97
|
+
inverseBindMatrices?: number[];
|
|
98
|
+
}
|
|
99
|
+
export interface SubMesh {
|
|
100
|
+
offset: number;
|
|
101
|
+
indexCount?: number;
|
|
102
|
+
vertexCount: number;
|
|
103
|
+
}
|
|
104
|
+
export declare enum GeometryType {
|
|
105
|
+
/**
|
|
106
|
+
* Draw single points.
|
|
107
|
+
*/
|
|
108
|
+
POINTS = 0,
|
|
109
|
+
/**
|
|
110
|
+
* Draw lines. Each vertex connects to the one after it.
|
|
111
|
+
*/
|
|
112
|
+
LINES = 1,
|
|
113
|
+
/**
|
|
114
|
+
* Draw lines. Each set of two vertices is treated as a separate line segment.
|
|
115
|
+
*/
|
|
116
|
+
LINE_LOOP = 2,
|
|
117
|
+
/**
|
|
118
|
+
* Draw a connected group of line segments from the first vertex to the last.
|
|
119
|
+
*/
|
|
120
|
+
LINE_STRIP = 3,
|
|
121
|
+
/**
|
|
122
|
+
* Draw triangles. Each set of three vertices creates a separate triangle.
|
|
123
|
+
*/
|
|
124
|
+
TRIANGLES = 4,
|
|
125
|
+
/**
|
|
126
|
+
* Draw a connected strip of triangles.
|
|
127
|
+
*/
|
|
128
|
+
TRIANGLE_STRIP = 5,
|
|
129
|
+
/**
|
|
130
|
+
* Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
|
|
131
|
+
*/
|
|
132
|
+
TRIANGLE_FAN = 6
|
|
133
|
+
}
|
|
134
|
+
export interface VertexData {
|
|
135
|
+
vertexCount: number;
|
|
136
|
+
channels: VertexChannel[];
|
|
137
|
+
}
|
|
138
|
+
export declare enum VertexFormatType {
|
|
139
|
+
Float16 = 0,
|
|
140
|
+
Float32 = 1,
|
|
141
|
+
Int8 = 2,
|
|
142
|
+
Int16 = 3,
|
|
143
|
+
Int32 = 4,
|
|
144
|
+
UInt8 = 5,
|
|
145
|
+
UInt16 = 6,
|
|
146
|
+
UInt32 = 7
|
|
147
|
+
}
|
|
148
|
+
export declare enum IndexFormatType {
|
|
149
|
+
None = -1,
|
|
150
|
+
UInt8 = 0,
|
|
151
|
+
UInt16 = 1,
|
|
152
|
+
UInt32 = 2
|
|
153
|
+
}
|
|
154
|
+
export interface VertexChannel {
|
|
155
|
+
semantic: string;
|
|
156
|
+
offset: number;
|
|
157
|
+
format: VertexFormatType;
|
|
158
|
+
dimension: number;
|
|
159
|
+
normalize?: boolean;
|
|
160
|
+
}
|
|
161
|
+
export declare enum VertexBufferSemantic {
|
|
162
|
+
Position = "POSITION",
|
|
163
|
+
Uv = "TEXCOORD0",
|
|
164
|
+
Uv2 = "TEXCOORD1",
|
|
165
|
+
Normal = "NORMAL",
|
|
166
|
+
Tangent = "TANGENT",
|
|
167
|
+
Color = "COLOR",
|
|
168
|
+
Joints = "JOINTS",
|
|
169
|
+
Weights = "WEIGHTS",
|
|
170
|
+
PositionBS0 = "POSITION_BS0",
|
|
171
|
+
PositionBS1 = "POSITION_BS1",
|
|
172
|
+
PositionBS2 = "POSITION_BS2",
|
|
173
|
+
PositionBS3 = "POSITION_BS3",
|
|
174
|
+
PositionBS4 = "POSITION_BS4",
|
|
175
|
+
PositionBS5 = "POSITION_BS5",
|
|
176
|
+
PositionBS6 = "POSITION_BS6",
|
|
177
|
+
PositionBS7 = "POSITION_BS7",
|
|
178
|
+
NormalBS0 = "NORMAL_BS0",
|
|
179
|
+
NormalBS1 = "NORMAL_BS1",
|
|
180
|
+
NormalBS2 = "NORMAL_BS2",
|
|
181
|
+
NormalBS3 = "NORMAL_BS3",
|
|
182
|
+
TangentBS0 = "TANGENT_BS0",
|
|
183
|
+
TangentBS1 = "TANGENT_BS1",
|
|
184
|
+
TangentBS2 = "TANGENT_BS2",
|
|
185
|
+
TangentBS3 = "TANGENT_BS3"
|
|
186
|
+
}
|
|
187
|
+
export interface ShaderData extends EffectsObjectData {
|
|
188
|
+
vertex: string;
|
|
189
|
+
fragment: string;
|
|
190
|
+
properties?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface EffectComponentData extends ComponentData {
|
|
193
|
+
_priority: number;
|
|
194
|
+
materials: DataPath[];
|
|
195
|
+
geometry: DataPath;
|
|
196
|
+
}
|
|
197
|
+
export interface EffectsPackageData {
|
|
198
|
+
fileSummary: FileSummary;
|
|
199
|
+
exportObjects: EffectsObjectData[];
|
|
200
|
+
}
|
|
201
|
+
export interface FileSummary {
|
|
202
|
+
guid: string;
|
|
203
|
+
assetType: string;
|
|
204
|
+
}
|
package/es/components.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export var DataType;
|
|
2
|
+
(function (DataType) {
|
|
3
|
+
DataType["VFXItemData"] = "VFXItemData";
|
|
4
|
+
DataType["EffectComponent"] = "EffectComponent";
|
|
5
|
+
DataType["Material"] = "Material";
|
|
6
|
+
DataType["Shader"] = "Shader";
|
|
7
|
+
DataType["SpriteComponent"] = "SpriteComponent";
|
|
8
|
+
DataType["ParticleSystem"] = "ParticleSystem";
|
|
9
|
+
DataType["InteractComponent"] = "InteractComponent";
|
|
10
|
+
DataType["CameraController"] = "CameraController";
|
|
11
|
+
DataType["Geometry"] = "Geometry";
|
|
12
|
+
DataType["Texture"] = "Texture";
|
|
13
|
+
DataType["AnimationClip"] = "AnimationClip";
|
|
14
|
+
DataType["TextComponent"] = "TextComponent";
|
|
15
|
+
DataType["BinaryAsset"] = "BinaryAsset";
|
|
16
|
+
// Timeline
|
|
17
|
+
DataType["TrackAsset"] = "TrackAsset";
|
|
18
|
+
DataType["TimelineAsset"] = "TimelineAsset";
|
|
19
|
+
DataType["ObjectBindingTrack"] = "ObjectBindingTrack";
|
|
20
|
+
DataType["TransformTrack"] = "TransformTrack";
|
|
21
|
+
DataType["SpriteColorTrack"] = "SpriteColorTrack";
|
|
22
|
+
DataType["ActivationTrack"] = "ActivationTrack";
|
|
23
|
+
DataType["SubCompositionTrack"] = "SubCompositionTrack";
|
|
24
|
+
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
25
|
+
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
26
|
+
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
27
|
+
DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
|
|
28
|
+
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
29
|
+
DataType["MeshComponent"] = "MeshComponent";
|
|
30
|
+
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
31
|
+
DataType["LightComponent"] = "LightComponent";
|
|
32
|
+
DataType["CameraComponent"] = "CameraComponent";
|
|
33
|
+
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
34
|
+
DataType["TreeComponent"] = "TreeComponent";
|
|
35
|
+
DataType["AnimationComponent"] = "AnimationComponent";
|
|
36
|
+
DataType["SpineComponent"] = "SpineComponent";
|
|
37
|
+
// Non-EffectObject
|
|
38
|
+
DataType["TimelineClip"] = "TimelineClip";
|
|
39
|
+
})(DataType || (DataType = {}));
|
|
40
|
+
export var GeometryType;
|
|
41
|
+
(function (GeometryType) {
|
|
42
|
+
/**
|
|
43
|
+
* Draw single points.
|
|
44
|
+
*/
|
|
45
|
+
GeometryType[GeometryType["POINTS"] = 0] = "POINTS";
|
|
46
|
+
/**
|
|
47
|
+
* Draw lines. Each vertex connects to the one after it.
|
|
48
|
+
*/
|
|
49
|
+
GeometryType[GeometryType["LINES"] = 1] = "LINES";
|
|
50
|
+
/**
|
|
51
|
+
* Draw lines. Each set of two vertices is treated as a separate line segment.
|
|
52
|
+
*/
|
|
53
|
+
GeometryType[GeometryType["LINE_LOOP"] = 2] = "LINE_LOOP";
|
|
54
|
+
/**
|
|
55
|
+
* Draw a connected group of line segments from the first vertex to the last.
|
|
56
|
+
*/
|
|
57
|
+
GeometryType[GeometryType["LINE_STRIP"] = 3] = "LINE_STRIP";
|
|
58
|
+
/**
|
|
59
|
+
* Draw triangles. Each set of three vertices creates a separate triangle.
|
|
60
|
+
*/
|
|
61
|
+
GeometryType[GeometryType["TRIANGLES"] = 4] = "TRIANGLES";
|
|
62
|
+
/**
|
|
63
|
+
* Draw a connected strip of triangles.
|
|
64
|
+
*/
|
|
65
|
+
GeometryType[GeometryType["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP";
|
|
66
|
+
/**
|
|
67
|
+
* Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
|
|
68
|
+
*/
|
|
69
|
+
GeometryType[GeometryType["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN";
|
|
70
|
+
})(GeometryType || (GeometryType = {}));
|
|
71
|
+
export var VertexFormatType;
|
|
72
|
+
(function (VertexFormatType) {
|
|
73
|
+
VertexFormatType[VertexFormatType["Float16"] = 0] = "Float16";
|
|
74
|
+
VertexFormatType[VertexFormatType["Float32"] = 1] = "Float32";
|
|
75
|
+
VertexFormatType[VertexFormatType["Int8"] = 2] = "Int8";
|
|
76
|
+
VertexFormatType[VertexFormatType["Int16"] = 3] = "Int16";
|
|
77
|
+
VertexFormatType[VertexFormatType["Int32"] = 4] = "Int32";
|
|
78
|
+
VertexFormatType[VertexFormatType["UInt8"] = 5] = "UInt8";
|
|
79
|
+
VertexFormatType[VertexFormatType["UInt16"] = 6] = "UInt16";
|
|
80
|
+
VertexFormatType[VertexFormatType["UInt32"] = 7] = "UInt32";
|
|
81
|
+
})(VertexFormatType || (VertexFormatType = {}));
|
|
82
|
+
export var IndexFormatType;
|
|
83
|
+
(function (IndexFormatType) {
|
|
84
|
+
IndexFormatType[IndexFormatType["None"] = -1] = "None";
|
|
85
|
+
IndexFormatType[IndexFormatType["UInt8"] = 0] = "UInt8";
|
|
86
|
+
IndexFormatType[IndexFormatType["UInt16"] = 1] = "UInt16";
|
|
87
|
+
IndexFormatType[IndexFormatType["UInt32"] = 2] = "UInt32";
|
|
88
|
+
})(IndexFormatType || (IndexFormatType = {}));
|
|
89
|
+
// BINORMAL[n] Binormal float4
|
|
90
|
+
// BLENDINDICES[n] 混合索引 uint
|
|
91
|
+
// BLENDWEIGHT[n] 混合权重 FLOAT
|
|
92
|
+
// COLOR[n] 漫射和反射颜色 float4
|
|
93
|
+
// NORMAL[n] 法向矢量 float4
|
|
94
|
+
// POSITION[n] 对象空间中的顶点位置。 float4
|
|
95
|
+
// POSITIONT 变换的顶点位置。 float4
|
|
96
|
+
// PSIZE[n] 点大小 FLOAT
|
|
97
|
+
// TANGENT[n] 正切 float4
|
|
98
|
+
// TEXCOORD[n] 纹理坐标 float4
|
|
99
|
+
// POSITION_BS[n] Blend Shape 空间中的顶点位置 float4
|
|
100
|
+
// NORMAL_BS[n] Blend Shape 空间中的法向矢量 float4
|
|
101
|
+
// TANGENT_BS[n] Blend Shape 空间中的正切矢量 float4
|
|
102
|
+
export var VertexBufferSemantic;
|
|
103
|
+
(function (VertexBufferSemantic) {
|
|
104
|
+
VertexBufferSemantic["Position"] = "POSITION";
|
|
105
|
+
VertexBufferSemantic["Uv"] = "TEXCOORD0";
|
|
106
|
+
VertexBufferSemantic["Uv2"] = "TEXCOORD1";
|
|
107
|
+
VertexBufferSemantic["Normal"] = "NORMAL";
|
|
108
|
+
VertexBufferSemantic["Tangent"] = "TANGENT";
|
|
109
|
+
VertexBufferSemantic["Color"] = "COLOR";
|
|
110
|
+
VertexBufferSemantic["Joints"] = "JOINTS";
|
|
111
|
+
VertexBufferSemantic["Weights"] = "WEIGHTS";
|
|
112
|
+
//
|
|
113
|
+
VertexBufferSemantic["PositionBS0"] = "POSITION_BS0";
|
|
114
|
+
VertexBufferSemantic["PositionBS1"] = "POSITION_BS1";
|
|
115
|
+
VertexBufferSemantic["PositionBS2"] = "POSITION_BS2";
|
|
116
|
+
VertexBufferSemantic["PositionBS3"] = "POSITION_BS3";
|
|
117
|
+
VertexBufferSemantic["PositionBS4"] = "POSITION_BS4";
|
|
118
|
+
VertexBufferSemantic["PositionBS5"] = "POSITION_BS5";
|
|
119
|
+
VertexBufferSemantic["PositionBS6"] = "POSITION_BS6";
|
|
120
|
+
VertexBufferSemantic["PositionBS7"] = "POSITION_BS7";
|
|
121
|
+
VertexBufferSemantic["NormalBS0"] = "NORMAL_BS0";
|
|
122
|
+
VertexBufferSemantic["NormalBS1"] = "NORMAL_BS1";
|
|
123
|
+
VertexBufferSemantic["NormalBS2"] = "NORMAL_BS2";
|
|
124
|
+
VertexBufferSemantic["NormalBS3"] = "NORMAL_BS3";
|
|
125
|
+
VertexBufferSemantic["TangentBS0"] = "TANGENT_BS0";
|
|
126
|
+
VertexBufferSemantic["TangentBS1"] = "TANGENT_BS1";
|
|
127
|
+
VertexBufferSemantic["TangentBS2"] = "TANGENT_BS2";
|
|
128
|
+
VertexBufferSemantic["TangentBS3"] = "TANGENT_BS3";
|
|
129
|
+
})(VertexBufferSemantic || (VertexBufferSemantic = {}));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Item } from './item';
|
|
2
1
|
import type { DataPath } from './components';
|
|
2
|
+
import type { Item } from './item';
|
|
3
3
|
export declare enum CameraClipMode {
|
|
4
4
|
/**
|
|
5
5
|
* 剪裁上下
|
|
6
6
|
*/
|
|
7
|
-
portrait,
|
|
7
|
+
portrait = 1,
|
|
8
8
|
/**
|
|
9
9
|
* 剪裁左右
|
|
10
10
|
*/
|
|
11
|
-
landscape
|
|
11
|
+
landscape = 0
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* 相机属性
|
|
@@ -48,32 +48,29 @@ export declare enum CompositionEndBehavior {
|
|
|
48
48
|
/**
|
|
49
49
|
* 销毁
|
|
50
50
|
*/
|
|
51
|
-
destroy,
|
|
51
|
+
destroy = 0,
|
|
52
52
|
/**
|
|
53
53
|
* 暂停
|
|
54
54
|
*/
|
|
55
|
-
pause,
|
|
55
|
+
pause = 1,
|
|
56
56
|
/**
|
|
57
57
|
* 重播
|
|
58
58
|
*/
|
|
59
|
-
restart,
|
|
59
|
+
restart = 5,
|
|
60
60
|
/**
|
|
61
61
|
* 无限播放
|
|
62
62
|
*/
|
|
63
|
-
forward,
|
|
63
|
+
forward = 2,
|
|
64
64
|
/**
|
|
65
65
|
* 销毁并保留最后一帧
|
|
66
66
|
*/
|
|
67
|
-
pause_destroy,
|
|
67
|
+
pause_destroy = 3,
|
|
68
68
|
/**
|
|
69
69
|
* 冻结
|
|
70
70
|
*/
|
|
71
|
-
freeze
|
|
71
|
+
freeze = 4
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
* 合成信息
|
|
75
|
-
*/
|
|
76
|
-
export interface Composition {
|
|
73
|
+
interface CompositionBase {
|
|
77
74
|
/**
|
|
78
75
|
* 合成ID
|
|
79
76
|
*/
|
|
@@ -99,10 +96,6 @@ export interface Composition {
|
|
|
99
96
|
* 合成相机信息
|
|
100
97
|
*/
|
|
101
98
|
camera: CameraOptions;
|
|
102
|
-
/**
|
|
103
|
-
* 元素信息
|
|
104
|
-
*/
|
|
105
|
-
items: Item[];
|
|
106
99
|
/**
|
|
107
100
|
* 合成视窗预览大小
|
|
108
101
|
* 如果没有提供,默认为 player 的 container 大小
|
|
@@ -115,46 +108,39 @@ export interface Composition {
|
|
|
115
108
|
fallbackImage?: string;
|
|
116
109
|
}
|
|
117
110
|
/**
|
|
118
|
-
*
|
|
111
|
+
* 合成信息
|
|
119
112
|
*/
|
|
120
|
-
export interface
|
|
121
|
-
/**
|
|
122
|
-
* 合成ID
|
|
123
|
-
*/
|
|
124
|
-
id: string;
|
|
125
|
-
/**
|
|
126
|
-
* 合成名称
|
|
127
|
-
*/
|
|
128
|
-
name: string;
|
|
129
|
-
/**
|
|
130
|
-
* 合成持续时间
|
|
131
|
-
*/
|
|
132
|
-
duration: number;
|
|
113
|
+
export interface Composition extends CompositionBase {
|
|
133
114
|
/**
|
|
134
|
-
*
|
|
135
|
-
* @default 0
|
|
115
|
+
* 元素信息
|
|
136
116
|
*/
|
|
137
|
-
|
|
117
|
+
items: Item[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* 合成数据
|
|
121
|
+
*/
|
|
122
|
+
export interface CompositionData extends CompositionBase {
|
|
138
123
|
/**
|
|
139
|
-
*
|
|
124
|
+
* 元素信息
|
|
140
125
|
*/
|
|
141
|
-
|
|
126
|
+
items: DataPath[];
|
|
142
127
|
/**
|
|
143
|
-
*
|
|
128
|
+
* 时间轴资产(TimelineAssetData)
|
|
144
129
|
*/
|
|
145
|
-
|
|
130
|
+
timelineAsset: DataPath;
|
|
146
131
|
/**
|
|
147
|
-
*
|
|
132
|
+
* 轨道的场景绑定
|
|
148
133
|
*/
|
|
149
|
-
|
|
134
|
+
sceneBindings: SceneBindingData[];
|
|
135
|
+
}
|
|
136
|
+
export interface SceneBindingData {
|
|
150
137
|
/**
|
|
151
|
-
*
|
|
152
|
-
* 如果没有提供,默认为 player 的 container 大小
|
|
153
|
-
* @default [0,0]
|
|
138
|
+
* 绑定的轨道资产(TrackAssetData)
|
|
154
139
|
*/
|
|
155
|
-
|
|
140
|
+
key: DataPath;
|
|
156
141
|
/**
|
|
157
|
-
*
|
|
142
|
+
* 被绑定的场景对象(VFXItemData)
|
|
158
143
|
*/
|
|
159
|
-
|
|
144
|
+
value: DataPath;
|
|
160
145
|
}
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CAMERA_CLIP_MODE_NORMAL, CAMERA_CLIP_MODE_VERTICAL, END_BEHAVIOR_DESTROY, END_BEHAVIOR_FORWARD, END_BEHAVIOR_FREEZE, END_BEHAVIOR_PAUSE, END_BEHAVIOR_PAUSE_AND_DESTROY, END_BEHAVIOR_RESTART, } from './constants';
|
|
2
|
+
export var CameraClipMode;
|
|
3
|
+
(function (CameraClipMode) {
|
|
4
|
+
/**
|
|
5
|
+
* 剪裁上下
|
|
6
|
+
*/
|
|
7
|
+
CameraClipMode[CameraClipMode["portrait"] = 1] = "portrait";
|
|
8
|
+
/**
|
|
9
|
+
* 剪裁左右
|
|
10
|
+
*/
|
|
11
|
+
CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
12
|
+
})(CameraClipMode || (CameraClipMode = {}));
|
|
13
|
+
/**
|
|
14
|
+
* 结束行为
|
|
15
|
+
*/
|
|
16
|
+
export var CompositionEndBehavior;
|
|
17
|
+
(function (CompositionEndBehavior) {
|
|
18
|
+
/**
|
|
19
|
+
* 销毁
|
|
20
|
+
*/
|
|
21
|
+
CompositionEndBehavior[CompositionEndBehavior["destroy"] = 0] = "destroy";
|
|
22
|
+
/**
|
|
23
|
+
* 暂停
|
|
24
|
+
*/
|
|
25
|
+
CompositionEndBehavior[CompositionEndBehavior["pause"] = 1] = "pause";
|
|
26
|
+
/**
|
|
27
|
+
* 重播
|
|
28
|
+
*/
|
|
29
|
+
CompositionEndBehavior[CompositionEndBehavior["restart"] = 5] = "restart";
|
|
30
|
+
/**
|
|
31
|
+
* 无限播放
|
|
32
|
+
*/
|
|
33
|
+
CompositionEndBehavior[CompositionEndBehavior["forward"] = 2] = "forward";
|
|
34
|
+
/**
|
|
35
|
+
* 销毁并保留最后一帧
|
|
36
|
+
*/
|
|
37
|
+
CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = 3] = "pause_destroy";
|
|
38
|
+
/**
|
|
39
|
+
* 冻结
|
|
40
|
+
*/
|
|
41
|
+
CompositionEndBehavior[CompositionEndBehavior["freeze"] = 4] = "freeze";
|
|
42
|
+
})(CompositionEndBehavior || (CompositionEndBehavior = {}));
|
package/es/constants.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const END_BEHAVIOR_DESTROY = 0;
|
|
2
|
+
export const END_BEHAVIOR_PAUSE = 1;
|
|
3
|
+
export const END_BEHAVIOR_FORWARD = 2;
|
|
4
|
+
export const END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
|
|
5
|
+
export const END_BEHAVIOR_FREEZE = 4;
|
|
6
|
+
export const END_BEHAVIOR_RESTART = 5;
|
|
7
|
+
export const END_BEHAVIOR_DESTROY_CHILDREN = 6;
|
|
8
|
+
export const CAMERA_CLIP_MODE_VERTICAL = 1;
|
|
9
|
+
export const CAMERA_CLIP_MODE_NORMAL = 0;
|
|
10
|
+
export const MESSAGE_ITEM_PHRASE_BEGIN = 2;
|
|
11
|
+
export const MESSAGE_ITEM_PHRASE_END = 1;
|