Пример #1
0
        private Vector3 HandleHitCommon(Quaternion rotation, float pressure)
        {
            var finalOpacity  = opacity;
            var finalRadius   = radius;
            var finalHardness = hardness;
            var finalColor    = color;
            var finalAngle    = angle;
            var finalTexture  = texture;
            var finalMatrix   = tileTransform != null ? tileTransform.localToWorldMatrix : Matrix4x4.identity;
            var finalAspect   = P3dHelper.GetAspect(shape, texture);

            P3dPaintableManager.BuildModifiers(gameObject);
            P3dPaintableManager.ModifyColor(pressure, ref finalColor);
            P3dPaintableManager.ModifyAngle(pressure, ref finalAngle);
            P3dPaintableManager.ModifyOpacity(pressure, ref finalOpacity);
            P3dPaintableManager.ModifyHardness(pressure, ref finalHardness);
            P3dPaintableManager.ModifyRadius(pressure, ref finalRadius);
            P3dPaintableManager.ModifyTexture(pressure, ref finalTexture);

            rotation = rotation * Quaternion.Euler(0.0f, 0.0f, finalAngle);

            var finalSize = Command.Instance.SetShape(rotation, scale, finalRadius, finalAspect);

            Command.Instance.SetMaterial(blendMode, texture, shape, shapeChannel, finalHardness, wrapping, normalBack, normalFront, normalFade, finalColor, finalOpacity, tileTexture, finalMatrix, tileBlend);

            return(finalSize);
        }
Пример #2
0
        public void HandleHitPoint(List <P3dCommand> commands, List <P3dTransform> repeaters, bool preview, Collider collider, Vector3 worldPosition, Quaternion worldRotation, float pressure)
        {
            var finalOpacity  = opacity + (1.0f - opacity) * opacityPressure * pressure;
            var finalRadius   = radius + radiusPressure * pressure;
            var finalDepth    = depth + depthPressure * pressure;
            var finalHardness = hardness + hardnessPressure * pressure;
            var finalColor    = color;
            var finalAngle    = angle;
            var finalTexture  = texture;

            P3dPaintableManager.BuildModifiers(gameObject);
            P3dPaintableManager.ModifyColor(ref finalColor);
            P3dPaintableManager.ModifyAngle(ref finalAngle);
            P3dPaintableManager.ModifyOpacity(ref finalOpacity);
            P3dPaintableManager.ModifyHardness(ref finalHardness);
            P3dPaintableManager.ModifyRadius(ref finalRadius);
            P3dPaintableManager.ModifyTexture(ref finalTexture);

            worldRotation = worldRotation * Quaternion.Euler(0.0f, 0.0f, finalAngle);

            Command.Instance.SetLocation(worldPosition, worldRotation, scale, finalRadius, finalTexture, finalDepth);

            Command.Instance.SetMaterial(blendMode, texture, finalHardness, normalBack, normalFront, normalFade, finalColor, finalOpacity, shape);

            P3dPaintableManager.SubmitAll(Command.Instance, preview, layers, groups, targetModel, targetTexture, repeaters, commands);
        }
Пример #3
0
        /// <summary>This allows you to paint all pixels within a sphere at the specified point.</summary>
        public void HandleHitPoint(List <P3dCommand> commands, List <P3dTransform> repeaters, bool preview, Collider collider, Vector3 worldPosition, Quaternion worldRotation, float pressure)
        {
            var finalOpacity  = opacity + (1.0f - opacity) * opacityPressure * pressure;
            var finalRadius   = radius + radiusPressure * pressure;
            var finalHardness = hardness + hardnessPressure * pressure;
            var finalColor    = color;
            var finalTexture  = texture;

            P3dPaintableManager.BuildModifiers(gameObject);
            P3dPaintableManager.ModifyColor(ref finalColor);
            P3dPaintableManager.ModifyOpacity(ref finalOpacity);
            P3dPaintableManager.ModifyRadius(ref finalRadius);
            P3dPaintableManager.ModifyHardness(ref finalHardness);

            if (scale == Vector3.one)             // Sphere?
            {
                Command.Instance.SetLocation(worldPosition, finalRadius);
            }
            else             // Elipse?
            {
                Command.Instance.SetLocation(worldPosition, scale * finalRadius, rotateTo == RotationType.World ? worldRotation : Quaternion.identity);
            }

            Command.Instance.SetMaterial(blendMode, finalHardness, finalColor, finalOpacity, finalTexture, strength, tiling);

            P3dPaintableManager.SubmitAll(Command.Instance, preview, layers, groups, targetModel, targetTexture, repeaters, commands);
        }
        private Vector3 HandleHitCommon(Quaternion rotation, float pressure)
        {
            var finalOpacity    = opacity;
            var finalRadius     = radius;
            var finalHardness   = hardness;
            var finalColor      = color;
            var finalTileMatrix = tileTransform != null ? tileTransform.localToWorldMatrix : Matrix4x4.identity;

            P3dPaintableManager.BuildModifiers(gameObject);
            P3dPaintableManager.ModifyColor(pressure, ref finalColor);
            P3dPaintableManager.ModifyOpacity(pressure, ref finalOpacity);
            P3dPaintableManager.ModifyRadius(pressure, ref finalRadius);
            P3dPaintableManager.ModifyHardness(pressure, ref finalHardness);

            var finalSize = scale * finalRadius;

            Command.Instance.SetShape(finalSize, rotateTo == RotationType.World ? Quaternion.identity : rotation);

            Command.Instance.SetMaterial(BlendMode, finalHardness, finalColor, finalOpacity, tileTexture, finalTileMatrix, tileBlend);

            return(finalSize);
        }