Exemplo n.º 1
0
    protected Vox.Mutator buildMutator(Vox.VoxelEditor editor, Vector3 point)
    {
        // check for subtraction mode
        byte opacity = byte.MaxValue;

        if (editor.isSubtracting())
        {
            opacity = byte.MinValue;
        }

        // create mutator (and maybe apply)
        switch (editor.selectedBrush)
        {
        case 0:
            Vox.SphereMutator sphereMod = new Vox.SphereMutator(point, editor.sphereBrushSize, new Vox.Voxel(editor.sphereBrushSubstance, opacity));
            sphereMod.overwriteShape = !editor.sphereSubstanceOnly;
            return(sphereMod);

        case 1:
            Vox.CubeMutator cubeMod = new Vox.CubeMutator(editor, point, editor.cubeBrushDimensions, new Vox.Voxel(editor.cubeBrushSubstance, opacity), true);
            cubeMod.overwriteShape = !editor.cubeSubstanceOnly;
            return(cubeMod);

        default:
            Vox.BlurMutator blurMod = new Vox.BlurMutator(editor, point, editor.smoothBrushSize, editor.smoothBrushStrength);
            blurMod.blurRadius = editor.smoothBrushBlurRadius;
            return(blurMod);
        }
    }
Exemplo n.º 2
0
    protected Vox.Mutator buildMutator(Vox.VoxelEditor editor, Vector3 point)
    {
        // check for subtraction mode
        byte opacity = byte.MaxValue;
        if (editor.isSubtracting()) {
            opacity = byte.MinValue;
        }

        // create mutator (and maybe apply)
        switch (editor.selectedBrush) {
            case 0:
                Vox.SphereMutator sphereMod = new Vox.SphereMutator(point, editor.sphereBrushSize, new Vox.Voxel(editor.sphereBrushSubstance, opacity));
                sphereMod.overwriteShape = !editor.sphereSubstanceOnly;
                return sphereMod;
            case 1:
                Vox.CubeMutator cubeMod = new Vox.CubeMutator(editor, point, editor.cubeBrushDimensions, new Vox.Voxel(editor.cubeBrushSubstance, opacity), true);
                cubeMod.overwriteShape = !editor.cubeSubstanceOnly;
                return cubeMod;
            default:
                Vox.BlurMutator blurMod = new Vox.BlurMutator(editor, point, editor.smoothBrushSize, editor.smoothBrushStrength);
                blurMod.blurRadius = editor.smoothBrushBlurRadius;
                return blurMod;
        }
    }