Files
sbox-public/game/addons/tools/Code/Scene/Terrain/Tools/SmoothTool.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

31 lines
685 B
C#

namespace Editor.TerrainEditor;
/// <summary>
/// Smooth an area of terrain.
/// </summary>
[Title( "Smooth" )]
[Icon( "rounded_corner" )]
[Alias( "smooth" )]
[Group( "1" )]
[Order( 0 )]
public class SmoothTool : BaseBrushTool
{
public SmoothTool( TerrainEditorTool terrainEditorTool ) : base( terrainEditorTool )
{
Mode = SculptMode.Smooth;
}
public override bool GetHitPosition( Terrain terrain, out Vector3 position )
{
if ( _dragging )
{
var tx = terrain.WorldTransform;
var hit = StrokePlane.Trace( Gizmo.CurrentRay, true );
position = tx.PointToLocal( hit.Value );
return hit.HasValue;
}
return base.GetHitPosition( terrain, out position );
}
}