mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fix RBMK crane girder rendering with unequal spans
This commit is contained in:
parent
8294df1aa3
commit
097b2bb12c
@ -22,12 +22,14 @@ public class RenderCraneConsole extends TileEntitySpecialRenderer {
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
int teFacing = 0;
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 2: teFacing = 90; break;
|
||||
case 4: teFacing = 180; break;
|
||||
case 3: teFacing = 270; break;
|
||||
case 5: teFacing = 0; break;
|
||||
}
|
||||
GL11.glRotatef(teFacing, 0F, 1F, 0F);
|
||||
|
||||
TileEntityCraneConsole console = (TileEntityCraneConsole) te;
|
||||
|
||||
@ -99,12 +101,7 @@ public class RenderCraneConsole extends TileEntitySpecialRenderer {
|
||||
double cranePosZ = (-te.zCoord + console.centerZ);
|
||||
|
||||
GL11.glTranslated(cranePosX, cranePosY, cranePosZ);
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
GL11.glRotatef(teFacing, 0F, 1F, 0F);
|
||||
|
||||
double posX = (console.lastPosFront + (console.posFront - console.lastPosFront) * interp);
|
||||
double posZ = (console.lastPosLeft + (console.posLeft - console.lastPosLeft) * interp);
|
||||
@ -116,22 +113,22 @@ public class RenderCraneConsole extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
int girderSpan = 0;
|
||||
GL11.glRotatef(-craneRotationOffset, 0F, 1F, 0F);
|
||||
switch(craneRotationOffset) {
|
||||
switch((craneRotationOffset + teFacing) % 360) {
|
||||
case 0:
|
||||
girderSpan = console.spanL + console.spanR + 1;
|
||||
GL11.glTranslated(posX - console.spanL, 0, 0);
|
||||
girderSpan = console.spanF + console.spanB + 1;
|
||||
GL11.glTranslated(posX + console.spanB, 0, 0);
|
||||
break;
|
||||
case 90:
|
||||
girderSpan = console.spanF + console.spanB + 1;
|
||||
GL11.glTranslated(0, 0, -posZ + console.spanB);
|
||||
girderSpan = console.spanL + console.spanR + 1;
|
||||
GL11.glTranslated(0, 0, -posZ - console.spanR);
|
||||
break;
|
||||
case 180:
|
||||
girderSpan = console.spanL + console.spanR + 1;
|
||||
GL11.glTranslated(posX + console.spanR, 0, 0);
|
||||
girderSpan = console.spanF + console.spanB + 1;
|
||||
GL11.glTranslated(posX - console.spanF, 0, 0);
|
||||
break;
|
||||
case 270:
|
||||
girderSpan = console.spanF + console.spanB + 1;
|
||||
GL11.glTranslated(0, 0, -posZ - console.spanF);
|
||||
girderSpan = console.spanL + console.spanR + 1;
|
||||
GL11.glTranslated(0, 0, -posZ + console.spanL);
|
||||
break;
|
||||
}
|
||||
GL11.glRotatef(craneRotationOffset, 0F, 1F, 0F);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user