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


Java Translation类代码示例

本文整理汇总了Java中uk.co.qmunity.lib.transform.Translation的典型用法代码示例。如果您正苦于以下问题:Java Translation类的具体用法?Java Translation怎么用?Java Translation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Translation类属于uk.co.qmunity.lib.transform包,在下文中一共展示了Translation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderFrame2D

import uk.co.qmunity.lib.transform.Translation; //导入依赖的package包/类
public static boolean renderFrame2D(RenderHelper renderer, IIcon[] simple_, boolean[] hidden) {

        IIcon[] simple = new IIcon[6];
        for (int i = 0; i < 6; i++) {
            int pos = i;
            if (pos > 1)
                pos = 2 + (pos % 4);
            simple[pos] = simple_[i];
        }

        double d = 0.0025D / 2D;

        Translation tr = new Translation((hidden[4] ? d : 0) - (hidden[5] ? d : 0), (hidden[0] ? d : 0) - (hidden[1] ? d : 0),
                (hidden[2] ? d : 0) - (hidden[3] ? d : 0));
        Scale sc = new Scale((1 - d * 2) + (!hidden[4] ? d * 2 : 0) + (!hidden[5] ? d * 2 : 0), (1 - d * 2) + (!hidden[0] ? d * 2 : 0)
                + (!hidden[1] ? d * 2 : 0), (1 - d * 2) + (!hidden[2] ? d * 2 : 0) + (!hidden[3] ? d * 2 : 0));

        renderer.addTransformation(tr);
        renderer.addTransformation(sc);

        renderer.renderBox(new Vec3dCube(0, 0, 0, 1, 1, 1), simple);
        renderer.setRenderFromInside(true);
        renderer.renderBox(new Vec3dCube(0, 0, 0, 1, 1, 1), simple);
        renderer.setRenderFromInside(false);

        renderer.removeTransformations(2);

        return true;
    }
 
开发者ID:amadornes,项目名称:Framez,代码行数:30,代码来源:RenderFrame.java

示例2: renderBox

import uk.co.qmunity.lib.transform.Translation; //导入依赖的package包/类
public void renderBox(Vec3dCube cube, IIcon down, IIcon up, IIcon west, IIcon east, IIcon north, IIcon south) {

        if (cube.getMinX() < 0 || cube.getMinY() < 0 || cube.getMinZ() < 0 || cube.getMaxX() > 1 || cube.getMaxY() > 1
                || cube.getMaxZ() > 1) {
            if (renderingMethod == ExtensionRendering.SAME_TEXTURE) {
                LightingHelper h = lightingHelper;

                for (Pair<Pair<Vec3dCube, Translation>, boolean[]> data : cube.splitInto1x1()) {
                    sides = data.getValue();
                    Translation tr = data.getKey().getValue();

                    if (tr.getX() == 0 && tr.getY() == 0 && tr.getZ() == 0) {
                        lightingHelper = h;
                    } else {
                        Vec3d t = new Vec3d(tr.getX(), tr.getY(), tr.getZ()).transform(transformations);
                        lightingHelper = new LightingHelper(getWorld(),
                                new Vec3i((int) t.getX(), (int) t.getY(), (int) t.getZ()).add(getLocation()));
                    }

                    vertexTransformation = tr;
                    renderBox_do(data.getKey().getKey(), down, up, west, east, north, south);
                    vertexTransformation = null;
                }
                resetRenderedSides();

                lightingHelper = h;
            }
        } else {
            renderBox_do(cube, down, up, west, east, north, south);
        }
    }
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:32,代码来源:RenderHelper.java

示例3: renderFrame3D

