# BrushTransform

> Represents a linear 2D transformation between brush UV space and a target XY space (typically this is a Terrain-local object space.)

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.TerrainTools](/engine/6000.5/script-reference/unityengine/terraintools.md)
* **Assembly:** UnityEngine.TerrainModule

```csharp
public struct BrushTransform
```

## Remarks

The BrushTransform represents a rectangular brush, with scale, rotation, and skew. The brush is assumed to lie in the \[0,1] range in brush UV space.

The transform and its inverse are represented as follows:

`xy = u * BrushTransform.brushU + v * BrushTransform.brushV + BrushTransform.brushOrigin`

`uv = x * BrushTransform.targetX + y * BrushTransform.targetY + BrushTransform.targetOrigin`

## Constructors

| Constructor                                                                                                                                                    | Description               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| [BrushTransform(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2)](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/ctor.md) | Creates a BrushTransform. |

## Properties

| Property                                                                                                | Description                                      |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [brushOrigin](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/brushorigin.md)   | (Read Only) Brush UV origin, in XY space.        |
| [brushU](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/brushu.md)             | (Read Only) Brush U vector, in XY space.         |
| [brushV](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/brushv.md)             | (Read Only) Brush V vector, in XY space.         |
| [targetOrigin](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/targetorigin.md) | (Read Only) Target XY origin, in Brush UV space. |
| [targetX](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/targetx.md)           | (Read Only) Target X vector, in Brush UV space.  |
| [targetY](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/targety.md)           | (Read Only) Target Y vector, in Brush UV space.  |

## Methods

| Method                                                                                                          | Description                                                                    |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [FromBrushUV](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/frombrushuv.md)           | Applies the transform to convert a Brush UV coordinate to the target XY space. |
| [GetBrushXYBounds](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/getbrushxybounds.md) | Get the axis-aligned bounding rectangle of the brush, in target XY space.      |
| [ToBrushUV](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/tobrushuv.md)               | Applies the transform to convert a target XY coordinate to Brush UV space.     |

## Static Methods

| Method                                                                                          | Description                                              |
| ----------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [FromRect](/engine/6000.5/script-reference/unityengine/terraintools/brushtransform/fromrect.md) | Creates an axis-aligned BrushTransform from a rectangle. |
