soonspacejs 2.6.10 → 2.6.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soonspacejs",
3
- "version": "2.6.10",
3
+ "version": "2.6.11",
4
4
  "homepage": "http://www.xwbuilders.com:8800/",
5
5
  "description": "soonspacejs 2.x",
6
6
  "module": "./dist/index.esm.js",
@@ -28,5 +28,5 @@
28
28
  "peerDependencies": {
29
29
  "three": ">=0.150.1"
30
30
  },
31
- "gitHead": "7ea34202f269224509f8da784a857c8b91011e6a"
31
+ "gitHead": "405584a5f5ee9a5062d4ddbad58b2b91511dbe72"
32
32
  }
@@ -1,8 +1,10 @@
1
1
  import { CreateCurveAnimationClipOptions, BonePathAnimationOptions, AnimationOperate, BonePathAnimationInfo as CreateBonePathAnimationResult } from '@three3d/animation';
2
- import type { AnimationMixer, Camera, Curve, Object3D } from 'three';
2
+ import type { Camera, Curve, Object3D } from 'three';
3
3
  import { Vector3 } from 'three';
4
4
  import type { IVector3 } from '../Interface';
5
5
  import { Topology } from '../Library';
6
+ import { VectorMembersToIVectors } from '@three3d/tools';
7
+ import type { SoonSpace } from '../index';
6
8
  /**
7
9
  * 动画的路径
8
10
  */
@@ -16,8 +18,8 @@ export declare function formatAnimationPath(path: AnimationPath): {
16
18
  curve?: Curve<Vector3> | undefined;
17
19
  points?: Vector3[] | undefined;
18
20
  };
19
- export type CreatePathAnimationOptions = Omit<CreateCurveAnimationClipOptions, 'target' | 'curve' | 'points'>;
20
- export declare function createPathAnimation(target: Object3D, path: AnimationPath, mixer: AnimationMixer, options?: CreatePathAnimationOptions): AnimationOperate;
21
+ export type CreatePathAnimationOptions = VectorMembersToIVectors<Omit<CreateCurveAnimationClipOptions, 'target' | 'curve' | 'points'>>;
22
+ export declare function createPathAnimation(target: Object3D, path: AnimationPath, ssp: SoonSpace, options?: CreatePathAnimationOptions): AnimationOperate | undefined;
21
23
  export interface CreatePathAnimationActionForCameraOptions_Base {
22
24
  /**
23
25
  * 眼睛高度
@@ -25,8 +27,8 @@ export interface CreatePathAnimationActionForCameraOptions_Base {
25
27
  eyeHeight?: number;
26
28
  }
27
29
  export type CreatePathAnimationActionForCameraOptions = CreatePathAnimationActionForCameraOptions_Base & CreatePathAnimationOptions;
28
- export declare function createPathAnimationActionForCamera(camera: Camera, path: IVector3[] | Curve<Vector3> | Topology, mixer: AnimationMixer, options?: CreatePathAnimationActionForCameraOptions): AnimationOperate;
29
- export type CreateBonePathAnimationOptions = Omit<BonePathAnimationOptions, 'mixer' | 'model'>;
30
+ export declare function createPathAnimationActionForCamera(camera: Camera, path: IVector3[] | Curve<Vector3> | Topology, ssp: SoonSpace, options?: CreatePathAnimationActionForCameraOptions): AnimationOperate | undefined;
31
+ export type CreateBonePathAnimationOptions = VectorMembersToIVectors<Omit<BonePathAnimationOptions, 'mixer' | 'model'>>;
30
32
  export type BonePathAnimationInfo = Omit<CreateBonePathAnimationResult, 'action'> & {
31
33
  action: AnimationOperate;
32
34
  };
@@ -35,4 +37,4 @@ export type BonePathAnimationInfo = Omit<CreateBonePathAnimationResult, 'action'
35
37
  * @param options
36
38
  * @returns
37
39
  */
38
- export declare function createBonePathAnimation(model: Object3D, path: AnimationPath, mixer: AnimationMixer, options: CreateBonePathAnimationOptions): BonePathAnimationInfo;
40
+ export declare function createBonePathAnimation(model: Object3D, path: AnimationPath, ssp: SoonSpace, options: CreateBonePathAnimationOptions): BonePathAnimationInfo;
@@ -90,6 +90,10 @@ interface ViewportOptions {
90
90
  }
91
91
  interface ViewportState {
92
92
  useFreq: number;
93
+ /**
94
+ * 是否启用后处理
95
+ */
96
+ enabledPostprocessing: boolean;
93
97
  /**
94
98
  * 是否暂停 render
95
99
  */
@@ -1,5 +1,5 @@
1
1
  /// <reference types="stats.js" />
2
- import { Mesh, Clock, Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, Vector3, AnimationMixer, Raycaster, Intersection, Object3D, AnimationAction, AnimationClip, Texture } from 'three';
2
+ import { Mesh, Clock, Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, Vector3, AnimationMixer, Raycaster, Intersection, Object3D, AnimationClip, Texture } from 'three';
3
3
  import { EffectComposer } from 'postprocessing';
4
4
  import Stats from 'three/examples/jsm/libs/stats.module.js';
5
5
  import { Sky } from 'three/examples/jsm/objects/Sky.js';
@@ -16,6 +16,7 @@ import { License } from '../License';
16
16
  import Info from './Info';
17
17
  import { ViewHelper } from './ViewHelper';
18
18
  import { WaterMark } from './WaterMark';
19
+ import { AnimationOperate } from '@three3d/animation';
19
20
  export declare const innerRenderState: {
20
21
  needsUpdate: boolean;
21
22
  };
@@ -91,7 +92,7 @@ declare class Viewport {
91
92
  /**
92
93
  ***************************** modelAnimation ***************************
93
94
  */
94
- playModelAnimation(model: Model, animation: number | AnimationClip | ModelAnimationFindFunc): AnimationAction | undefined;
95
+ playModelAnimation(model: Model, animation: number | AnimationClip | ModelAnimationFindFunc): AnimationOperate | undefined;
95
96
  stopModelAnimation(model: Model, animation: number | AnimationClip | ModelAnimationFindFunc): void;
96
97
  /**
97
98
  ***************************** render ***************************
package/types/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  |_| |__/
8
8
  */
9
9
  import * as THREE from 'three';
10
- import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light, Texture, Mesh } from 'three';
10
+ import { Object3D, Vector3, Euler, Box3, AnimationClip, Light, Texture, Mesh } from 'three';
11
11
  import type { Camera } from 'three';
12
12
  import * as shared from './Shared';
13
13
  import Animation from './Animation';
@@ -31,6 +31,8 @@ export interface SoonSpaceConstructor {
31
31
  export * from 'three';
32
32
  export * from './Interface';
33
33
  export * from './tools';
34
+ import type { AnimationOperate } from '@three3d/animation';
35
+ export * from '@three3d/animation';
34
36
  export declare class SoonSpace {
35
37
  static readonly THREE: typeof THREE;
36
38
  readonly THREE: typeof THREE;
@@ -328,7 +330,7 @@ export declare class SoonSpace {
328
330
  * @param model
329
331
  * @param animation
330
332
  */
331
- playModelAnimation(model: Model, animation: number | AnimationClip | ModelAnimationFindFunc): AnimationAction | undefined;
333
+ playModelAnimation(model: Model, animation: number | AnimationClip | ModelAnimationFindFunc): AnimationOperate | undefined;
332
334
  /**
333
335
  * 停止播放模型动画
334
336
  * @param model
@@ -1312,7 +1314,7 @@ export declare class SoonSpace {
1312
1314
  * @param options
1313
1315
  * @returns 返回 AnimationOperate,它是对 AnimationAction 的扩展
1314
1316
  */
1315
- createPathAnimationAction(target: Object3D, path: AnimationPath, options: CreatePathAnimationOptions): import("@three3d/animation").AnimationOperate;
1317
+ createPathAnimationAction(target: Object3D, path: AnimationPath, options: CreatePathAnimationOptions): AnimationOperate | undefined;
1316
1318
  /**
1317
1319
  * 创建相机动画
1318
1320
  * @param path
@@ -1322,7 +1324,7 @@ export declare class SoonSpace {
1322
1324
  */
1323
1325
  createPathAnimationActionForCamera(path: AnimationPath, options?: CreatePathAnimationActionForCameraOptions & {
1324
1326
  camera?: Camera;
1325
- }): import("@three3d/animation").AnimationOperate;
1327
+ }): AnimationOperate | undefined;
1326
1328
  /**
1327
1329
  * 创建骨骼路径动画
1328
1330
  * @param options