use of logisticspipes.pipes.tubes.HSTubeLine.TubeLineRenderOrientation in project LogisticsPipes by RS485.
the class LineTubeRenderer method renderToList.
@Override
public void renderToList(CoreUnroutedPipe pipe, List<RenderEntry> objectsToRender) {
if (pipe instanceof HSTubeLine) {
HSTubeLine tube = (HSTubeLine) pipe;
if (tube.getOrientation() != null) {
TubeLineRenderOrientation speedupDirection = tube.getOrientation().getRenderOrientation();
objectsToRender.addAll(LineTubeRenderer.tubeLineBase.get(speedupDirection).stream().map(model -> new RenderEntry(model, new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(0, 0)) }, LineTubeRenderer.TEXTURE)).collect(Collectors.toList()));
}
}
}
use of logisticspipes.pipes.tubes.HSTubeLine.TubeLineRenderOrientation in project LogisticsPipes by RS485.
the class LineTubeRenderer method renderHighlight.
@Override
public void renderHighlight(ITubeOrientation orientation) {
TubeLineRenderOrientation direction = (TubeLineRenderOrientation) orientation.getRenderOrientation();
LineTubeRenderer.tubeLine.get(direction).copy().render(LPColourMultiplier.instance(0xFFFFFFFF));
}
use of logisticspipes.pipes.tubes.HSTubeLine.TubeLineRenderOrientation in project LogisticsPipes by RS485.
the class LineTubeRenderer method loadModels.
public static void loadModels() {
try {
Map<String, IModel3D> pipePartModels = SimpleServiceLocator.cclProxy.parseObjModels(LogisticsPipes.class.getResourceAsStream("/logisticspipes/models/HSTube-Line_result.obj"), 7, new LPScale(1 / 100f));
// tubeTurnMounts
for (TubeLineRenderOrientation turn : TubeLineRenderOrientation.values()) {
LineTubeRenderer.tubeLineBase.put(turn, new ArrayList<>());
}
pipePartModels.entrySet().stream().filter(entry -> entry.getKey().startsWith("Side ") || entry.getKey().contains(" Side ") || entry.getKey().endsWith(" Side")).forEach(entry -> {
LineTubeRenderer.tubeLineBase.get(TubeLineRenderOrientation.EAST_WEST).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPTranslation(0.0, 0.0, 0.0)).apply(new LPRotation(-Math.PI / 2, 0, 1, 0))));
LineTubeRenderer.tubeLineBase.get(TubeLineRenderOrientation.NORTH_SOUTH).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPTranslation(0.0, 0.0, 1.0))));
});
if (LineTubeRenderer.tubeLineBase.get(TubeLineRenderOrientation.EAST_WEST).size() != 4) {
throw new RuntimeException("Couldn't load Tube Side. Only loaded " + LineTubeRenderer.tubeLineBase.get(TubeLineRenderOrientation.EAST_WEST).size());
}
for (TubeLineRenderOrientation turn : TubeLineRenderOrientation.values()) {
LineTubeRenderer.tubeLine.put(turn, SimpleServiceLocator.cclProxy.combine(LineTubeRenderer.tubeLineBase.get(turn)));
}
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
Aggregations