Search in sources :

Example 1 with LPRotation

use of logisticspipes.proxy.object3d.operation.LPRotation 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);
    }
}
Also used : LogisticsNewRenderPipe(logisticspipes.renderer.newpipe.LogisticsNewRenderPipe) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LogisticsPipes(logisticspipes.LogisticsPipes) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) HashMap(java.util.HashMap) LPUVTranslation(logisticspipes.proxy.object3d.operation.LPUVTranslation) LPUVTransformationList(logisticspipes.proxy.object3d.operation.LPUVTransformationList) ArrayList(java.util.ArrayList) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) Map(java.util.Map) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) ISpecialPipeRenderer(logisticspipes.renderer.newpipe.ISpecialPipeRenderer) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) LPColourMultiplier(logisticspipes.proxy.object3d.operation.LPColourMultiplier) HSTubeCurve(logisticspipes.pipes.tubes.HSTubeCurve) ITubeOrientation(logisticspipes.interfaces.ITubeOrientation) IHighlightPlacementRenderer(logisticspipes.renderer.newpipe.IHighlightPlacementRenderer) Collectors(java.util.stream.Collectors) List(java.util.List) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) RenderEntry(logisticspipes.renderer.newpipe.RenderEntry) Pair(logisticspipes.utils.tuples.Pair) Entry(java.util.Map.Entry) ResourceLocation(net.minecraft.util.ResourceLocation) TurnDirection(logisticspipes.pipes.tubes.HSTubeCurve.TurnDirection) LPScale(logisticspipes.proxy.object3d.operation.LPScale) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) TurnDirection(logisticspipes.pipes.tubes.HSTubeCurve.TurnDirection) LogisticsPipes(logisticspipes.LogisticsPipes) LPScale(logisticspipes.proxy.object3d.operation.LPScale)

Example 2 with LPRotation

use of logisticspipes.proxy.object3d.operation.LPRotation 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);
    }
}
Also used : LogisticsNewRenderPipe(logisticspipes.renderer.newpipe.LogisticsNewRenderPipe) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LogisticsPipes(logisticspipes.LogisticsPipes) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) HashMap(java.util.HashMap) LPUVTranslation(logisticspipes.proxy.object3d.operation.LPUVTranslation) LPUVTransformationList(logisticspipes.proxy.object3d.operation.LPUVTransformationList) ArrayList(java.util.ArrayList) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) Map(java.util.Map) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) ISpecialPipeRenderer(logisticspipes.renderer.newpipe.ISpecialPipeRenderer) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) LPColourMultiplier(logisticspipes.proxy.object3d.operation.LPColourMultiplier) ITubeOrientation(logisticspipes.interfaces.ITubeOrientation) AxisAlignedBB(net.minecraft.util.AxisAlignedBB) IHighlightPlacementRenderer(logisticspipes.renderer.newpipe.IHighlightPlacementRenderer) Collectors(java.util.stream.Collectors) TubeGainRenderOrientation(logisticspipes.pipes.tubes.HSTubeGain.TubeGainRenderOrientation) List(java.util.List) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) HSTubeGain(logisticspipes.pipes.tubes.HSTubeGain) RenderEntry(logisticspipes.renderer.newpipe.RenderEntry) Pair(logisticspipes.utils.tuples.Pair) ResourceLocation(net.minecraft.util.ResourceLocation) LPScale(logisticspipes.proxy.object3d.operation.LPScale) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) LogisticsPipes(logisticspipes.LogisticsPipes) LPScale(logisticspipes.proxy.object3d.operation.LPScale) TubeGainRenderOrientation(logisticspipes.pipes.tubes.HSTubeGain.TubeGainRenderOrientation)

Example 3 with LPRotation

use of logisticspipes.proxy.object3d.operation.LPRotation in project LogisticsPipes by RS485.

