mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-17 15:05:33 +00:00
Added a block on player head
It appears if there is input in the helmet field.
This commit is contained in:
parent
e706235c33
commit
b1c44f3822
1 changed files with 37 additions and 31 deletions
16
js/main.js
16
js/main.js
|
@ -10,6 +10,9 @@ var rotY = 0, rotX = 0;
|
|||
var matWood = new THREE.MeshLambertMaterial({ color: 0x826841 });
|
||||
//var matWood = new THREE.MeshLambertMaterial({ color: 0x826841, transparent: true, opacity: 0.5 }); //For testing the mesh alignment
|
||||
var matStone = new THREE.MeshLambertMaterial({ color: 0xadadad });
|
||||
var matTransparentStone = new THREE.MeshLambertMaterial({ color: 0xadadad });
|
||||
matTransparentStone.opacity = 0.8;
|
||||
matTransparentStone.transparent = true;
|
||||
var viewCenter = new THREE.Vector3(0,0,0);
|
||||
// Meshes
|
||||
// The ones marked with //* are not real meshes, but contain a child (or more) which gets rendered.
|
||||
|
@ -17,6 +20,7 @@ var viewCenter = new THREE.Vector3(0,0,0);
|
|||
var mBasePlate;
|
||||
var mBody; //*
|
||||
var mHead; //*
|
||||
var mSkull;
|
||||
var mLegLeft; //*
|
||||
var mLegRight; //*
|
||||
var mArmLeft; //*
|
||||
|
@ -38,7 +42,7 @@ var equipSword;
|
|||
var equipShoes;
|
||||
var equipLeggings;
|
||||
var equipChestplate;
|
||||
var equipHelmet;
|
||||
var equipHelmet = "";
|
||||
var equipCustomHeadMode;
|
||||
var equipColorShoes;
|
||||
var equipColorLeggings;
|
||||
|
@ -226,14 +230,15 @@ function setup(){
|
|||
mmNeck.position.set(0,3.5/16,0);
|
||||
/*
|
||||
We do not want the head, as it obstructs a whole lot of the view. We can implement this,
|
||||
once we've got an editor option to toggle it on and off.
|
||||
var mmSkull = new THREE.Mesh(
|
||||
once we've got an editor option to toggle it on and off.*/
|
||||
mSkull = new THREE.Mesh(
|
||||
new THREE.BoxGeometry(10/16, 10/16, 10/16),
|
||||
matWood);
|
||||
mmSkull.position.set(0,5/16,0);*/
|
||||
matTransparentStone);
|
||||
mSkull.position.set(0,5/16,0);
|
||||
mHead = new THREE.Object3D();
|
||||
mHead.position.set(0,22/16,0); //Pivot Point
|
||||
mHead.add(mmNeck);
|
||||
mHead.add(mSkull);
|
||||
armorstand.add(mHead);
|
||||
|
||||
|
||||
|
@ -363,6 +368,7 @@ function updateUI(){
|
|||
//Set Visibility
|
||||
mArmRight.visible = mArmLeft.visible = showArms;
|
||||
mBasePlate.visible = !noBasePlate;
|
||||
mSkull.visible = equipHelmet != "";
|
||||
}
|
||||
|
||||
function generateCode(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue