public @Nonnull BoundingBox translate(@Nonnull Vector3f vec) { return translate(vec.x, vec.y, vec.z); }
public @Nonnull BoundingBox translate(@Nonnull Vector3d translation) { return translate((float) translation.x, (float) translation.y, (float) translation.z); }
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 static void addColorBand(@Nonnull IClientConduit conduit, @Nonnull CollidableComponent component, @Nonnull List<BakedQuad> quads, @Nonnull EnumFacing dir, @Nonnull ConnectionMode mode) { if (IPowerConduit.COLOR_CONTROLLER_ID.equals(component.data) && (conduit instanceof IExtractor)) { IExtractor pc = (IExtractor) conduit; final RedstoneControlMode extractionRedstoneMode = pc.getExtractionRedstoneMode(dir); if (extractionRedstoneMode != RedstoneControlMode.IGNORE && extractionRedstoneMode != RedstoneControlMode.NEVER && mode.acceptsInput()) { int cInt = pc.getExtractionSignalColor(dir).getColor(); BoundingBox bound = component.bound; if (mode != ConnectionMode.NOT_SET) { Vector3d trans = ForgeDirectionOffsets.offsetScaled(dir, -0.12); bound = trans != null ? bound.translate(trans) : bound; } for (EnumFacing face : EnumFacing.VALUES) { if (face != null && face != dir) { BakedQuadBuilder.addBakedQuadForFace(quads, bound, White.INSTANCE, face, ConduitTexture.FULL, false, false, ColorUtil.toFloat4(cInt)); } } } } }
@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)); }
bbb = bbb.translate(new Vector3d(xOff, yOff, zOff));
dir = dir.getOpposite(); float trans = 0.0125f; minBB = minBB.translate(dir.getFrontOffsetX() * trans, dir.getFrontOffsetY() * trans, dir.getFrontOffsetZ() * trans); float scale = 0.7f; minBB = minBB.scale(1 + Math.abs(dir.getFrontOffsetX()) * scale, 1 + Math.abs(dir.getFrontOffsetY()) * scale,