TerminalPartModel.java 文件源码

java
阅读 13 收藏 0 点赞 0 评论 0

项目:Toms-Mod 作者:
private static Matrix4f getMatrix(TerminalFacing facing, boolean mirror) {
    if (mirror) {
        switch (facing) {
        case DOWN_EAST:
            return ModelRotation.X270_Y270.getMatrix();
        case DOWN_NORTH:
            return ModelRotation.X270_Y180.getMatrix();
        case DOWN_SOUTH:
            return ModelRotation.X270_Y0.getMatrix();
        case DOWN_WEST:
            return ModelRotation.X270_Y90.getMatrix();
        case EAST:
            return ModelRotation.X0_Y90.getMatrix();
        case NORTH:
            return ModelRotation.X0_Y0.getMatrix();
        case SOUTH:
            return ModelRotation.X0_Y180.getMatrix();
        case UP_EAST:
            return ModelRotation.X90_Y270.getMatrix();
        case UP_NORTH:
            return ModelRotation.X90_Y180.getMatrix();
        case UP_SOUTH:
            return ModelRotation.X90_Y0.getMatrix();
        case UP_WEST:
            return ModelRotation.X90_Y90.getMatrix();
        case WEST:
            return ModelRotation.X0_Y270.getMatrix();
        default:
            return new Matrix4f();
        }
    } else {
        switch (facing) {
        case DOWN_EAST:
            return ModelRotation.X180_Y90.getMatrix();
        case DOWN_NORTH:
            return ModelRotation.X180_Y0.getMatrix();
        case DOWN_SOUTH:
            return ModelRotation.X180_Y180.getMatrix();
        case DOWN_WEST:
            return ModelRotation.X180_Y270.getMatrix();
        case EAST:
            return ModelRotation.X270_Y270.getMatrix();
        case NORTH:
            return ModelRotation.X270_Y180.getMatrix();
        case SOUTH:
            return ModelRotation.X270_Y0.getMatrix();
        case UP_EAST:
            return ModelRotation.X0_Y90.getMatrix();
        case UP_NORTH:
            return ModelRotation.X0_Y0.getMatrix();
        case UP_SOUTH:
            return ModelRotation.X0_Y180.getMatrix();
        case UP_WEST:
            return ModelRotation.X0_Y270.getMatrix();
        case WEST:
            return ModelRotation.X270_Y90.getMatrix();
        default:
            return new Matrix4f();
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号