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