本文整理匯總了Java中net.minecraft.entity.Entity.setRenderYawOffset方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.setRenderYawOffset方法的具體用法?Java Entity.setRenderYawOffset怎麽用?Java Entity.setRenderYawOffset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.Entity
的用法示例。
在下文中一共展示了Entity.setRenderYawOffset方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updatePassenger
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void updatePassenger(Entity passenger)
{
if (this.isPassenger(passenger))
{
float f = 0.0F;
float f1 = (float)((this.isDead ? 0.009999999776482582D : this.getMountedYOffset()) + passenger.getYOffset());
if (this.getPassengers().size() > 1)
{
int i = this.getPassengers().indexOf(passenger);
if (i == 0)
{
f = 0.2F;
}
else
{
f = -0.6F;
}
if (passenger instanceof EntityAnimal)
{
f = (float)((double)f + 0.2D);
}
}
Vec3d vec3d = (new Vec3d((double)f, 0.0D, 0.0D)).rotateYaw(-this.rotationYaw * 0.017453292F - ((float)Math.PI / 2F));
passenger.setPosition(this.posX + vec3d.xCoord, this.posY + (double)f1, this.posZ + vec3d.zCoord);
passenger.rotationYaw += this.deltaRotation;
passenger.setRotationYawHead(passenger.getRotationYawHead() + this.deltaRotation);
this.applyYawToEntity(passenger);
if (passenger instanceof EntityAnimal && this.getPassengers().size() > 1)
{
int j = passenger.getEntityId() % 2 == 0 ? 90 : 270;
passenger.setRenderYawOffset(((EntityAnimal)passenger).renderYawOffset + (float)j);
passenger.setRotationYawHead(passenger.getRotationYawHead() + (float)j);
}
}
}
示例2: applyYawToEntity
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
* Applies this boat's yaw to the given entity. Used to update the orientation of its passenger.
*/
protected void applyYawToEntity(Entity entityToUpdate)
{
entityToUpdate.setRenderYawOffset(this.rotationYaw);
float f = MathHelper.wrapDegrees(entityToUpdate.rotationYaw - this.rotationYaw);
float f1 = MathHelper.clamp(f, -105.0F, 105.0F);
entityToUpdate.prevRotationYaw += f1 - f;
entityToUpdate.rotationYaw += f1 - f;
entityToUpdate.setRotationYawHead(entityToUpdate.rotationYaw);
}
示例3: applyYawToEntity
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
* Applies this boat's yaw to the given entity. Used to update the orientation of its passenger.
*/
protected void applyYawToEntity(Entity entityToUpdate)
{
entityToUpdate.setRenderYawOffset(this.rotationYaw);
float f = MathHelper.wrapDegrees(entityToUpdate.rotationYaw - this.rotationYaw);
float f1 = MathHelper.clamp_float(f, -105.0F, 105.0F);
entityToUpdate.prevRotationYaw += f1 - f;
entityToUpdate.rotationYaw += f1 - f;
entityToUpdate.setRotationYawHead(entityToUpdate.rotationYaw);
}