Search in sources :

Example 21 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateBase method addOcclusionBoxes.

public void addOcclusionBoxes(List<Vec3dCube> boxes) {
    boxes.add(new Vec3dCube(2 / 16D, 0, 0, 1 - 2 / 16D, 2D / 16D, 1));
    boxes.add(new Vec3dCube(0, 0, 2 / 16D, 1, 2D / 16D, 1 - 2 / 16D));
}
Also used : Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 22 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateBase method addCollisionBoxesToList.

// Occlusion, selection and collision boxes
@Override
public final void addCollisionBoxesToList(List<Vec3dCube> boxes, Entity entity) {
    List<Vec3dCube> boxes_ = new ArrayList<Vec3dCube>();
    addCollisionBoxes(boxes_, entity);
    VectorHelper.rotateBoxes(boxes_, getFace(), getRotation());
    for (Vec3dCube c : boxes_) boxes.add(c);
}
Also used : ArrayList(java.util.ArrayList) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 23 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class PartCageLamp method renderGlow.

@Override
@SideOnly(Side.CLIENT)
public void renderGlow(int pass) {
    Vec3dCube vector = new Vec3dCube(5 / 16D, 2 / 16D, 5 / 16D, 11 / 16D, 11 / 16D, 11 / 16D).rotate(getFace(), Vec3d.center);
    double r = ((color.getHex() & 0xFF0000) >> 16) / 256D;
    double g = ((color.getHex() & 0x00FF00) >> 8) / 256D;
    double b = (color.getHex() & 0x0000FF) / 256D;
    if (pass == 1) {
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glBegin(GL11.GL_QUADS);
        com.bluepowermod.client.render.RenderHelper.drawColoredCube(vector.clone().expand(0.5 / 16D), r, g, b, ((inverted ? 255 - (power & 0xFF) : (power & 0xFF)) / 255D) * 0.625);
        GL11.glEnd();
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glDisable(GL11.GL_BLEND);
    }
}
Also used : Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 24 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class PartFixture method renderLamp.

/**
     * @author Koen Beckers (K4Unl), Amadornes
     */
@Override
@SideOnly(Side.CLIENT)
public void renderLamp(RenderHelper renderer) {
    Vec3dCube vector = new Vec3dCube(2 / 16D, 0.0, 2 / 16D, 1.0 - (2 / 16D), 2 / 16D, 1.0 - 2 / 16D);
    IIcon topIcon = IconSupplier.fixtureFootTop;
    IIcon sideIcon = IconSupplier.fixtureFootSide;
    renderer.renderBox(vector, topIcon, topIcon, sideIcon, sideIcon, sideIcon, sideIcon);
    vector = new Vec3dCube(3 / 16D, 2 / 16D, 3 / 16D, 1.0 - (3 / 16D), 8 / 16D, 13 / 16D);
    if (inverted ? (power & 0xFF) == 255 : power == 0) {
        sideIcon = IconSupplier.fixtureLampSideOff;
        topIcon = IconSupplier.fixtureLampTopOff;
    } else {
        sideIcon = IconSupplier.fixtureLampSideOn;
        topIcon = IconSupplier.fixtureLampTopOn;
    }
    renderer.setColor(color.getHex());
    renderer.renderBox(vector, topIcon, topIcon, sideIcon, sideIcon, sideIcon, sideIcon);
    renderer.setColor(0xFFFFFF);
}
Also used : IIcon(net.minecraft.util.IIcon) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 25 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class PartFixture method getSelectionBoxes.

/**
     * @author Koen Beckers (K4Unl), Amadornes
     */
@Override
public List<Vec3dCube> getSelectionBoxes() {
    List<Vec3dCube> boxes = new ArrayList<Vec3dCube>();
    boxes.add(new Vec3dCube(2 / 16D, 0.0, 2 / 16D, 14 / 16D, 2 / 16D, 14 / 16D).rotate(getFace(), Vec3d.center));
    boxes.add(new Vec3dCube(3 / 16D, 2 / 16D, 3 / 16D, 13 / 16D, 8 / 16D, 13 / 16D).expand(0.5 / 16D).rotate(getFace(), Vec3d.center));
    return boxes;
}
Also used : ArrayList(java.util.ArrayList) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Aggregations

Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)37 SideOnly (cpw.mods.fml.relauncher.SideOnly)13 IIcon (net.minecraft.util.IIcon)11 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)8 ArrayList (java.util.ArrayList)7 Rotation (uk.co.qmunity.lib.transform.Rotation)6 Translation (uk.co.qmunity.lib.transform.Translation)5 TubeColor (com.bluepowermod.api.tube.IPneumaticTube.TubeColor)3 RenderHelper (uk.co.qmunity.lib.client.render.RenderHelper)3 IScrewdriver (com.bluepowermod.api.misc.IScrewdriver)2 BlockLamp (com.bluepowermod.block.machine.BlockLamp)2 ItemPart (com.bluepowermod.item.ItemPart)2 PartRedwireFaceUninsulated (com.bluepowermod.part.wire.redstone.PartRedwireFace.PartRedwireFaceUninsulated)2 ItemStack (net.minecraft.item.ItemStack)2 Vec3d (uk.co.qmunity.lib.vec.Vec3d)2 Vec3i (uk.co.qmunity.lib.vec.Vec3i)2 IGateComponent (com.bluepowermod.api.gate.IGateComponent)1 IIntegratedCircuitPart (com.bluepowermod.api.gate.IIntegratedCircuitPart)1 BPPart (com.bluepowermod.part.BPPart)1 GateComponentQuartzResonator (com.bluepowermod.part.gate.component.GateComponentQuartzResonator)1