mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 06:37:34 +00:00
Fixed full body model rotations
This commit is contained in:
1 parent
755dcbab03
commit
7ff568b1be
2 files changed
+27
-6
No files matched your search
@@ -343,6 +343,22 @@ public class ModelMPM extends ModelNPCMale{
|
||||
return;
|
||||
|
||||
if(entityModel != null){
|
||||
GL11.glPushMatrix();
|
||||
AnimationData animationData = npc.display.animationData;
|
||||
if (animationData.isActive()) {
|
||||
Animation animation = animationData.animation;
|
||||
Frame frame = animation.frames.get(animation.currentFrame);
|
||||
if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL)) {
|
||||
FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL);
|
||||
part.interpolateOffset();
|
||||
part.interpolateAngles();
|
||||
float pi = 180 / (float) Math.PI;
|
||||
GL11.glTranslatef(part.prevPivots[0], part.prevPivots[1], part.prevPivots[2]);
|
||||
GL11.glRotatef(part.prevRotations[0] * pi, 1, 0, 0);
|
||||
GL11.glRotatef(part.prevRotations[1] * pi, 0, 1, 0);
|
||||
GL11.glRotatef(part.prevRotations[2] * pi, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
if(!isArmor){
|
||||
entityModel.isChild = entity.isChild();
|
||||
entityModel.onGround = onGround;
|
||||
@@ -423,6 +439,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
npc.display.overlayRenderTicks++;
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
alpha = npc.isInvisible() && !npc.isInvisibleToPlayer(player) ? 0.15f : 1;
|
||||
|
||||
@@ -614,10 +631,13 @@ public class ModelMPM extends ModelNPCMale{
|
||||
|
||||
if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL)) {
|
||||
FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL);
|
||||
part.interpolateOffset();
|
||||
part.interpolateAngles();
|
||||
float pi = 180 / (float) Math.PI;
|
||||
GL11.glTranslatef(part.prevPivots[0],part.prevPivots[1],part.prevPivots[2]);
|
||||
GL11.glRotatef(part.prevRotations[0],1,0,0);
|
||||
GL11.glRotatef(part.prevRotations[1],0,1,0);
|
||||
GL11.glRotatef(part.prevRotations[2],0,0,1);
|
||||
GL11.glRotatef(part.prevRotations[0] * pi,1,0,0);
|
||||
GL11.glRotatef(part.prevRotations[1] * pi,0,1,0);
|
||||
GL11.glRotatef(part.prevRotations[2] * pi,0,0,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,11 @@ public class MixinRenderPlayer {
|
||||
FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL);
|
||||
part.interpolateOffset();
|
||||
part.interpolateAngles();
|
||||
float pi = 180 / (float) Math.PI;
|
||||
GL11.glTranslatef(part.prevPivots[0], part.prevPivots[1], part.prevPivots[2]);
|
||||
GL11.glRotatef(part.prevRotations[0], 1, 0, 0);
|
||||
GL11.glRotatef(part.prevRotations[1], 0, 1, 0);
|
||||
GL11.glRotatef(part.prevRotations[2], 0, 0, 1);
|
||||
GL11.glRotatef(part.prevRotations[0] * pi, 1, 0, 0);
|
||||
GL11.glRotatef(part.prevRotations[1] * pi, 0, 1, 0);
|
||||
GL11.glRotatef(part.prevRotations[2] * pi, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user