mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-18 05:55:35 +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 });
|
||||||
//var matWood = new THREE.MeshLambertMaterial({ color: 0x826841, transparent: true, opacity: 0.5 }); //For testing the mesh alignment
|
//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 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);
|
var viewCenter = new THREE.Vector3(0,0,0);
|
||||||
// Meshes
|
// Meshes
|
||||||
// The ones marked with //* are not real meshes, but contain a child (or more) which gets rendered.
|
// 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 mBasePlate;
|
||||||
var mBody; //*
|
var mBody; //*
|
||||||
var mHead; //*
|
var mHead; //*
|
||||||
|
var mSkull;
|
||||||
var mLegLeft; //*
|
var mLegLeft; //*
|
||||||
var mLegRight; //*
|
var mLegRight; //*
|
||||||
var mArmLeft; //*
|
var mArmLeft; //*
|
||||||
|
@ -38,7 +42,7 @@ var equipSword;
|
||||||
var equipShoes;
|
var equipShoes;
|
||||||
var equipLeggings;
|
var equipLeggings;
|
||||||
var equipChestplate;
|
var equipChestplate;
|
||||||
var equipHelmet;
|
var equipHelmet = "";
|
||||||
var equipCustomHeadMode;
|
var equipCustomHeadMode;
|
||||||
var equipColorShoes;
|
var equipColorShoes;
|
||||||
var equipColorLeggings;
|
var equipColorLeggings;
|
||||||
|
@ -226,14 +230,15 @@ function setup(){
|
||||||
mmNeck.position.set(0,3.5/16,0);
|
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,
|
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.
|
once we've got an editor option to toggle it on and off.*/
|
||||||
var mmSkull = new THREE.Mesh(
|
mSkull = new THREE.Mesh(
|
||||||
new THREE.BoxGeometry(10/16, 10/16, 10/16),
|
new THREE.BoxGeometry(10/16, 10/16, 10/16),
|
||||||
matWood);
|
matTransparentStone);
|
||||||
mmSkull.position.set(0,5/16,0);*/
|
mSkull.position.set(0,5/16,0);
|
||||||
mHead = new THREE.Object3D();
|
mHead = new THREE.Object3D();
|
||||||
mHead.position.set(0,22/16,0); //Pivot Point
|
mHead.position.set(0,22/16,0); //Pivot Point
|
||||||
mHead.add(mmNeck);
|
mHead.add(mmNeck);
|
||||||
|
mHead.add(mSkull);
|
||||||
armorstand.add(mHead);
|
armorstand.add(mHead);
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,6 +368,7 @@ function updateUI(){
|
||||||
//Set Visibility
|
//Set Visibility
|
||||||
mArmRight.visible = mArmLeft.visible = showArms;
|
mArmRight.visible = mArmLeft.visible = showArms;
|
||||||
mBasePlate.visible = !noBasePlate;
|
mBasePlate.visible = !noBasePlate;
|
||||||
|
mSkull.visible = equipHelmet != "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateCode(){
|
function generateCode(){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue