From a579f7bf26822f9fcb3fda6b4f84839210ff864d Mon Sep 17 00:00:00 2001 From: Haowei Wen Date: Sat, 3 Oct 2020 22:59:59 +0800 Subject: [PATCH] move player up by 4m so we have the same pivot as it's in real Minecraft --- src/model.ts | 12 ++++++------ src/orbit_controls.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/model.ts b/src/model.ts index 19afe52..91d1f80 100644 --- a/src/model.ts +++ b/src/model.ts @@ -112,6 +112,7 @@ export class SkinObject extends Group { this.head = new BodyPart(headMesh, head2Mesh); this.head.name = "head"; this.head.add(headMesh, head2Mesh); + this.head.position.y = 4; this.add(this.head); // Body @@ -140,7 +141,7 @@ export class SkinObject extends Group { this.body = new BodyPart(bodyMesh, body2Mesh); this.body.name = "body"; this.body.add(bodyMesh, body2Mesh); - this.body.position.y = -10; + this.body.position.y = -6; this.add(this.body); // Right Arm @@ -210,7 +211,7 @@ export class SkinObject extends Group { this.rightArm = new BodyPart(rightArmMesh, rightArm2Mesh); this.rightArm.name = "rightArm"; this.rightArm.add(rightArmPivot); - this.rightArm.position.y = -6; + this.rightArm.position.y = -2; this.modelListeners.push(() => { this.rightArm.position.x = this.slim ? -5.5 : -6; }); @@ -283,7 +284,7 @@ export class SkinObject extends Group { this.leftArm = new BodyPart(leftArmMesh, leftArm2Mesh); this.leftArm.name = "leftArm"; this.leftArm.add(leftArmPivot); - this.leftArm.position.y = -6; + this.leftArm.position.y = -2; this.modelListeners.push(() => { this.leftArm.position.x = this.slim ? 5.5 : 6; }); @@ -320,7 +321,7 @@ export class SkinObject extends Group { this.rightLeg = new BodyPart(rightLegMesh, rightLeg2Mesh); this.rightLeg.name = "rightLeg"; this.rightLeg.add(rightLegPivot); - this.rightLeg.position.y = -16; + this.rightLeg.position.y = -12; this.rightLeg.position.x = -2; this.add(this.rightLeg); @@ -355,7 +356,7 @@ export class SkinObject extends Group { this.leftLeg = new BodyPart(leftLegMesh, leftLeg2Mesh); this.leftLeg.name = "leftLeg"; this.leftLeg.add(leftLegPivot); - this.leftLeg.position.y = -16; + this.leftLeg.position.y = -12; this.leftLeg.position.x = 2; this.add(this.leftLeg); @@ -431,7 +432,6 @@ export class PlayerObject extends Group { this.cape = new CapeObject(capeTexture); this.cape.name = "cape"; this.cape.position.z = -2; - this.cape.position.y = -4; this.cape.rotation.x = 10.8 * Math.PI / 180; this.add(this.cape); } diff --git a/src/orbit_controls.ts b/src/orbit_controls.ts index a835824..8020c60 100644 --- a/src/orbit_controls.ts +++ b/src/orbit_controls.ts @@ -7,7 +7,7 @@ export function createOrbitControls(skinViewer: SkinViewer): OrbitControls { // default configuration control.enablePan = false; - control.target = new Vector3(0, -12, 0); + control.target = new Vector3(0, -8, 0); control.minDistance = 10; control.maxDistance = 256; control.update();