Skip to content

Commit

Permalink
most of the render bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed Nov 28, 2023
1 parent fe53858 commit dcffd4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
18 changes: 5 additions & 13 deletions src/main/java/fexcraft/tmt/slim/ModelBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,12 @@ public void flipAll(){
protected final void fixRotation(ModelRendererTurbo[] model, boolean flipX, boolean flipY, boolean flipZ){
bodyModel=model.clone();
model= new ModelRendererTurbo[]{};
if(true || (!flipX && !flipY && !flipZ)){
for(ModelRendererTurbo p : bodyModel){
p.rotateAngleX*= CommonUtil.degreesF;
p.rotateAngleY*= CommonUtil.degreesF;
p.rotateAngleZ*= CommonUtil.degreesF;
}
return;
}
for(ModelRendererTurbo mod : bodyModel){
if(mod==null){continue;}
if(flipX){mod.rotateAngleX = -mod.rotateAngleX;}
if(flipY){mod.rotateAngleY = -mod.rotateAngleY;}
if(flipZ){mod.rotateAngleZ = -mod.rotateAngleZ;}
for(ModelRendererTurbo p : bodyModel){
p.rotateAngleX*= CommonUtil.degreesF;
p.rotateAngleY*= CommonUtil.degreesF;
p.rotateAngleZ*= CommonUtil.degreesF;
}

}

protected final void fixRotation(ModelRendererTurbo[] parts){
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/fexcraft/tmt/slim/ModelConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class ModelConverter extends ModelBase {

public ModelRendererTurbo model[],bodyDoorOpenModel[], bodyDoorCloseModel[],trailerModel[],steeringWheelModel[];

public ModelRendererTurbo turretModel[],barrelModel[];
public ModelRendererTurbo frontWheelModel[],backWheelModel[],
leftFrontWheelModel[],rightFrontWheelModel[],leftBackWheelModel[],rightBackWheelModel[];
Expand Down Expand Up @@ -102,5 +102,4 @@ public void flipAll(){
flip(trailerModel);
flip(steeringWheelModel);
}

}
2 changes: 2 additions & 0 deletions src/main/java/fexcraft/tmt/slim/ModelRendererTurbo.java
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ public void render(float scale){
if(!showModel){
return;
}
GL11.glPushMatrix();
if (ignoresLighting){
Minecraft.getMinecraft().entityRenderer.disableLightmap(1D);
}
Expand Down Expand Up @@ -1394,6 +1395,7 @@ public void render(float scale){
if (ignoresLighting){
Minecraft.getMinecraft().entityRenderer.enableLightmap(1D);
}
GL11.glPopMatrix();
}


Expand Down

0 comments on commit dcffd4d

Please sign in to comment.