Jump to content

How can I make my vertex CUBE particle rotate while falling?


TominoCZ

Recommended Posts

this is what I edited in EntityDiggingFX.class(yes, I'm doing this in MCP):

 

public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_)
    {
        float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F;
        float var9 = var8 + 0.015609375F;
        float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F;
        float var11 = var10 + 0.015609375F;
        float var12 = 0.1F * this.particleScale;

        if (this.particleIcon != null)
        {
        	var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F));
            var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F));
            var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F));
            var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F));
        }

        float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX);
        float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY) - var12 / 2;
        float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ);
        p_70539_1_.setColorOpaque_F(1F, 1F, 1F);
        //TODO
        
        //var8, var9 - X U
        //var 10, var 11 - Y V
        
        //front
        
        p_70539_1_.addVertexWithUV(var13,         var14,         var15, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15, (double)var9, (double)var10);
      
        //back
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13,         var14,         var15 + var12, (double)var9, (double)var10);
        
        //left
        p_70539_1_.addVertexWithUV(var13, var14,         var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13, var14 + var12, var15,         (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13, var14,         var15,         (double)var9, (double)var10);
        
        //right
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15,         (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15,         (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15 + var12, (double)var9, (double)var10);
        
        //top
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15,         (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15,         (double)var9, (double)var10);
        
        //bottom
        p_70539_1_.addVertexWithUV(var13,         var14, var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14, var15,         (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14, var15,         (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10);

    }

 

now how do I make the cube rotate randomly while falling? By adding some code to the onUpdate method in EntityFX perhabs?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.