viral-viewer-2 6.4.4 → 6.4.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.
@@ -4,5 +4,5 @@ export declare class ViralAvatarManager {
4
4
  private viralViewerApi;
5
5
  avatars: ViralAvatar[];
6
6
  constructor(viralViewerApi: ViralViewerApi);
7
- load(avatarGLBUrl: string, idleUrl: string, walkUrl: string): ViralAvatar;
7
+ load(avatarGLBUrl: string, idleUrl: string, walkUrl: string, id?: string): ViralAvatar;
8
8
  }
@@ -9,7 +9,7 @@ export declare class ViralAvatar {
9
9
  private destination;
10
10
  isReady: boolean;
11
11
  id: string;
12
- constructor(viralViewerApi: ViralViewerApi, avatarGLBUrl: string, idleUrl: string, walkUrl: string);
12
+ constructor(viralViewerApi: ViralViewerApi, avatarGLBUrl: string, idleUrl: string, walkUrl: string, id?: string);
13
13
  idle(): void;
14
14
  walk(): void;
15
15
  render(delta: number): void;
package/dist/index.mjs CHANGED
@@ -42463,20 +42463,20 @@ class t3 {
42463
42463
  }
42464
42464
  const i3 = 0.064;
42465
42465
  class n3 {
42466
- constructor(e, t, i, s) {
42467
- this.viralViewerApi = e, this.mixer = null, this.idleAnimation = null, this.walkAnimation = null, this.avatar = null, this.destination = null, this.isReady = !1, this.id = t3.generateRandomString(10), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42466
+ constructor(e, t, i, s, r) {
42467
+ this.viralViewerApi = e, this.mixer = null, this.idleAnimation = null, this.walkAnimation = null, this.avatar = null, this.destination = null, this.isReady = !1, this.id = t3.generateRandomString(10), r && (this.id = r), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42468
42468
  t,
42469
- (r) => {
42470
- this.avatar = r.scene;
42471
- let a = new G(2, 2, 2);
42472
- this.avatar.scale.copy(a), this.mixer = new R2(r.scene), this.viralViewerApi.viralScene.scene.add(r.scene), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42469
+ (a) => {
42470
+ this.avatar = a.scene;
42471
+ let l = new G(2, 2, 2);
42472
+ this.avatar.scale.copy(l), this.mixer = new R2(a.scene), this.viralViewerApi.viralScene.scene.add(a.scene), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42473
42473
  i,
42474
- (l) => {
42475
- this.idleAnimation = this.mixer.clipAction(l.animations[0]), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42474
+ (h) => {
42475
+ this.idleAnimation = this.mixer.clipAction(h.animations[0]), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42476
42476
  s,
42477
- (h) => {
42477
+ (u) => {
42478
42478
  this.walkAnimation = this.mixer.clipAction(
42479
- h.animations[0]
42479
+ u.animations[0]
42480
42480
  ), Sn.information("load avatar succeed!"), this.isReady = !0, this.idle();
42481
42481
  }
42482
42482
  );
@@ -42509,14 +42509,15 @@ class s3 {
42509
42509
  constructor(e) {
42510
42510
  this.viralViewerApi = e, this.avatars = [];
42511
42511
  }
42512
- load(e, t, i) {
42513
- let s = new n3(
42512
+ load(e, t, i, s) {
42513
+ let r = new n3(
42514
42514
  this.viralViewerApi,
42515
42515
  e,
42516
42516
  t,
42517
- i
42517
+ i,
42518
+ s
42518
42519
  );
42519
- return this.avatars.push(s), s;
42520
+ return this.avatars.push(r), r;
42520
42521
  }
42521
42522
  }
42522
42523
  class v3 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viral-viewer-2",
3
- "version": "6.4.4",
3
+ "version": "6.4.5",
4
4
  "description": "",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",