#Entity's Head Pivot is not correcting to the right spot

3 messages · Page 1 of 1 (latest)

forest thicket
#

my gnome's head won't rotate around the right YPivot. I have TRIED setting the pivot in modelData and setAngles() to various things and they are still not changing it. MyGnomeEntity is a BipedModelEntity. Any help would be appreciated

public static TexturedModelData getTexturedModelData() {

  ModelData modelData = BipedEntityModel.getModelData(Dilation.NONE, 20);
  ModelPartData modelPartData = modelData.getRoot();

  ModelTransform modelTransform = ModelTransform.pivot(0.0f, 0, 0.0f);

  modelPartData.addChild(EntityModelPartNames.HEAD, ModelPartBuilder.create()
                .uv().cuboid()
                .((other cuboids))
                ,modelTransform);
  return TexturedModelData.of(modelData, 64, 64);
}

@Override
public void setAngles() {
  super.setAngles();
  this.head.pivotY = 0;
  this.hat.pivotY = this.head.pivotY;
  
}

the hands are a later issue I just want it to not decapitate itself every time it looks up.

I followed the formats of the ZombieEntityRenderer and the EndermanEntitymodel because the former extends BipedEntityRenderer and the latter extends BipedEntityModel and also moves the head of the model.

I honestly have no clue what the problem is because I looked at the EnderMan files and I think I am following the exact same methods. Below is the Enderman modelTransform and the head.pivotY in setAngles. Looking back I think the problem may be that I am using BipedEntityRenderer instead of MobEntityRenderer which I really hope is not the case because i really don't feel like making an entirely new entityclass

ModelTransform modelTransform = ModelTransform.pivot(0.0f, -13.0f, 0.0f);

public void setAngles() {
  super.setAngles();
  this.head.pivotY = -13.0f;
}
forest thicket
#

The issue here was that I was treating the pivot arg in the .addchild(String name, ModelPartBuilder builder, ModelTransform pivot) method as if it were separate from the positional data of the cuboids. The cuboids are positioned in the spatial orientation that you pass through the cuboid() method within their own MODELPART SPACE . They are then positioned within the ENTITY SPACE via the positional data from the pivot argument.

Obviously, the next thing to question is at what point within the individual Model Part Spaces they are positioned by within the Entity Space. This I am not sure and do not want to dig any further. I'm not going to begin how to analyze that because its more work than I want to do and I am simply a monkey at a typewriter bastardizing my favorite story.

The gnome with all model parts positioned at zero is below