public double getArea() { return sizeX() * sizeY() * sizeZ(); }
@Override protected void setVerticesForTransmission(@Nonnull BoundingBox bound, @Nonnull EnumFacing id) { float yScale = getRatioForConnection(id); float scale = 0.7f; float xs = id.getFrontOffsetX() == 0 ? scale : 1; float ys = id.getFrontOffsetY() == 0 ? Math.min(yScale, scale) : yScale; float zs = id.getFrontOffsetZ() == 0 ? scale : 1; double sizeY = bound.sizeY(); bound = bound.scale(xs, ys, zs); double transY = (bound.sizeY() - sizeY) / 2; Vector3d translation = new Vector3d(0, transY + 0.025, 0); setupVertices(bound.translate(translation)); }
public @Nonnull BoundingBox createBoundsForConnectionController(@Nonnull EnumFacing dir, @Nonnull Offset offset) { Vector3d nonUniformScale = ForgeDirectionOffsets.forDirCopy(dir); nonUniformScale.scale(0.5); nonUniformScale.x = 0.8 * (1 - Math.abs(nonUniformScale.x)); nonUniformScale.y = 0.8 * (1 - Math.abs(nonUniformScale.y)); nonUniformScale.z = 0.8 * (1 - Math.abs(nonUniformScale.z)); BoundingBox bb = CORE_BOUNDS; bb = bb.scale(nonUniformScale.x, nonUniformScale.y, nonUniformScale.z); double offsetFromEnd = Math.min(bb.sizeX(), bb.sizeY()); offsetFromEnd = Math.min(offsetFromEnd, bb.sizeZ()); offsetFromEnd = Math.max(offsetFromEnd, 0.075); double transMag = 0.5 - (offsetFromEnd * 1.2); Vector3d trans = ForgeDirectionOffsets.forDirCopy(dir); trans.scale(transMag); bb = bb.translate(trans); bb = bb.translate(getTranslation(dir, offset)); return bb; }
private void mkRangeLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasRange) { if (mode != ProbeMode.NORMAL || TopConfig.showRangeByDefault.get()) { int sizeX = (int) data.bounds.sizeX(); int sizeY = (int) data.bounds.sizeY(); int sizeZ = (int) data.bounds.sizeZ(); addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.SHOW_RANGE) .text(loc("top.range.header", EnderIO.lang.localize("top.range", sizeX, sizeY, sizeZ))); } else { eiobox.addMore(); } } }