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