public void OnChange(TimeSpan diff)
        {
            bool inverted;
            if (CheckRequirements(out inverted) == false)
                return;

            var parameters = new TextureChangeParameters
            {
                Center = EditManager.Instance.MousePosition,
                InnerRadius = EditManager.Instance.InnerRadius,
                OuterRadius = EditManager.Instance.OuterRadius,
                Texture = SelectedTexture,
                Amount = Amount
            };

            WorldFrame.Instance.MapManager.OnTextureTerrain(parameters);
        }
Exemple #2
0
        public void OnChange(TimeSpan diff)
        {
            bool inverted;

            if (CheckRequirements(out inverted) == false)
            {
                return;
            }

            var parameters = new TextureChangeParameters
            {
                Center      = EditManager.Instance.MousePosition,
                InnerRadius = EditManager.Instance.InnerRadius,
                OuterRadius = EditManager.Instance.OuterRadius,
                Texture     = SelectedTexture,
                Amount      = Amount
            };

            WorldFrame.Instance.MapManager.OnTextureTerrain(parameters);
        }
Exemple #3
0
        public void OnChange(TimeSpan diff)
        {
            bool inverted;

            if (CheckRequirements(out inverted) == false)
            {
                return;
            }

            var curPos      = EditManager.Instance.MousePosition;
            var innerRadius = EditManager.Instance.InnerRadius;
            var outerRadius = EditManager.Instance.OuterRadius;

            if (EditManager.Instance.IsSprayOn)                   // Spray Texturing.
            {
                if (EditManager.Instance.IsSpraySolidInnerRadius) // Paint solid inner radius if required.
                {
                    var parameters = new TextureChangeParameters
                    {
                        Center      = curPos,
                        InnerRadius = innerRadius * (innerRadius / outerRadius),
                        OuterRadius = innerRadius,
                        Texture     = SelectedTexture,
                        Amount      = Amount / 40,
                        FalloffMode = FalloffMode,
                        TargetValue = TargetValue,
                        IsInverted  = inverted
                    };

                    WorldFrame.Instance.MapManager.OnTextureTerrain(parameters);
                }

                // The spray itself.

                var sprayParticleSize = EditManager.Instance.SprayParticleSize * Metrics.ChunkSize / 2.0f;
                var inc = (float)r.NextDouble(sprayParticleSize / 4.0f, sprayParticleSize / 3.0f);

                for (var py = curPos.Y - outerRadius; py < curPos.Y + outerRadius; py += inc)
                {
                    for (var px = curPos.X - outerRadius; px < curPos.X + outerRadius; px += inc)
                    {
                        if ((Math.Sqrt(Math.Pow(py - curPos.Y, 2) + Math.Pow(px - curPos.X, 2)) <= outerRadius) &&
                            (r.Next(0, 110) < EditManager.Instance.SprayParticleAmount))
                        {
                            var parameters = new TextureChangeParameters
                            {
                                Center      = new Vector3(px, py, EditManager.Instance.MousePosition.Z),
                                InnerRadius = sprayParticleSize / 20.0f,
                                OuterRadius = sprayParticleSize / 20.0f,
                                Texture     = SelectedTexture,
                                Amount      = Amount / 20,
                                FalloffMode = FalloffMode,
                                TargetValue = TargetValue,
                                IsInverted  = inverted
                            };

                            WorldFrame.Instance.MapManager.OnTextureTerrain(parameters);
                        }
                    }
                }
            }

            else // Normal texturing.
            {
                var parameters = new TextureChangeParameters
                {
                    Center      = curPos,
                    InnerRadius = innerRadius,
                    OuterRadius = outerRadius,
                    Texture     = SelectedTexture,
                    //Amount = 4 + Amount,
                    // if tablet is connected override the amount set in thee menus
                    Amount      = Amount / 40,
                    FalloffMode = FalloffMode,
                    TargetValue = TargetValue,
                    IsInverted  = inverted
                };

                WorldFrame.Instance.MapManager.OnTextureTerrain(parameters);
            }
        }
Exemple #4
0
 public override bool OnTextureTerrain(TextureChangeParameters parameters)
 {
     throw new NotImplementedException();
 }