当前位置: 首页>>代码示例>>Java>>正文


Java EulerAngle.getY方法代码示例

本文整理汇总了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;
}
 
开发者ID:Phoenix616,项目名称:EditArmorStands,代码行数:21,代码来源:ArmorStandPoser.java

示例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();
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:7,代码来源:SLocation.java

示例3: serialize

import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
@Override
public String serialize(EulerAngle angle) {
    return "(" + angle.getX() + "," + angle.getY() + "," + angle.getZ() + ")";
}
 
开发者ID:caseif,项目名称:Steel,代码行数:5,代码来源:EulerAngleSerializer.java

示例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 + ")!");
    }
}
 
开发者ID:Phoenix616,项目名称:EditArmorStands,代码行数:46,代码来源:ArmorStandPoser.java

示例5: of

import org.bukkit.util.EulerAngle; //导入方法依赖的package包/类
public static Vector3d of(EulerAngle angle) {
    return new Vector3d(angle.getX(), angle.getY(), angle.getZ());
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:4,代码来源:EulerAngleConverter.java


注:本文中的org.bukkit.util.EulerAngle.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。