本文整理汇总了Java中org.bukkit.util.EulerAngle.getY方法的典型用法代码示例。如果您正苦于以下问题:Java EulerAngle.getY方法的具体用法?Java EulerAngle.getY怎么用?Java EulerAngle.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.util.EulerAngle
的用法示例。
在下文中一共展示了EulerAngle.getY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEulerAngleFromDegree
import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
public static EulerAngle getEulerAngleFromDegree(Axis axis, EulerAngle ea, int angle, boolean relative) {
switch (axis) {
case PITCH:
double x = Math.toRadians(angle);
if (relative)
x += ea.getX();
return ea.setX(x);
case YAW:
double y = Math.toRadians(angle);
if (relative)
y += ea.getY();
return ea.setY(y);
case ROLL:
double z = Math.toRadians(angle);
if (relative)
z += ea.getZ();
return ea.setZ(z);
}
return null;
}
示例2: SLocation
import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
public SLocation(EulerAngle eulerAngle) {
super();
this.x = eulerAngle.getX();
this.y = eulerAngle.getY();
this.z = eulerAngle.getZ();
}
示例3: serialize
import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
@Override
public String serialize(EulerAngle angle) {
return "(" + angle.getX() + "," + angle.getY() + "," + angle.getZ() + ")";
}
示例4: setSingleAngle
import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
public int setSingleAngle(BodyPart part, Axis axis, int angle, boolean relative) {
try {
if (part == BodyPart.HEAD) {
EulerAngle ea = this.as.getHeadPose();
this.as.setHeadPose(getEulerAngleFromDegree(axis, ea, angle, relative));
if (relative) {
double rad = 0;
switch (axis) {
case YAW:
rad = ea.getX();
break;
case PITCH:
rad = ea.getY();
break;
case ROLL:
rad = ea.getZ();
break;
}
return (int) Math.toDegrees(rad);
}
} else if (part == BodyPart.BODY) {
this.as.setBodyPose(getEulerAngleFromDegree(axis, this.as.getBodyPose(), angle, relative));
return (relative) ? (int) Math.toDegrees(this.as.getBodyPose().getX()) : angle;
} else if (part == BodyPart.LEFTARM) {
this.as.setLeftArmPose(getEulerAngleFromDegree(axis, this.as.getLeftArmPose(), angle, relative));
return (relative) ? (int) Math.toDegrees(this.as.getLeftArmPose().getX()) : angle;
} else if (part == BodyPart.LEFTLEG) {
this.as.setLeftLegPose(getEulerAngleFromDegree(axis, this.as.getLeftLegPose(), angle, relative));
return (relative) ? (int) Math.toDegrees(this.as.getLeftLegPose().getX()) : angle;
} else if (part == BodyPart.RIGHTARM) {
this.as.setRightArmPose(getEulerAngleFromDegree(axis, this.as.getRightArmPose(), angle, relative));
return (relative) ? (int) Math.toDegrees(this.as.getRightArmPose().getX()) : angle;
} else if (part == BodyPart.RIGHTLEG) {
this.as.setRightLegPose(getEulerAngleFromDegree(axis, this.as.getRightLegPose(), angle, relative));
return (relative) ? (int) Math.toDegrees(this.as.getRightLegPose().getX()) : angle;
}
return angle;
} catch (NullPointerException e) {
throw new IllegalArgumentException("Null pointer at asp.setSingleAngle(" + part + ", " + axis + ", " + angle + ", " + relative + ")!");
}
}
示例5: of
import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
public static Vector3d of(EulerAngle angle) {
return new Vector3d(angle.getX(), angle.getY(), angle.getZ());
}