Commit 031c5ad6 authored by SilverDavid's avatar SilverDavid

Figuring stuff out

parent 3c66fc30
......@@ -10,6 +10,7 @@ import com.legacy.rediscovered.client.render.md3.MD3Loader;
import com.legacy.rediscovered.client.render.md3.MD3Renderer;
import com.legacy.rediscovered.entity.BeastBoyEntity;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
......@@ -57,35 +58,47 @@ public class BeastBoyRenderer extends EntityRenderer<BeastBoyEntity>
public void render(BeastBoyEntity entity, float yaw, float ticks, MatrixStack matrix, IRenderTypeBuffer buffer, int p_225623_6_)
{
renderMD3(entity, matrix, (float) entity.getPosX(), (float) entity.getPosY(), (float) entity.getPosZ(), yaw, ticks);
super.render(entity, yaw, ticks, matrix, buffer, p_225623_6_);
}
public final void renderMD3(BeastBoyEntity entity, MatrixStack matrix, float x, float y, float z, float yaw, float ticks)
{
yaw = z;
/*yaw = z;
z = y - (float) entity.getYOffset();
y = x;
y = x;*/
matrix.push();
float f5 = entity.prevRenderYawOffset + (entity.renderYawOffset - entity.prevRenderYawOffset) * ticks;
matrix.translate(y, z, yaw);
RenderSystem.pushMatrix();
//float f5 = entity.prevRenderYawOffset + (entity.renderYawOffset - entity.prevRenderYawOffset) * ticks;
RenderSystem.translated(0, 0, -10.0);
float scale = 0.05f;
RenderSystem.scalef(scale, scale, scale);
RenderSystem.translatef(0, -50, 0);
RenderSystem.rotatef(-90, 1, 0, 0);
RenderSystem.rotatef(entity.prevRotationYawHead, 0, 0, 1);
//RenderSystem.rotatef(0, 0, 0, 0);
//matrix.translate(x, y, z);
Minecraft.getInstance().textureManager.bindTexture(RediscoveredMod.locate("textures/entity/beast_boy.png"));
matrix.rotate(Vector3f.field_229181_d_.func_229187_a_(-f5 + 180F));
matrix.rotate(Vector3f.field_229179_b_.func_229187_a_(-90.0F));
matrix.scale(0.02F, -0.02F, 0.02F);
//matrix.rotate(Vector3f.field_229181_d_.func_229187_a_(-f5 + 180F));
//matrix.rotate(Vector3f.field_229179_b_.func_229187_a_(-90.0F));
//matrix.scale(0.02F, -0.02F, 0.02F);
float rotation = entity.ticksExisted + ticks * getSpeedMultiplier(entity);
try
{
int frame1 = (int) rotation % renderer.getAnimFrames();
int frame2 = (frame1 + 1) % renderer.getAnimFrames();
GL11.glShadeModel(GL11.GL_SMOOTH);
//GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_NORMALIZE);
renderer.render(frame1, frame2, rotation - (int) rotation);
renderer.render(frame1, frame2, 0);
GL11.glDisable(GL11.GL_NORMALIZE);
}
catch (Exception e)
{
e.printStackTrace();
}
RenderSystem.popMatrix();
matrix.pop();
}
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ public final class MD3Renderer
return this.model.animFrames;
}
public final void render(int var1, int var2, float var3)
public final void render(int frame1, int frame2, float var3)
{
if ((this.displayList == 0) || (this.useAnimation))
{
......@@ -45,7 +45,7 @@ public final class MD3Renderer
if (this.useAnimation)
{
surface.setFrame(var1, var2, var3);
surface.setFrame(frame1, frame2, var3);
}
else
{
......@@ -55,7 +55,7 @@ public final class MD3Renderer
surface.triangles.position(0);
surface.d.position(0);
GL11.glVertexPointer(3, GL11.GL_FLOAT, 0, surface.vertices);
GL11.glNormalPointer(GL11.GL_FLOAT, 0, surface.normals);
GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 0, surface.d);
......
......@@ -29,15 +29,15 @@ public final class MD3Surface
this.i = new float[var2 * 3];
}
public final void setFrame(int var1, int var2, float var3)
public final void setFrame(int fame1, int frame2, float var3)
{
this.triangles.position(0).limit(this.triangles.capacity());
this.d.position(0).limit(this.d.capacity());
int var4 = var1;
int var4 = fame1;
if (var3 != 0.0F)
{
interpolate(this.vertices, var1, var2, var3);
interpolate(this.normals, var1, var2, var3);
interpolate(this.vertices, fame1, frame2, var3);
interpolate(this.normals, fame1, frame2, var3);
var4 = this.frames;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment