@galacean/effects-threejs 2.0.0-alpha.8 → 2.0.0-beta.0
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 +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18143 -15093
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -7
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +18104 -15069
- package/dist/index.mjs.map +1 -1
- package/dist/material/three-material.d.ts +4 -1
- package/dist/three-composition.d.ts +2 -23
- package/dist/three-display-object.d.ts +5 -4
- package/dist/three-geometry.d.ts +7 -1
- package/dist/three-text-component.d.ts +19 -0
- package/dist/three-texture.d.ts +5 -0
- package/package.json +4 -4
|
@@ -7,6 +7,7 @@ type Vector3 = math.Vector3;
|
|
|
7
7
|
type Vector4 = math.Vector4;
|
|
8
8
|
type Matrix3 = math.Matrix3;
|
|
9
9
|
type Quaternion = math.Quaternion;
|
|
10
|
+
type Color = math.Color;
|
|
10
11
|
/**
|
|
11
12
|
* THREE 抽象材质类
|
|
12
13
|
*/
|
|
@@ -149,6 +150,8 @@ export declare class ThreeMaterial extends Material {
|
|
|
149
150
|
setVector3(name: string, value: Vector3): void;
|
|
150
151
|
getVector4(name: string): Vector4 | null;
|
|
151
152
|
setVector4(name: string, value: Vector4): void;
|
|
153
|
+
getColor(name: string): Color | null;
|
|
154
|
+
setColor(name: string, value: Color): void;
|
|
152
155
|
getQuaternion(name: string): Quaternion | null;
|
|
153
156
|
setQuaternion(name: string, value: Quaternion): void;
|
|
154
157
|
getFloat(name: string): number | null;
|
|
@@ -164,7 +167,7 @@ export declare class ThreeMaterial extends Material {
|
|
|
164
167
|
isMacroEnabled(keyword: string): boolean;
|
|
165
168
|
clone(props?: MaterialProps): Material;
|
|
166
169
|
cloneUniforms(sourceMaterial: Material): void;
|
|
167
|
-
fromData(data:
|
|
170
|
+
fromData(data: unknown): void;
|
|
168
171
|
dispose(destroyOptions?: MaterialDestroyOptions): void;
|
|
169
172
|
}
|
|
170
173
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Scene, ShaderLibrary, Transform, MeshRendererOptions, EventSystem,
|
|
1
|
+
import type { Scene, ShaderLibrary, Transform, MeshRendererOptions, EventSystem, CompositionProps } from '@galacean/effects-core';
|
|
2
2
|
import { Composition } from '@galacean/effects-core';
|
|
3
3
|
import type THREE from 'three';
|
|
4
4
|
/**
|
|
@@ -28,27 +28,6 @@ export interface CompositionBaseProps {
|
|
|
28
28
|
* Shader 库
|
|
29
29
|
*/
|
|
30
30
|
shaderLibrary?: ShaderLibrary;
|
|
31
|
-
/**
|
|
32
|
-
* end 状态监听函数
|
|
33
|
-
*
|
|
34
|
-
* @param composition - composition 对象
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
onEnd?: (composition: Composition) => void;
|
|
38
|
-
/**
|
|
39
|
-
* 交互元素监听函数
|
|
40
|
-
*
|
|
41
|
-
* @param item
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
onMessageItem?: (item: MessageItem) => void;
|
|
45
|
-
/**
|
|
46
|
-
* player 暂停监听函授
|
|
47
|
-
*
|
|
48
|
-
* @param item
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
onPlayerPause?: (item: VFXItem<VFXItemContent>) => void;
|
|
52
31
|
}
|
|
53
32
|
export interface ThreeCompositionProps extends CompositionProps {
|
|
54
33
|
/**
|
|
@@ -68,7 +47,7 @@ export declare class ThreeComposition extends Composition {
|
|
|
68
47
|
* 发射器形状缓存 map
|
|
69
48
|
*/
|
|
70
49
|
static shape: Record<string, number>;
|
|
71
|
-
constructor(props: ThreeCompositionProps, scene: Scene
|
|
50
|
+
constructor(props: ThreeCompositionProps, scene: Scene);
|
|
72
51
|
/**
|
|
73
52
|
* 更新 video texture 数据
|
|
74
53
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EventSystem, SceneLoadOptions, Renderer, Composition, SceneLoadType
|
|
1
|
+
import type { EventSystem, SceneLoadOptions, Renderer, Composition, SceneLoadType } from '@galacean/effects-core';
|
|
2
2
|
import { AssetManager } from '@galacean/effects-core';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { ThreeComposition } from './three-composition';
|
|
@@ -25,11 +25,11 @@ export declare class ThreeDisplayObject extends THREE.Group {
|
|
|
25
25
|
compositions: ThreeComposition[];
|
|
26
26
|
camera?: THREE.Camera;
|
|
27
27
|
renderer: Renderer;
|
|
28
|
+
assetManager: AssetManager;
|
|
29
|
+
env: string;
|
|
28
30
|
readonly width: number;
|
|
29
31
|
readonly height: number;
|
|
30
|
-
assetManager: AssetManager;
|
|
31
32
|
private baseCompositionIndex;
|
|
32
|
-
env: string;
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
35
|
* @param context
|
|
@@ -47,6 +47,8 @@ export declare class ThreeDisplayObject extends THREE.Group {
|
|
|
47
47
|
*/
|
|
48
48
|
loadScene(scene: SceneLoadType, options?: SceneLoadOptions): Promise<Composition>;
|
|
49
49
|
loadScene(scene: SceneLoadType[], options?: SceneLoadOptions): Promise<Composition[]>;
|
|
50
|
+
pause(): void;
|
|
51
|
+
resume(): void;
|
|
50
52
|
private createComposition;
|
|
51
53
|
/**
|
|
52
54
|
*
|
|
@@ -54,4 +56,3 @@ export declare class ThreeDisplayObject extends THREE.Group {
|
|
|
54
56
|
*/
|
|
55
57
|
update(delta: number): void;
|
|
56
58
|
}
|
|
57
|
-
export declare function isSceneWithOptions(scene: any): scene is SceneWithOptionsType;
|
package/dist/three-geometry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Engine, GeometryProps, spec } from '@galacean/effects-core';
|
|
1
|
+
import type { Engine, GeometryProps, SkinProps, spec } from '@galacean/effects-core';
|
|
2
2
|
import { Geometry } from '@galacean/effects-core';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
/**
|
|
@@ -139,6 +139,12 @@ export declare class ThreeGeometry extends Geometry {
|
|
|
139
139
|
* @returns 返回绘制数量
|
|
140
140
|
*/
|
|
141
141
|
getDrawCount(): number;
|
|
142
|
+
/**
|
|
143
|
+
* 获取蒙皮数据
|
|
144
|
+
*
|
|
145
|
+
* @returns 返回蒙皮数据
|
|
146
|
+
*/
|
|
147
|
+
getSkinProps(): SkinProps;
|
|
142
148
|
/**
|
|
143
149
|
* 销毁方法
|
|
144
150
|
*
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Engine, SpriteItemProps } from '@galacean/effects-core';
|
|
2
|
+
import { spec, TextComponentBase } from '@galacean/effects-core';
|
|
3
|
+
import { ThreeSpriteComponent } from './three-sprite-component';
|
|
4
|
+
export interface ThreeTextComponent extends TextComponentBase {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare class ThreeTextComponent extends ThreeSpriteComponent {
|
|
11
|
+
isDirty: boolean;
|
|
12
|
+
canvas: HTMLCanvasElement;
|
|
13
|
+
context: CanvasRenderingContext2D | null;
|
|
14
|
+
constructor(engine: Engine, props?: spec.TextContent);
|
|
15
|
+
update(dt: number): void;
|
|
16
|
+
fromData(data: SpriteItemProps): void;
|
|
17
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
18
|
+
updateTexture(flipY?: boolean): void;
|
|
19
|
+
}
|
package/dist/three-texture.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-threejs",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Galacean Effects runtime threejs plugin for the web",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
|
-
"
|
|
7
|
+
"browser": "./dist/index.min.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"registry": "https://registry.npmjs.org"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@galacean/effects-core": "2.0.0-
|
|
46
|
+
"@galacean/effects-core": "2.0.0-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"three": "^0.149.0",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"build": "pnpm build:declaration && pnpm build:module",
|
|
55
55
|
"build:module": "rollup -c",
|
|
56
56
|
"build:declaration": "tsc -d --emitDeclarationOnly",
|
|
57
|
-
"clean": "rimraf dist && rimraf
|
|
57
|
+
"clean": "rimraf dist && rimraf \"*+(.tsbuildinfo)\""
|
|
58
58
|
}
|
|
59
59
|
}
|