1
0
Fork 0
mirror of https://github.com/haselkern/Minecraft-ArmorStand.git synced 2025-05-17 15:05:33 +00:00

Add first version of armorstand class

This commit is contained in:
Lars Martens 2021-08-11 23:01:26 +02:00
parent e46ba54aac
commit dab3e20310
6 changed files with 101 additions and 16 deletions

View file

@ -1,24 +1,59 @@
<template>
<div class="flex">
<div class="flex-1 h-screen">
<Scene :rot="roty" />
<div>
<div class="w-3/5 h-screen float-left">
<Scene :armorstand="armorstand" />
</div>
<div class="flex-none w-60">
<h1>{{ roty }}</h1>
<input type="range" min="0" max="100" v-model="roty" />
<div class="w-2/5 float-right">
<table>
<tr>
<td>Rotation</td>
<td colspan="3">
<input @dblclick="() => armorstand.rotation = 0" class="w-full" type="range" min="-180" max="180" v-model="armorstand.rotation" />
</td>
</tr>
<RotationSliderRow label="Head" :rotation="armorstand.head" />
</table>
</div>
</div>
</template>
<script>
import Scene from "./Scene.vue"
import RotationSliderRow from "./RotationSliderRow.vue"
// The Armorstand will hold all attributes for an armor stand.
class Armorstand {
constructor() {
// Rotation values for the body parts
this.rotation = 0
this.head = { x: 0, y: 0, z: 0 }
this.body = { x: 0, y: 0, z: 0 }
this.legLeft = { x: 0, y: 0, z: 0 }
this.legRight = { x: 0, y: 0, z: 0 }
this.armLeft = { x: 0, y: 0, z: 0 }
this.armRight = { x: 0, y: 0, z: 0 }
// Boolean attributes
this.invisible = false
this.invulnerable = false
this.persistenceRequired = false
this.noBasePlate = false
this.noGravity = false
this.showArms = false
this.small = false
this.marker = false
this.centerCorrected = false
// TODO Lots more to come
}
}
export default {
data() {
return {
roty: 0,
armorstand: new Armorstand(),
}
},
components: {Scene},
components: { Scene, RotationSliderRow },
}
</script>