Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.row.renderer.entity;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.client.model.ModelBase;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.entity.Entity;
- import net.minecraft.util.ResourceLocation;
- import net.row.entity.GunHowitzerLight;
- import net.row.models.howitzer.*;
- import org.lwjgl.opengl.GL11;
- @SideOnly(Side.CLIENT)
- public class RenderGunLightHowitzer extends Render{
- protected final ModelBase base = new ModelPedestal();
- protected final ModelBase mount = new ModelMount();
- protected final ModelBase cradle = new ModelCradle();
- protected final ModelBase bolt = new ModelBolt();
- protected final ModelBase handleAzimuth = new ModelHandleAzimuth();
- protected final ModelBase handleZenith = new ModelHandleZenith();
- protected final ModelBase axle = new ModelAxle();
- protected final ResourceLocation texture = new ResourceLocation("row:textures/cannon/howitzer/cannon_light_1.png");
- //For .obj models
- //private final WavefrontObject modelObj = (WavefrontObject) AdvancedModelLoader.loadModel(new //ResourceLocation("modid:path/name.obj"));
- public RenderGunLightHowitzer(){
- this.shadowSize = 1.0F;
- }
- public void renderHowitzer(GunHowitzerLight par1, double par2, double par4, double par6, float par8, float par9){
- GL11.glPushMatrix();
- GL11.glTranslated(par2, par4, par6);
- bindTexture(texture);
- base.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glRotatef(-par1.rotationYaw, 0F, 1F, 0F);
- mount.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- //For .obj models
- //this.modelObj.renderAll();
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 15F/16.0F, -0F/16.0F);
- GL11.glRotatef(-par1.rotationPitch*9.0F + 45F, 1F, 0F, 0F);
- axle.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 12/16.0F, 0.0F);
- GL11.glRotatef(-110F, 0F, 1F, 0F);
- GL11.glTranslatef(-7/16.0F, 0.0F, -2/16.0F);
- GL11.glRotatef(par1.rotationYaw*20.0F, 1F, 0F, 0F);
- handleAzimuth.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 17/16.0F, 0.0F);
- GL11.glRotatef(-90F, 0F, 1F, 0F);
- GL11.glTranslatef(-6/16.0F, 0.0F, -4.5F/16.0F);
- GL11.glRotatef(par1.rotationPitch*20.0F, 1F, 0F, 0F);
- handleZenith.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- GL11.glTranslatef(0.0F, 22/16.0F, -2/16.0F);
- GL11.glRotatef(-par1.rotationPitch, 1F, 0F, 0F);
- cradle.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glTranslatef(0.0F, 0.0F, -par1.shootingStage/60F*6F/16F);
- bolt.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- }
- @Override
- public void doRender(Entity par1, double par2, double par4, double par6, float par8, float par9){
- this.renderHowitzer((GunHowitzerLight) par1, par2, par4, par6, par8, par9);
- }
- @Override
- protected ResourceLocation getEntityTexture(Entity entity){
- return null;
- }
- }
Add Comment
Please, Sign In to add comment