use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class GuiFarmStation method drawForegroundImpl.
@Override
protected void drawForegroundImpl(int mouseX, int mouseY) {
super.drawForegroundImpl(mouseX, mouseY);
if (!isConfigOverlayEnabled()) {
for (int i = TileFarmStation.minSupSlot; i <= TileFarmStation.maxSupSlot; i++) {
if (getTileEntity().isSlotLocked(i)) {
Slot slot = inventorySlots.getSlot(i);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderUtil.renderQuad2D(slot.xPos, slot.yPos, 0, 16, 16, new Vector4f(0, 0, 0, 0.25));
GlStateManager.disableBlend();
}
}
}
}
use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class DefaultConduitRenderer method renderDynamicEntity.
// ------------ Dynamic ---------------------------------------------
@Override
public void renderDynamicEntity(@Nonnull TileEntitySpecialRenderer conduitBundleRenderer, @Nonnull IConduitBundle te, @Nonnull IClientConduit.WithDefaultRendering conduit, double x, double y, double z, float partialTick, float worldLight) {
Collection<CollidableComponent> components = conduit.getCollidableComponents();
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
for (CollidableComponent component : components) {
if (renderComponent(component)) {
float selfIllum = Math.max(worldLight, conduit.getSelfIlluminationForState(component));
final TextureAtlasSprite transmitionTextureForState = conduit.getTransmitionTextureForState(component);
if (isNSEWUD(component.dir) && transmitionTextureForState != null) {
Vector4f color = conduit.getTransmitionTextureColorForState(component);
renderTransmissionDynamic(conduit, transmitionTextureForState, color, component, selfIllum);
}
TextureAtlasSprite tex = conduit.getTextureForState(component);
if (tex == null) {
tex = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
}
renderConduitDynamic(tex, conduit, component, selfIllum);
}
}
}
use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class LiquidConduitRenderer method computeFluidOutlineToCache.
public static List<CachableRenderStatement> computeFluidOutlineToCache(CollidableComponent component, Fluid fluid, double scaleFactor, float outlineWidth) {
Map<Fluid, List<CachableRenderStatement>> cache0 = cache.get(component);
if (cache0 == null) {
cache0 = new HashMap<Fluid, List<CachableRenderStatement>>();
cache.put(component, cache0);
}
List<CachableRenderStatement> data = cache0.get(fluid);
if (data != null) {
return data;
}
data = new ArrayList<CachableRenderStatement>();
cache0.put(fluid, data);
TextureAtlasSprite texture = RenderUtil.getStillTexture(fluid);
if (texture == null) {
return data;
}
int color = fluid.getColor();
Vector4f colorv = new Vector4f((color >> 16 & 0xFF) / 255d, (color >> 8 & 0xFF) / 255d, (color & 0xFF) / 255d, 1);
BoundingBox bbb;
double width = outlineWidth;
scaleFactor = scaleFactor - 0.05;
double xScale = Math.abs(component.dir.getFrontOffsetX()) == 1 ? width : scaleFactor;
double yScale = Math.abs(component.dir.getFrontOffsetY()) == 1 ? width : scaleFactor;
double zScale = Math.abs(component.dir.getFrontOffsetZ()) == 1 ? width : scaleFactor;
double offSize = (0.5 - width) / 2 - width / 2;
double xOff = component.dir.getFrontOffsetX() * offSize;
double yOff = component.dir.getFrontOffsetY() * offSize;
double zOff = component.dir.getFrontOffsetZ() * offSize;
bbb = component.bound.scale(xScale, yScale, zScale);
bbb = bbb.translate(new Vector3d(xOff, yOff, zOff));
for (EnumFacing face : EnumFacing.VALUES) {
if (face != component.dir && face != component.dir.getOpposite()) {
List<Vertex> corners = bbb.getCornersWithUvForFace(face, texture.getMinU(), texture.getMaxU(), texture.getMinV(), texture.getMaxV());
for (Vertex corner : corners) {
data.add(new CachableRenderStatement.AddVertexWithUV(corner.x(), corner.y(), corner.z(), corner.uv.x, corner.uv.y, colorv));
}
}
}
return data;
}
use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class PowerConduitRenderer method addConduitQuads.
@Override
protected void addConduitQuads(@Nonnull IConduitBundle bundle, @Nonnull IConduit conduit, @Nonnull TextureAtlasSprite tex, @Nonnull CollidableComponent component, float selfIllum, BlockRenderLayer layer, @Nonnull List<BakedQuad> quads) {
if (IPowerConduit.COLOR_CONTROLLER_ID.equals(component.data)) {
IPowerConduit pc = (IPowerConduit) conduit;
ConnectionMode conMode = pc.getConnectionMode(component.dir);
if (conduit.containsExternalConnection(component.dir) && pc.getExtractionRedstoneMode(component.dir) != RedstoneControlMode.IGNORE && conMode != ConnectionMode.DISABLED) {
int cInt = ((IPowerConduit) conduit).getExtractionSignalColor(component.dir).getColor();
Vector4f col = ColorUtil.toFloat4(cInt);
BoundingBox bound = component.bound;
if (conMode != ConnectionMode.IN_OUT && conMode != ConnectionMode.NOT_SET) {
Vector3d trans = ForgeDirectionOffsets.offsetScaled(component.dir, -0.12);
bound = bound.translate(trans);
}
addQuadsForSection(bound, tex, component.dir, quads, col);
}
return;
}
super.addConduitQuads(bundle, conduit, tex, component, selfIllum, layer, quads);
if (component.dir == null) {
return;
}
IPowerConduit pc = (IPowerConduit) conduit;
ConnectionMode mode = pc.getConnectionMode(component.dir);
if (mode != ConnectionMode.INPUT && mode != ConnectionMode.OUTPUT) {
return;
}
if (mode == ConnectionMode.INPUT) {
tex = pc.getTextureForInputMode();
} else {
tex = pc.getTextureForOutputMode();
}
Offset offset = bundle.getOffset(IPowerConduit.class, component.dir);
ConnectionModeGeometry.addModeConnectorQuads(component.dir, offset, tex, null, quads);
}
use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class DefaultConduitRenderer method addBakedQuads.
// ------------ Static Model ---------------------------------------------
@Override
public void addBakedQuads(@Nonnull TileEntitySpecialRenderer<?> conduitBundleRenderer, @Nonnull IConduitBundle bundle, @Nonnull IClientConduit.WithDefaultRendering conduit, float brightness, @Nonnull BlockRenderLayer layer, List<BakedQuad> quads) {
Collection<CollidableComponent> components = conduit.getCollidableComponents();
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
for (CollidableComponent component : components) {
if (renderComponent(component)) {
float selfIllum = Math.max(brightness, conduit.getSelfIlluminationForState(component));
final TextureAtlasSprite transmitionTextureForState = conduit.getTransmitionTextureForState(component);
if (layer != null && isNSEWUD(component.dir) && transmitionTextureForState != null) {
Vector4f color = conduit.getTransmitionTextureColorForState(component);
addTransmissionQuads(transmitionTextureForState, color, conduit, component, selfIllum, quads);
}
TextureAtlasSprite tex = conduit.getTextureForState(component);
if (tex == null) {
tex = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
}
addConduitQuads(bundle, conduit, tex, component, selfIllum, layer, quads);
}
}
}
Aggregations