Search in sources :

Example 1 with LPUVScale

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

the class LogisticsNewSolidBlockWorldRenderer method computeRotated.

private static Map<BlockRotation, IModel3D> computeRotated(IModel3D m) {
    m.apply(new LPUVScale(1, 0.75));
    Map<BlockRotation, IModel3D> map = new HashMap<>();
    for (BlockRotation rot : BlockRotation.values()) {
        IModel3D model = m.copy();
        switch(rot.getInteger()) {
            case 0:
                model.apply(LPRotation.sideOrientation(0, 3));
                model.apply(new LPTranslation(0, 0, 1));
                break;
            case 1:
                model.apply(LPRotation.sideOrientation(0, 1));
                model.apply(new LPTranslation(1, 0, 0));
                break;
            case 2:
                break;
            case 3:
                model.apply(LPRotation.sideOrientation(0, 2));
                model.apply(new LPTranslation(1, 0, 1));
                break;
        }
        model.computeNormals();
        model.computeStandardLighting();
        map.put(rot, model);
    }
    return map;
}
Also used : LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) LPUVScale(logisticspipes.proxy.object3d.operation.LPUVScale) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 IModel3D (logisticspipes.proxy.object3d.interfaces.IModel3D)1 LPTranslation (logisticspipes.proxy.object3d.operation.LPTranslation)1 LPUVScale (logisticspipes.proxy.object3d.operation.LPUVScale)1