use of uk.co.qmunity.lib.transform.Transformation in project BluePower by Qmunity.
the class GateBase method renderStatic.
@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
Transformation t = null;
if (getFace() == ForgeDirection.UP)
t = new Rotation(180, 180, 0, Vec3d.center);
if (getFace() == ForgeDirection.NORTH)
t = new Rotation(90, 0, 0, Vec3d.center);
if (getFace() == ForgeDirection.SOUTH)
t = new Rotation(-90, 0, 0, Vec3d.center);
if (getFace() == ForgeDirection.WEST)
t = new Rotation(0, 0, -90, Vec3d.center);
if (getFace() == ForgeDirection.EAST)
t = new Rotation(0, 0, 90, Vec3d.center);
if (t != null)
renderer.addTransformation(t);
int rotation = getRotation();
if (rotation != -1)
renderer.addTransformation(new Rotation(0, 90 * -rotation, 0));
renderer.renderBox(BOX, getIcon(ForgeDirection.DOWN), getIcon(ForgeDirection.UP), getIcon(ForgeDirection.WEST), getIcon(ForgeDirection.EAST), getIcon(ForgeDirection.NORTH), getIcon(ForgeDirection.SOUTH));
for (IGateComponent c : getComponents()) c.renderStatic(translation, renderer, pass);
return true;
}
use of uk.co.qmunity.lib.transform.Transformation in project BluePower by Qmunity.
the class GateComponentCubes method onLayoutRefresh.
@Override
public void onLayoutRefresh() {
if (layoutColor == -1)
return;
cubes.clear();
double height = getHeight();
double scale = 1D / getGate().getLayout().getLayout(layoutColor).getWidth();
Transformation transformation = new Scale(scale, 1, scale);
for (Rectangle r : getGate().getLayout().getSimplifiedLayout(layoutColor).getRectangles()) cubes.add(new Vec2dRect(r).extrude(height).transform(transformation).add(-0.5 + 1 / 64D, 2 / 16D, -0.5 + 1 / 64D));
}
Aggregations