use of logisticspipes.pipes.tubes.HSTubeGain.TubeGainRenderOrientation in project LogisticsPipes by RS485.
the class GainTubeRenderer method loadModels.
public static void loadModels() {
try {
Map<String, IModel3D> pipePartModels = SimpleServiceLocator.cclProxy.parseObjModels(LogisticsPipes.class.getResourceAsStream("/logisticspipes/models/HSTube-Gain_result.obj"), 7, new LPScale(1 / 100f));
// tubeTurnMounts
for (TubeGainRenderOrientation turn : TubeGainRenderOrientation.values()) {
GainTubeRenderer.tubeTurnBase.put(turn, new ArrayList<>());
}
pipePartModels.entrySet().stream().filter(entry -> entry.getKey().startsWith("Lane ") || entry.getKey().contains(" Lane ") || entry.getKey().endsWith(" Lane")).forEach(entry -> {
GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.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))));
GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.NORTH).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPTranslation(0.0, 0.0, 1.0))));
GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.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))));
GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.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 (GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.NORTH).size() != 4) {
throw new RuntimeException("Couldn't load Tube Lanes. Only loaded " + GainTubeRenderer.tubeTurnBase.get(TubeGainRenderOrientation.NORTH).size());
}
for (TubeGainRenderOrientation turn : TubeGainRenderOrientation.values()) {
GainTubeRenderer.tubeGain.put(turn, SimpleServiceLocator.cclProxy.combine(GainTubeRenderer.tubeTurnBase.get(turn)));
}
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
Aggregations