當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityZombie.isArmsRaised方法代碼示例

本文整理匯總了Java中net.minecraft.entity.monster.EntityZombie.isArmsRaised方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityZombie.isArmsRaised方法的具體用法?Java EntityZombie.isArmsRaised怎麽用?Java EntityZombie.isArmsRaised使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.monster.EntityZombie的用法示例。


在下文中一共展示了EntityZombie.isArmsRaised方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setRotationAngles

import net.minecraft.entity.monster.EntityZombie; //導入方法依賴的package包/類
/**
 * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
 * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
 * "far" arms and legs can swing at most.
 */
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
    super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
    EntityZombie entityzombie = (EntityZombie)entityIn;
    float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
    float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
    this.bipedRightArm.rotateAngleZ = 0.0F;
    this.bipedLeftArm.rotateAngleZ = 0.0F;
    this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
    this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
    float f2 = -(float)Math.PI / (entityzombie.isArmsRaised() ? 1.5F : 2.25F);
    this.bipedRightArm.rotateAngleX = f2;
    this.bipedLeftArm.rotateAngleX = f2;
    this.bipedRightArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedLeftArm.rotateAngleX += f * 1.2F - f1 * 0.4F;
    this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
    this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
    this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:26,代碼來源:ModelZombieVillager.java


注:本文中的net.minecraft.entity.monster.EntityZombie.isArmsRaised方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。