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.
@@ -5506,7 +5506,41 @@ var baseSkinCoordinates = {
5506
5506
  var classicSkinTextureCoordinates = {
5507
5507
  ...baseSkinCoordinates
5508
5508
  };
5509
- var slimSkinTextureCoordinates = { ...baseSkinCoordinates };
5509
+ var slimSkinTextureCoordinates = {
5510
+ ...baseSkinCoordinates,
5511
+ leftArm: {
5512
+ ...baseSkinCoordinates.leftArm,
5513
+ west: { uv: [39, 52, 43, 64] },
5514
+ north: { uv: [36, 52, 39, 64] },
5515
+ south: { uv: [43, 52, 46, 64] },
5516
+ up: { uv: [39, 52, 36, 48] },
5517
+ down: { uv: [42, 48, 39, 52] }
5518
+ },
5519
+ rightArm: {
5520
+ ...baseSkinCoordinates.rightArm,
5521
+ west: { uv: [47, 20, 51, 32] },
5522
+ north: { uv: [44, 20, 47, 32] },
5523
+ south: { uv: [51, 20, 54, 32] },
5524
+ up: { uv: [47, 20, 44, 16] },
5525
+ down: { uv: [50, 16, 47, 20] }
5526
+ },
5527
+ leftSleeve: {
5528
+ ...baseSkinCoordinates.leftSleeve,
5529
+ west: { uv: [55, 52, 59, 64] },
5530
+ north: { uv: [52, 52, 55, 64] },
5531
+ south: { uv: [59, 52, 62, 64] },
5532
+ up: { uv: [55, 52, 52, 48] },
5533
+ down: { uv: [58, 48, 55, 52], rotation: 180 }
5534
+ },
5535
+ rightSleeve: {
5536
+ ...baseSkinCoordinates.rightSleeve,
5537
+ west: { uv: [47, 36, 51, 48] },
5538
+ north: { uv: [44, 36, 47, 48] },
5539
+ south: { uv: [51, 36, 54, 48] },
5540
+ up: { uv: [47, 36, 44, 32] },
5541
+ down: { uv: [50, 32, 47, 36], rotation: 180 }
5542
+ }
5543
+ };
5510
5544
 
5511
5545
  // src/skin/SkinGeometries.ts
5512
5546
  var box8inner = [8, 8, 8];
@@ -5616,7 +5650,6 @@ var SkinObject = class extends SceneObject {
5616
5650
  }
5617
5651
  setSkinTexture(src) {
5618
5652
  if (typeof src === "undefined") return;
5619
- this.skinTextureSrc = src;
5620
5653
  const mat = Materials.getImage({
5621
5654
  texture: { src },
5622
5655
  transparent: true
@@ -5630,18 +5663,18 @@ var SkinObject = class extends SceneObject {
5630
5663
  }
5631
5664
  //TODO: cape
5632
5665
  setSlim(slim) {
5633
- console.log("#setSlim");
5634
- const changed = slim !== this.slim;
5666
+ if (slim === this.slim) return;
5635
5667
  this.slim = slim;
5636
- if (changed) {
5637
- this.createMeshes();
5638
- }
5639
- if (changed) {
5640
- if (this.skinTextureSrc) {
5641
- this.setSkinTexture(this.skinTextureSrc);
5642
- }
5643
- }
5644
- console.log("#setSlim done");
5668
+ for (const part of ["leftArm" /* LEFT_ARM */, "leftSleeve" /* LEFT_SLEEVE */, "rightArm" /* RIGHT_ARM */, "rightSleeve" /* RIGHT_SLEEVE */]) {
5669
+ const mesh = this.getMeshByName(part);
5670
+ if (mesh) mesh.geometry = this.getBoxGeometry(part);
5671
+ }
5672
+ const offset = slim ? 0.5 : -0.5;
5673
+ const leftArm = this.getGroupByName("leftArm" /* LEFT_ARM */);
5674
+ const rightArm = this.getGroupByName("rightArm" /* RIGHT_ARM */);
5675
+ if (leftArm) leftArm.position.x += offset;
5676
+ if (rightArm) rightArm.position.x -= offset;
5677
+ this.notifyDirty();
5645
5678
  }
5646
5679
  setLegacy(legacy) {
5647
5680
  if (legacy !== this.legacy) {