Package org.terasology.math

Examples of org.terasology.math.Rect2f.height()


                textureMat.setFloat2("scale", scale);
                textureMat.setFloat2("offset",
                        absoluteRegion.minX(),
                        absoluteRegion.minY());

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
            case SCALE_FILL: {
                textureMat.setFloat2("offset", absoluteRegion.minX(), absoluteRegion.minY());
View Full Code Here


                textureMat.setFloat2("offset",
                        absoluteRegion.minX(),
                        absoluteRegion.minY());

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
            case SCALE_FILL: {
                textureMat.setFloat2("offset", absoluteRegion.minX(), absoluteRegion.minY());
                textureMat.setFloat2("scale", absoluteRegion.width(), absoluteRegion.height());
View Full Code Here

                float texBorderX = (scale.x - absoluteRegion.width()) / scale.x * uw;
                float texBorderY = (scale.y - absoluteRegion.height()) / scale.y * uh;

                textureMat.setFloat2("texOffset", textureArea.minX() + (ux + 0.5f * texBorderX) * textureArea.width()
                        , textureArea.minY() + (uy + 0.5f * texBorderY) * textureArea.height());
                textureMat.setFloat2("texSize", (uw - texBorderX) * textureArea.width(), (uh - texBorderY) * textureArea.height());
                break;
            }
            default: {
                textureMat.setFloat2("scale", scale);
View Full Code Here

                float texBorderX = (scale.x - absoluteRegion.width()) / scale.x * uw;
                float texBorderY = (scale.y - absoluteRegion.height()) / scale.y * uh;

                textureMat.setFloat2("texOffset", textureArea.minX() + (ux + 0.5f * texBorderX) * textureArea.width()
                        , textureArea.minY() + (uy + 0.5f * texBorderY) * textureArea.height());
                textureMat.setFloat2("texSize", (uw - texBorderX) * textureArea.width(), (uh - texBorderY) * textureArea.height());
                break;
            }
            default: {
                textureMat.setFloat2("scale", scale);
                textureMat.setFloat2("offset",
View Full Code Here

                textureMat.setFloat2("scale", scale);
                textureMat.setFloat2("offset",
                        absoluteRegion.minX() + 0.5f * (absoluteRegion.width() - scale.x),
                        absoluteRegion.minY() + 0.5f * (absoluteRegion.height() - scale.y));

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
        }

View Full Code Here

                textureMat.setFloat2("offset",
                        absoluteRegion.minX() + 0.5f * (absoluteRegion.width() - scale.x),
                        absoluteRegion.minY() + 0.5f * (absoluteRegion.height() - scale.y));

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
        }

        textureMat.setTexture("texture", texture.getTexture());
View Full Code Here

        }
        textureMat.setFloat2("scale", region.width(), region.height());
        textureMat.setFloat2("offset", region.minX(), region.minY());

        Rect2f textureArea = texture.getRegion();
        textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
        textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());

        textureMat.setTexture("texture", texture.getTexture());
        textureMat.setFloat4("color", 1, 1, 1, alpha);
        textureMat.bindTextures();
View Full Code Here

        textureMat.setFloat2("scale", region.width(), region.height());
        textureMat.setFloat2("offset", region.minX(), region.minY());

        Rect2f textureArea = texture.getRegion();
        textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
        textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());

        textureMat.setTexture("texture", texture.getTexture());
        textureMat.setFloat4("color", 1, 1, 1, alpha);
        textureMat.bindTextures();
        mesh.render();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.