the class SCurveTubeRenderer 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 (TurnSDirection turn : TurnSDirection.values()) {
            SCurveTubeRenderer.tubeSCurveBase.put(turn, new ArrayList<>());
        }
        pipePartModels.entrySet().stream().filter(entry -> entry.getKey().startsWith("Lane ") || entry.getKey().contains(" Lane ") || entry.getKey().endsWith(" Lane")).forEach(entry -> {
            SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.EAST).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPRotation(Math.PI / 2, 0, 0, 1)).apply(new LPTranslation(1.0, 0.0, 0.0)).apply(new LPRotation(-Math.PI / 2, 0, 1, 0))));
            SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.NORTH).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPRotation(Math.PI / 2, 0, 0, 1)).apply(new LPTranslation(1.0, 0.0, 1.0))));
            SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.EAST_INV).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPRotation(-Math.PI / 2, 0, 0, 1)).apply(new LPTranslation(-2.0, 1.0, 4.0)).apply(new LPRotation(Math.PI / 2, 0, 1, 0))));
            SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.NORTH_INV).add(LogisticsNewRenderPipe.compute(entry.getValue().twoFacedCopy().apply(new LPRotation(-Math.PI / 2, 0, 0, 1)).apply(new LPTranslation(-2.0, 1.0, 3.0)).apply(new LPRotation(Math.PI, 0, 1, 0))));
        });
        if (SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.NORTH).size() != 4) {
            throw new RuntimeException("Couldn't load Tube Lanes. Only loaded " + SCurveTubeRenderer.tubeSCurveBase.get(TurnSDirection.NORTH).size());
        }
        for (TurnSDirection turn : TurnSDirection.values()) {
            SCurveTubeRenderer.tubeSCurve.put(turn, SimpleServiceLocator.cclProxy.combine(SCurveTubeRenderer.tubeSCurveBase.get(turn)));
        }
    } catch (Throwable e) {
        throw new RuntimeException(e);
    }
}
Also used : LogisticsNewRenderPipe(logisticspipes.renderer.newpipe.LogisticsNewRenderPipe) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LogisticsPipes(logisticspipes.LogisticsPipes) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) HSTubeSCurve(logisticspipes.pipes.tubes.HSTubeSCurve) HashMap(java.util.HashMap) LPUVTranslation(logisticspipes.proxy.object3d.operation.LPUVTranslation) LPUVTransformationList(logisticspipes.proxy.object3d.operation.LPUVTransformationList) ArrayList(java.util.ArrayList) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) Map(java.util.Map) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) ISpecialPipeRenderer(logisticspipes.renderer.newpipe.ISpecialPipeRenderer) TurnSDirection(logisticspipes.pipes.tubes.HSTubeSCurve.TurnSDirection) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) Vec3(net.minecraft.util.Vec3) LPColourMultiplier(logisticspipes.proxy.object3d.operation.LPColourMultiplier) ITubeOrientation(logisticspipes.interfaces.ITubeOrientation) AxisAlignedBB(net.minecraft.util.AxisAlignedBB) IHighlightPlacementRenderer(logisticspipes.renderer.newpipe.IHighlightPlacementRenderer) Collectors(java.util.stream.Collectors) List(java.util.List) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) RenderEntry(logisticspipes.renderer.newpipe.RenderEntry) Pair(logisticspipes.utils.tuples.Pair) Entry(java.util.Map.Entry) ResourceLocation(net.minecraft.util.ResourceLocation) LPScale(logisticspipes.proxy.object3d.operation.LPScale) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LPRotation(logisticspipes.proxy.object3d.operation.LPRotation) TurnSDirection(logisticspipes.pipes.tubes.HSTubeSCurve.TurnSDirection) LogisticsPipes(logisticspipes.LogisticsPipes) LPScale(logisticspipes.proxy.object3d.operation.LPScale)

Aggregations

ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 LogisticsPipes (logisticspipes.LogisticsPipes)3 ITubeOrientation (logisticspipes.interfaces.ITubeOrientation)3 CoreUnroutedPipe (logisticspipes.pipes.basic.CoreUnroutedPipe)3 SimpleServiceLocator (logisticspipes.proxy.SimpleServiceLocator)3 I3DOperation (logisticspipes.proxy.object3d.interfaces.I3DOperation)3 IModel3D (logisticspipes.proxy.object3d.interfaces.IModel3D)3 LPColourMultiplier (logisticspipes.proxy.object3d.operation.LPColourMultiplier)3 LPRotation (logisticspipes.proxy.object3d.operation.LPRotation)3 LPScale (logisticspipes.proxy.object3d.operation.LPScale)3 LPTranslation (logisticspipes.proxy.object3d.operation.LPTranslation)3 LPUVTransformationList (logisticspipes.proxy.object3d.operation.LPUVTransformationList)3 LPUVTranslation (logisticspipes.proxy.object3d.operation.LPUVTranslation)3 IHighlightPlacementRenderer (logisticspipes.renderer.newpipe.IHighlightPlacementRenderer)3 ISpecialPipeRenderer (logisticspipes.renderer.newpipe.ISpecialPipeRenderer)3 LogisticsNewRenderPipe (logisticspipes.renderer.newpipe.LogisticsNewRenderPipe)3