mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 09:26:11 -04:00
fix skeletal models due to changes
This commit is contained in:
parent
252dd3e1e8
commit
9f134fa4af
@ -36,12 +36,14 @@ class SingleChestRenderer(
|
||||
) : ChestRenderer(state, model.createInstance(context), position, light) {
|
||||
|
||||
companion object {
|
||||
val SINGLE_MODEL = minecraft("block/entities/chest/single").sModel()
|
||||
val MODEL = minecraft("block/entities/chest/single").sModel()
|
||||
val MODEL_5 = minecraft("block/entities/chest/single_5").sModel()
|
||||
private val named = minecraft("chest")
|
||||
|
||||
fun register(loader: ModelLoader, name: ResourceLocation, texture: ResourceLocation) {
|
||||
val texture = loader.context.textures.staticTextures.createTexture(texture)
|
||||
loader.skeletal.register(name, SINGLE_MODEL, mapOf(named to texture))
|
||||
val model = if (loader.packFormat < 5) MODEL else MODEL_5
|
||||
loader.skeletal.register(name, model, mapOf(named to texture))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ShulkerAnimation(
|
||||
const val NAME = "shulker"
|
||||
|
||||
private val ROTATION_CLOSED = Vec3(0.0f, 0.0f, 0.0f).rad
|
||||
private val ROTATION_OPENED = Vec3(0.0f, 270.0f, 0.0f).rad
|
||||
private val ROTATION_OPENED = Vec3(0.0f, -270.0f, 0.0f).rad
|
||||
|
||||
private val TRANSLATION_CLOSED = Vec3(0.0f, 0.0f, 0.0f)
|
||||
private val TRANSLATION_OPENED = Vec3(0.0f, 0.5f, 0.0f)
|
||||
|
@ -16,7 +16,6 @@ package de.bixilon.minosoft.gui.rendering.entities.feature
|
||||
import de.bixilon.kotlinglm.func.rad
|
||||
import de.bixilon.kotlinglm.vec3.Vec3
|
||||
import de.bixilon.kotlinglm.vec3.Vec3d
|
||||
import de.bixilon.minosoft.data.entities.EntityRotation
|
||||
import de.bixilon.minosoft.gui.rendering.entities.easteregg.EntityEasterEggs.isFlipped
|
||||
import de.bixilon.minosoft.gui.rendering.entities.renderer.EntityRenderer
|
||||
import de.bixilon.minosoft.gui.rendering.entities.renderer.living.LivingEntityRenderer
|
||||
@ -58,7 +57,7 @@ open class SkeletalFeature(
|
||||
}
|
||||
|
||||
protected open fun updateInstance() {
|
||||
val rotation = Vec3(0.0f, (EntityRotation.HALF_CIRCLE_DEGREE - yaw).rad, 0.0f)
|
||||
val rotation = Vec3(0.0f, -yaw.rad, 0.0f)
|
||||
instance.update(rotation, renderer.matrix)
|
||||
}
|
||||
|
||||
|
@ -15,14 +15,14 @@ package de.bixilon.minosoft.gui.rendering.entities.model.human
|
||||
|
||||
import de.bixilon.minosoft.gui.rendering.entities.feature.SkeletalFeature
|
||||
import de.bixilon.minosoft.gui.rendering.entities.model.human.animator.ArmAnimator
|
||||
import de.bixilon.minosoft.gui.rendering.entities.model.human.animator.HeadPosition
|
||||
import de.bixilon.minosoft.gui.rendering.entities.model.human.animator.HumanHeadAnimator
|
||||
import de.bixilon.minosoft.gui.rendering.entities.model.human.animator.LegAnimator
|
||||
import de.bixilon.minosoft.gui.rendering.entities.renderer.EntityRenderer
|
||||
import de.bixilon.minosoft.gui.rendering.entities.util.EntitySpeed
|
||||
import de.bixilon.minosoft.gui.rendering.skeletal.baked.BakedSkeletalModel
|
||||
|
||||
abstract class HumanModel<R : EntityRenderer<*>>(renderer: R, model: BakedSkeletalModel) : SkeletalFeature(renderer, model) {
|
||||
val head = instance.transform.children["head"]?.let { HeadPosition(this, it) }
|
||||
val head = instance.transform.children["head"]?.let { HumanHeadAnimator(this, it) }
|
||||
val leg = LegAnimator(this, instance.transform.children["left_leg"]!!, instance.transform.children["right_leg"]!!)
|
||||
val arm = ArmAnimator(this, instance.transform.children["left_arm"]!!, instance.transform.children["right_arm"]!!)
|
||||
|
||||
|
@ -21,7 +21,7 @@ import de.bixilon.minosoft.gui.rendering.skeletal.instance.TransformInstance
|
||||
import de.bixilon.minosoft.gui.rendering.util.mat.mat4.Mat4Util.rotateRadAssign
|
||||
import de.bixilon.minosoft.gui.rendering.util.vec.vec3.Vec3Util.EMPTY
|
||||
|
||||
class HeadPosition(
|
||||
class HumanHeadAnimator(
|
||||
val model: HumanModel<*>,
|
||||
val transform: TransformInstance,
|
||||
) {
|
||||
@ -31,7 +31,7 @@ class HeadPosition(
|
||||
val info = model.renderer.info
|
||||
|
||||
val pitch = info.rotation.pitch
|
||||
this.rotation.x = -pitch.rad
|
||||
this.rotation.x = pitch.rad
|
||||
if (model.renderer.entity.isFlipped()) {
|
||||
this.rotation.x = -this.rotation.x // TODO: not 100% correct
|
||||
}
|
@ -5,7 +5,8 @@
|
||||
"to": [8, 10, 7],
|
||||
"texture": "minecraft:left",
|
||||
"uv": [0, 19],
|
||||
"faces": "-east",
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "-west",
|
||||
"children": {
|
||||
"lid": {
|
||||
"offset": [0, 9, 0],
|
||||
@ -13,14 +14,14 @@
|
||||
"from": [-7, 0, -7],
|
||||
"to": [8, 5, 7],
|
||||
"uv": [0, 0],
|
||||
"faces": "-east",
|
||||
"faces": "-west",
|
||||
"children": {
|
||||
"lock": {
|
||||
"offset": [7, -2, -8],
|
||||
"from": [0, 0, 0],
|
||||
"to": [1, 4, 1],
|
||||
"uv": [0, 0],
|
||||
"faces": "-east"
|
||||
"faces": "-west"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,7 +32,8 @@
|
||||
"to": [23, 10, 7],
|
||||
"texture": "minecraft:right",
|
||||
"uv": [0, 19],
|
||||
"faces": "-west",
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "-east",
|
||||
"children": {
|
||||
"lid": {
|
||||
"offset": [0, 9, 0],
|
||||
@ -39,14 +41,14 @@
|
||||
"from": [8, 0, -7],
|
||||
"to": [23, 5, 7],
|
||||
"uv": [0, 0],
|
||||
"faces": "-west",
|
||||
"faces": "-east",
|
||||
"children": {
|
||||
"lock": {
|
||||
"offset": [8, -2, -8],
|
||||
"from": [0, 0, 0],
|
||||
"to": [1, 4, 1],
|
||||
"uv": [0, 0],
|
||||
"faces": "-west"
|
||||
"faces": "-east"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
{
|
||||
"elements": {
|
||||
"body": {
|
||||
"from": [-7, 0, -7],
|
||||
"to": [7, 10, 7],
|
||||
"texture": "minecraft:chest",
|
||||
"uv": [0, 19],
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "all",
|
||||
"children": {
|
||||
"lid": {
|
||||
"offset": [0, 9, 0],
|
||||
"transform": "lid",
|
||||
"from": [-7, 0, -7],
|
||||
"to": [7, 5, 7],
|
||||
"uv": [0, 0],
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "all",
|
||||
"children": {
|
||||
"lock": {
|
||||
"offset": [0, -2, -8],
|
||||
"from": [-1, 0, 0],
|
||||
"to": [1, 4, 1],
|
||||
"uv": [0, 0],
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"transforms": {
|
||||
"lid": {
|
||||
"pivot": [0, 9, 7]
|
||||
}
|
||||
},
|
||||
"textures": {
|
||||
"minecraft:chest": {
|
||||
"resolution": [64, 64]
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@
|
||||
"to": [8, 8, 8],
|
||||
"texture": "minecraft:shulker",
|
||||
"uv": [0, 28],
|
||||
"rotation": [0, 0, 180],
|
||||
"faces": "all"
|
||||
},
|
||||
"lid": {
|
||||
@ -13,7 +12,6 @@
|
||||
"from": [-8, 4, -8],
|
||||
"to": [8, 16, 8],
|
||||
"texture": "minecraft:shulker",
|
||||
"rotation": [0, 0, 180],
|
||||
"uv": [0, 0],
|
||||
"faces": "all"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"to": [4, 12, 2],
|
||||
"texture": "minecraft:skin",
|
||||
"uv": [16, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"faces": "all",
|
||||
"children": {
|
||||
"jacket": {
|
||||
@ -23,7 +22,6 @@
|
||||
"from": [-4, 0, -4],
|
||||
"to": [4, 8, 4],
|
||||
"uv": [0, 0],
|
||||
"rotation": [180, 0, 0],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "head",
|
||||
"faces": "all",
|
||||
@ -40,8 +38,7 @@
|
||||
"left_leg": {
|
||||
"from": [-4, 0, -2],
|
||||
"to": [0, 12, 2],
|
||||
"uv": [16, 48],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [0, 16],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "left_leg",
|
||||
"faces": "all",
|
||||
@ -50,7 +47,7 @@
|
||||
"from": [-4, 0, -2],
|
||||
"to": [0, 12, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [0, 48],
|
||||
"uv": [0, 32],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -58,8 +55,7 @@
|
||||
"right_leg": {
|
||||
"from": [0, 0, -2],
|
||||
"to": [4, 12, 2],
|
||||
"uv": [0, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [16, 48],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "right_leg",
|
||||
"faces": "all",
|
||||
@ -68,7 +64,7 @@
|
||||
"from": [0, 0, -2],
|
||||
"to": [4, 12, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [0, 32],
|
||||
"uv": [0, 48],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -76,8 +72,7 @@
|
||||
"left_arm": {
|
||||
"from": [-7, 12, -2],
|
||||
"to": [-4, 24, 2],
|
||||
"uv": [32, 48],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [40, 16],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "left_arm",
|
||||
"faces": "all",
|
||||
@ -86,7 +81,7 @@
|
||||
"from": [-7, 12, -2],
|
||||
"to": [-4, 24, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [48, 48],
|
||||
"uv": [40, 32],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -94,8 +89,7 @@
|
||||
"right_arm": {
|
||||
"from": [4, 12, -2],
|
||||
"to": [7, 24, 2],
|
||||
"uv": [40, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [32, 48],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "right_arm",
|
||||
"faces": "all",
|
||||
@ -104,7 +98,7 @@
|
||||
"from": [4, 12, -2],
|
||||
"to": [7, 24, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [40, 32],
|
||||
"uv": [48, 48],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"to": [4, 12, 2],
|
||||
"texture": "minecraft:skin",
|
||||
"uv": [16, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"faces": "all",
|
||||
"children": {
|
||||
"jacket": {
|
||||
@ -23,7 +22,6 @@
|
||||
"from": [-4, 0, -4],
|
||||
"to": [4, 8, 4],
|
||||
"uv": [0, 0],
|
||||
"rotation": [180, 0, 0],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "head",
|
||||
"faces": "all",
|
||||
@ -40,8 +38,7 @@
|
||||
"left_leg": {
|
||||
"from": [-4, 0, -2],
|
||||
"to": [0, 12, 2],
|
||||
"uv": [16, 48],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [0, 16],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "left_leg",
|
||||
"faces": "all",
|
||||
@ -50,7 +47,7 @@
|
||||
"from": [-4, 0, -2],
|
||||
"to": [0, 12, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [0, 48],
|
||||
"uv": [0, 32],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -58,8 +55,7 @@
|
||||
"right_leg": {
|
||||
"from": [0, 0, -2],
|
||||
"to": [4, 12, 2],
|
||||
"uv": [0, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [16, 48],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "right_leg",
|
||||
"faces": "all",
|
||||
@ -68,7 +64,7 @@
|
||||
"from": [0, 0, -2],
|
||||
"to": [4, 12, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [0, 32],
|
||||
"uv": [0, 48],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -76,8 +72,7 @@
|
||||
"left_arm": {
|
||||
"from": [-8, 12, -2],
|
||||
"to": [-4, 24, 2],
|
||||
"uv": [32, 48],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [40, 16],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "left_arm",
|
||||
"faces": "all",
|
||||
@ -86,7 +81,7 @@
|
||||
"from": [-8, 12, -2],
|
||||
"to": [-4, 24, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [48, 48],
|
||||
"uv": [40, 32],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
@ -94,8 +89,7 @@
|
||||
"right_arm": {
|
||||
"from": [4, 12, -2],
|
||||
"to": [8, 24, 2],
|
||||
"uv": [40, 16],
|
||||
"rotation": [180, 0, 0],
|
||||
"uv": [32, 48],
|
||||
"texture": "minecraft:skin",
|
||||
"transform": "right_arm",
|
||||
"faces": "all",
|
||||
@ -104,7 +98,7 @@
|
||||
"from": [4, 12, -2],
|
||||
"to": [8, 24, 2],
|
||||
"inflate": 0.25,
|
||||
"uv": [40, 32],
|
||||
"uv": [48, 48],
|
||||
"faces": "all"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user