Search in sources :

Example 6 with Vector3d

use of logisticspipes.utils.math.Vector3d in project LogisticsPipes by RS485.

the class SideConfigDisplay method renderScene.

private void renderScene() {
    GlStateManager.enableCull();
    GlStateManager.enableRescaleNormal();
    RenderHelper.disableStandardItemLighting();
    mc.entityRenderer.disableLightmap();
    RenderUtil.bindBlockTexture();
    GlStateManager.disableLighting();
    GlStateManager.enableTexture2D();
    GlStateManager.enableAlpha();
    Vector3d trans = new Vector3d((-origin.x) + eye.x, (-origin.y) + eye.y, (-origin.z) + eye.z);
    BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer();
    try {
        for (BlockRenderLayer layer : BlockRenderLayer.values()) {
            ForgeHooksClient.setRenderLayer(layer);
            setGlStateForPass(layer, false);
            doWorldRenderPass(trans, configurables, layer);
        }
        if (renderNeighbours) {
            for (BlockRenderLayer layer : BlockRenderLayer.values()) {
                ForgeHooksClient.setRenderLayer(layer);
                setGlStateForPass(layer, true);
                doWorldRenderPass(trans, neighbours, layer);
            }
        }
    } finally {
        ForgeHooksClient.setRenderLayer(renderLayer);
    }
    RenderHelper.enableStandardItemLighting();
    GlStateManager.enableLighting();
    TileEntityRendererDispatcher.instance.entityX = origin.x - eye.x;
    TileEntityRendererDispatcher.instance.entityY = origin.y - eye.y;
    TileEntityRendererDispatcher.instance.entityZ = origin.z - eye.z;
    TileEntityRendererDispatcher.staticPlayerX = origin.x - eye.x;
    TileEntityRendererDispatcher.staticPlayerY = origin.y - eye.y;
    TileEntityRendererDispatcher.staticPlayerZ = origin.z - eye.z;
    for (int pass = 0; pass < 2; pass++) {
        ForgeHooksClient.setRenderPass(pass);
        setGlStateForPass(pass, false);
        doTileEntityRenderPass(configurables, pass);
        if (renderNeighbours) {
            setGlStateForPass(pass, true);
            doTileEntityRenderPass(neighbours, pass);
        }
    }
    ForgeHooksClient.setRenderPass(-1);
    setGlStateForPass(0, false);
}
Also used : Vector3d(logisticspipes.utils.math.Vector3d) BlockRenderLayer(net.minecraft.util.BlockRenderLayer)

Aggregations

Vector3d (logisticspipes.utils.math.Vector3d)6 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)2 BoundingBox (logisticspipes.utils.math.BoundingBox)1 Vector2d (logisticspipes.utils.math.Vector2d)1 Vertex (logisticspipes.utils.math.Vertex)1 Minecraft (net.minecraft.client.Minecraft)1 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)1 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 TileEntity (net.minecraft.tileentity.TileEntity)1 TileEntityChest (net.minecraft.tileentity.TileEntityChest)1 BlockRenderLayer (net.minecraft.util.BlockRenderLayer)1