本文整理汇总了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);
}