import uk.co.qmunity.lib.transform.Translation; //导入依赖的package包/类
public static boolean renderFrame3D(RenderHelper renderer, IIcon[] borders_, IIcon border, IIcon[] cross_, IIcon[] simple_,
        boolean[] hidden, int pass) {

    if (Config.simple_frames) { // Only 2D render config option
        if (pass == 0) {
            return renderFrame2D(renderer, Config.click_through_frames ? borders_ : simple_, hidden);
        } else if (pass == 1 && Config.click_through_frames) {
            renderer.setOpacity(0.5);
            boolean result = renderFrame2D(renderer, simple_, hidden);
            renderer.setOpacity(1);
            return result;
        }
        return false;
    }

    IIcon[] borders = new IIcon[6];
    IIcon[] cross = new IIcon[6];
    IIcon[] simple = new IIcon[6];
    for (int i = 0; i < 6; i++) {
        int pos = i;
        if (pos > 1)
            pos = 2 + (pos % 4);
        borders[pos] = borders_[i];
        cross[pos] = cross_[i];
        simple[pos] = simple_[i];
    }

    double d = 0.0025D / 2D;

    Translation tr = new Translation((hidden[4] ? d : 0) - (hidden[5] ? d : 0), (hidden[0] ? d : 0) - (hidden[1] ? d : 0),
            (hidden[2] ? d : 0) - (hidden[3] ? d : 0));
    Scale sc = new Scale((1 - d * 2) + (!hidden[4] ? d * 2 : 0) + (!hidden[5] ? d * 2 : 0), (1 - d * 2) + (!hidden[0] ? d * 2 : 0)
            + (!hidden[1] ? d * 2 : 0), (1 - d * 2) + (!hidden[2] ? d * 2 : 0) + (!hidden[3] ? d * 2 : 0));

    if (pass == 0) {
        renderer.addTransformation(tr);
        renderer.addTransformation(sc);

        renderer.renderBox(new Vec3dCube(0, 0, 0, 1, 1, 1), borders);

        renderer.setRenderFromInside(true);
        {
            renderer.renderBox(new Vec3dCube(0, 2 / 16D, 2 / 16D, 1, 14 / 16D, 14 / 16D), border);
            renderer.renderBox(new Vec3dCube(2 / 16D, 0, 2 / 16D, 14 / 16D, 1, 14 / 16D), border);
            renderer.renderBox(new Vec3dCube(2 / 16D, 2 / 16D, 0, 14 / 16D, 14 / 16D, 1), border);
        }
        renderer.setRenderFromInside(false);
        if (!Config.click_through_frames) {
            renderer.setRenderFromInside(true);
            renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), cross);
            renderer.setRenderFromInside(false);
            renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), cross);
        }

        renderer.removeTransformations(2);

        return true;
    } else if (pass == 1 && Config.click_through_frames) {
        renderer.addTransformation(tr);
        renderer.addTransformation(sc);

        renderer.setOpacity(0.5);
        renderer.setRenderFromInside(true);
        renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), cross);
        renderer.setRenderFromInside(false);
        renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), cross);
        renderer.setOpacity(1);

        renderer.removeTransformations(2);
        return true;
    }
    return false;
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:74,代码来源:RenderFrame.java

示例4: splitInto1x1

import uk.co.qmunity.lib.transform.Translation; //导入依赖的package包/类
public List<Pair<Pair<Vec3dCube, Translation>, boolean[]>> splitInto1x1() {

        List<Pair<Pair<Vec3dCube, Translation>, boolean[]>> cubes = new ArrayList<Pair<Pair<Vec3dCube, Translation>, boolean[]>>();

        int minx = (int) Math.floor(getMinX());
        int miny = (int) Math.floor(getMinY());
        int minz = (int) Math.floor(getMinZ());
        int maxx = (int) Math.ceil(getMaxX());
        int maxy = (int) Math.ceil(getMaxY());
        int maxz = (int) Math.ceil(getMaxZ());

        for (int x = minx; x < maxx; x++) {
            for (int y = miny; y < maxy; y++) {
                for (int z = minz; z < maxz; z++) {
                    Translation t = new Translation(x, y, z);
                    Vec3dCube cube = new Vec3dCube(0, 0, 0, 1, 1, 1);
                    boolean[] sides = new boolean[6];

                    if (x == minx) {
                        cube.getMin().setX(getMinX() - minx);
                        sides[4] = true;
                    }
                    if (y == miny) {
                        cube.getMin().setY(getMinY() - miny);
                        sides[0] = true;
                    }
                    if (z == minz) {
                        cube.getMin().setZ(getMinZ() - minz);
                        sides[2] = true;
                    }

                    if (x == maxx - 1) {
                        cube.getMax().setX(getMaxX() - (maxx - 1));
                        sides[5] = true;
                    }
                    if (y == maxy - 1) {
                        cube.getMax().setY(getMaxY() - (maxy - 1));
                        sides[1] = true;
                    }
                    if (z == maxz - 1) {
                        cube.getMax().setZ(getMaxZ() - (maxz - 1));
                        sides[3] = true;
                    }

                    cube.fix();

                    cubes.add(new Pair<Pair<Vec3dCube, Translation>, boolean[]>(new Pair<Vec3dCube, Translation>(cube, t), sides));
                }
            }
        }

        return cubes;
    }
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:54,代码来源:Vec3dCube.java


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