minerender 2.1.0-alpha.26 → 2.1.0-alpha.27

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.
@@ -5460,7 +5460,41 @@ var baseSkinCoordinates = {
5460
5460
  var classicSkinTextureCoordinates = {
5461
5461
  ...baseSkinCoordinates
5462
5462
  };
5463
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
5463
+ var slimSkinTextureCoordinates = {
5464
+ ...baseSkinCoordinates,
5465
+ leftArm: {
5466
+ ...baseSkinCoordinates.leftArm,
5467
+ west: { uv: [39, 52, 43, 64] },
5468
+ north: { uv: [36, 52, 39, 64] },
5469
+ south: { uv: [43, 52, 46, 64] },
5470
+ up: { uv: [39, 52, 36, 48] },
5471
+ down: { uv: [42, 48, 39, 52] }
5472
+ },
5473
+ rightArm: {
5474
+ ...baseSkinCoordinates.rightArm,
5475
+ west: { uv: [47, 20, 51, 32] },
5476
+ north: { uv: [44, 20, 47, 32] },
5477
+ south: { uv: [51, 20, 54, 32] },
5478
+ up: { uv: [47, 20, 44, 16] },
5479
+ down: { uv: [50, 16, 47, 20] }
5480
+ },
5481
+ leftSleeve: {
5482
+ ...baseSkinCoordinates.leftSleeve,
5483
+ west: { uv: [55, 52, 59, 64] },
5484
+ north: { uv: [52, 52, 55, 64] },
5485
+ south: { uv: [59, 52, 62, 64] },
5486
+ up: { uv: [55, 52, 52, 48] },
5487
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
5488
+ },
5489
+ rightSleeve: {
5490
+ ...baseSkinCoordinates.rightSleeve,
5491
+ west: { uv: [47, 36, 51, 48] },
5492
+ north: { uv: [44, 36, 47, 48] },
5493
+ south: { uv: [51, 36, 54, 48] },
5494
+ up: { uv: [47, 36, 44, 32] },
5495
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
5496
+ }
5497
+ };
5464
5498
 
5465
5499
  // src/skin/SkinGeometries.ts
5466
5500
  var box8inner = [8, 8, 8];
@@ -5570,7 +5604,6 @@ var SkinObject = class extends SceneObject {
5570
5604
  }
5571
5605
  setSkinTexture(src) {
5572
5606
  if (typeof src === "undefined") return;
5573
- this.skinTextureSrc = src;
5574
5607
  const mat = Materials.getImage({
5575
5608
  texture: { src },
5576
5609
  transparent: true
@@ -5584,18 +5617,18 @@ var SkinObject = class extends SceneObject {
5584
5617
  }
5585
5618
  //TODO: cape
5586
5619
  setSlim(slim) {
5587
- console.log("#setSlim");
5588
- const changed = slim !== this.slim;
5620
+ if (slim === this.slim) return;
5589
5621
  this.slim = slim;
5590
- if (changed) {
5591
- this.createMeshes();
5592
- }
5593
- if (changed) {
5594
- if (this.skinTextureSrc) {
5595
- this.setSkinTexture(this.skinTextureSrc);
5596
- }
5597
- }
5598
- console.log("#setSlim done");
5622
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
5623
+ const mesh = this.getMeshByName(part);
5624
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
5625
+ }
5626
+ const offset = slim ? 0.5 : -0.5;
5627
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
5628
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
5629
+ if (leftArm) leftArm.position.x += offset;
5630
+ if (rightArm) rightArm.position.x -= offset;
5631
+ this.notifyDirty();
5599
5632
  }
5600
5633
  setLegacy(legacy) {
5601
5634
  if (legacy !== this.legacy) {