Animation celons conditions
-
Salut, j’aimerai savoir comment animé un rendu celons certaine condition.
S’il marche ça fait anime le rendu de tel façon.
S’il court pareil, s’il rampe, s’il prend un coup, s’il meurt (par exemple).J’ai aussi un soucis d’animation de déplacement, il n’y a pas de balancement pour les jambes PENDANT qu’il marche, les membres effectue leur rotation au début de marche et se replace en fin de marche.
Merci.
-
Envoie nous ton code pour le bug.
Par les conditions, faut changer les variables avec un simple if avant d’afficher le model -
Dans la méthode des animations, y’a un paramètre Entity non ?
Si oui, if(entity instanceof TonEntity) + TonEntity tonentity = (TonEntity)entity
Et ensuite if(tonentity.isRunning()) etc…
-
le code
// Date: 10/02/2014 18:41:23 // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package dofusMobs.Client; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; public class ModelBoufton extends ModelBase { //fields ModelRenderer basecorps; ModelRenderer corphaut; ModelRenderer corpbas; ModelRenderer corpcote1; ModelRenderer corpscote2; ModelRenderer debuttete; ModelRenderer museau; ModelRenderer corparriere; ModelRenderer queuecentre; ModelRenderer queuecoter1; ModelRenderer queuecoter2; ModelRenderer queuearriere; ModelRenderer corne1; ModelRenderer corne11; ModelRenderer corne12; ModelRenderer corne2; ModelRenderer corne21; ModelRenderer corne23; ModelRenderer pied1; ModelRenderer pied2; ModelRenderer pied3; ModelRenderer pied4; ModelRenderer hautducorp; public ModelBoufton() { textureWidth = 128; textureHeight = 32; basecorps = new ModelRenderer(this, 40, 0); basecorps.addBox(-8F, 0F, -3F, 7, 4, 6); basecorps.setRotationPoint(0F, 18.5F, -5F); basecorps.setTextureSize(128, 32); basecorps.mirror = true; setRotation(basecorps, 0F, 1.570796F, 0F); corphaut = new ModelRenderer(this, 67, 0); corphaut.addBox(-7F, -0.5F, -2F, 5, 1, 4); corphaut.setRotationPoint(0F, 18.5F, -5F); corphaut.setTextureSize(128, 32); corphaut.mirror = true; setRotation(corphaut, 0F, 1.570796F, 0F); corpbas = new ModelRenderer(this, 67, 0); corpbas.addBox(-7F, 3.5F, -2F, 5, 1, 4); corpbas.setRotationPoint(0F, 18.5F, -5F); corpbas.setTextureSize(128, 32); corpbas.mirror = true; setRotation(corpbas, 0F, 1.570796F, 0F); corpcote1 = new ModelRenderer(this, 40, 11); corpcote1.addBox(-7.5F, 1F, 2.5F, 4, 2, 1); corpcote1.setRotationPoint(0F, 18.5F, -5F); corpcote1.setTextureSize(128, 32); corpcote1.mirror = true; setRotation(corpcote1, 0F, 1.570796F, 0F); corpscote2 = new ModelRenderer(this, 40, 11); corpscote2.addBox(-7.5F, 1F, -3.5F, 4, 2, 1); corpscote2.setRotationPoint(0F, 18.5F, -5F); corpscote2.setTextureSize(128, 32); corpscote2.mirror = true; setRotation(corpscote2, 0F, 1.570796F, 0F); debuttete = new ModelRenderer(this, 27, 0); debuttete.addBox(-1.5F, 0.5F, -2.5F, 1, 3, 5); debuttete.setRotationPoint(0F, 18.5F, -5F); debuttete.setTextureSize(128, 32); debuttete.mirror = true; setRotation(debuttete, 0F, 1.570796F, 0F); museau = new ModelRenderer(this, 28, 9); museau.addBox(-1F, 1F, -2F, 1, 2, 4); museau.setRotationPoint(0F, 18.5F, -5F); museau.setTextureSize(128, 32); museau.mirror = true; setRotation(museau, 0F, 1.570796F, 0F); corparriere = new ModelRenderer(this, 86, 0); corparriere.addBox(-8.5F, 0.5F, -2F, 1, 3, 4); corparriere.setRotationPoint(0F, 18.5F, -5F); corparriere.setTextureSize(128, 32); corparriere.mirror = true; setRotation(corparriere, 0F, 1.570796F, 0F); queuecentre = new ModelRenderer(this, 13, 0); queuecentre.addBox(-2.5F, 0F, -1F, 2, 2, 2); queuecentre.setRotationPoint(0F, 19.5F, 3F); queuecentre.setTextureSize(128, 32); queuecentre.mirror = true; setRotation(queuecentre, 0F, 1.570796F, 0F); queuecoter1 = new ModelRenderer(this, 13, 10); queuecoter1.addBox(-2F, -0.5F, -0.5F, 1, 3, 1); queuecoter1.setRotationPoint(0F, 19.5F, 3F); queuecoter1.setTextureSize(128, 32); queuecoter1.mirror = true; setRotation(queuecoter1, 0F, 1.570796F, 0F); queuecoter2 = new ModelRenderer(this, 13, 5); queuecoter2.addBox(-2F, 0.5F, -1.5F, 1, 1, 3); queuecoter2.setRotationPoint(0F, 19.5F, 3F); queuecoter2.setTextureSize(128, 32); queuecoter2.mirror = true; setRotation(queuecoter2, 0F, 1.570796F, 0F); queuearriere = new ModelRenderer(this, 18, 10); queuearriere.addBox(-3F, 0.5F, -0.5F, 1, 1, 1); queuearriere.setRotationPoint(0F, 19.5F, 3F); queuearriere.setTextureSize(128, 32); queuearriere.mirror = true; setRotation(queuearriere, 0F, 1.570796F, 0F); corne1 = new ModelRenderer(this, 106, 0); corne1.addBox(-5.5F, 0F, 3F, 2, 1, 2); corne1.setRotationPoint(0F, 18.5F, -5F); corne1.setTextureSize(128, 32); corne1.mirror = true; setRotation(corne1, 0F, 1.570796F, 0F); corne11 = new ModelRenderer(this, 106, 4); corne11.addBox(-5F, -0.3F, 1.5F, 1, 1, 3); corne11.setRotationPoint(0F, 18.5F, -5F); corne11.setTextureSize(128, 32); corne11.mirror = true; setRotation(corne11, 0F, 1.570796F, 0F); corne12 = new ModelRenderer(this, 108, 9); corne12.addBox(-5F, -1.2F, 4.5F, 1, 2, 1); corne12.setRotationPoint(0F, 18.5F, -5F); corne12.setTextureSize(128, 32); corne12.mirror = true; setRotation(corne12, 0F, 1.570796F, 0F); corne2 = new ModelRenderer(this, 106, 0); corne2.addBox(-5.5F, 0F, -5F, 2, 1, 2); corne2.setRotationPoint(0F, 18.5F, -5F); corne2.setTextureSize(128, 32); corne2.mirror = true; setRotation(corne2, 0F, 1.570796F, 0F); corne21 = new ModelRenderer(this, 106, 4); corne21.addBox(-5F, -0.3F, -4.5F, 1, 1, 3); corne21.setRotationPoint(0F, 18.5F, -5F); corne21.setTextureSize(128, 32); corne21.mirror = true; setRotation(corne21, 0F, 1.570796F, 0F); corne23 = new ModelRenderer(this, 108, 9); corne23.addBox(-5F, -1.2F, -5.5F, 1, 2, 1); corne23.setRotationPoint(0F, 18.5F, -5F); corne23.setTextureSize(128, 32); corne23.mirror = true; setRotation(corne23, 0F, 1.570796F, 0F); pied1 = new ModelRenderer(this, 0, 0); pied1.addBox(-0.5F, 0F, -0.5F, 1, 2, 1); pied1.setRotationPoint(2F, 22F, 1F); pied1.setTextureSize(128, 32); pied1.mirror = true; setRotation(pied1, 0F, 0F, 0F); pied2 = new ModelRenderer(this, 0, 0); pied2.addBox(-0.5F, 0F, -0.5F, 1, 2, 1); pied2.setRotationPoint(2F, 22F, -1.5F); pied2.setTextureSize(128, 32); pied2.mirror = true; setRotation(pied2, 0F, 0F, 0F); pied3 = new ModelRenderer(this, 0, 0); pied3.addBox(-0.5F, 0F, -0.5F, 1, 2, 1); pied3.setRotationPoint(-2F, 22F, -1.5F); pied3.setTextureSize(128, 32); pied3.mirror = true; setRotation(pied3, 0F, 0F, 0F); pied4 = new ModelRenderer(this, 0, 0); pied4.addBox(-0.5F, 0F, -0.5F, 1, 2, 1); pied4.setRotationPoint(-2F, 22F, 1F); pied4.setTextureSize(128, 32); pied4.mirror = true; setRotation(pied4, 0F, 0F, 0F); hautducorp = new ModelRenderer(this, 69, 1); hautducorp.addBox(-6.5F, -1F, -1.5F, 4, 1, 3); hautducorp.setRotationPoint(0F, 18.5F, -5F); hautducorp.setTextureSize(128, 32); hautducorp.mirror = true; setRotation(hautducorp, 0F, 1.570796F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); basecorps.render(f5); corphaut.render(f5); corpbas.render(f5); corpcote1.render(f5); corpscote2.render(f5); debuttete.render(f5); museau.render(f5); corparriere.render(f5); queuecentre.render(f5); queuecoter1.render(f5); queuecoter2.render(f5); queuearriere.render(f5); corne1.render(f5); corne11.render(f5); corne12.render(f5); corne2.render(f5); corne21.render(f5); corne23.render(f5); pied1.render(f5); pied2.render(f5); pied3.render(f5); pied4.render(f5); hautducorp.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.pied1.rotateAngleX = MathHelper.cos((180F / (float)Math.PI)) * 5F * f1; this.pied2.rotateAngleX = MathHelper.cos((180F / (float)Math.PI)) * -5F * f1; this.pied3.rotateAngleX = MathHelper.cos((180F / (float)Math.PI)) * -5F * f1; this.pied4.rotateAngleX = MathHelper.cos((180F / (float)Math.PI)) * 5F * f1; } }
Bah, j’ai pas vraiment de méthode d’animation justement ^^’ Je l’ai juste coller dans les rotations
J’ai un peux regarder dans les models de base, j’ai juste remarquer les if(tonenity.isRunning)) mais rien