Version: 2020.2
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

BrushTransform

struct in UnityEngine.Experimental.TerrainAPI

/

Implemented in:UnityEngine.TerrainModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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

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

Properties

brushOrigin(Read Only) Brush UV origin, in XY space.
brushU(Read Only) Brush U vector, in XY space.
brushV(Read Only) Brush V vector, in XY space.
targetOrigin(Read Only) Target XY origin, in Brush UV space.
targetX(Read Only) Target X vector, in Brush UV space.
targetY(Read Only) Target Y vector, in Brush UV space.

Constructors

BrushTransformCreates a BrushTransform.

Public Methods

FromBrushUVApplies the transform to convert a Brush UV coordinate to the target XY space.
GetBrushXYBoundsGet the axis-aligned bounding rectangle of the brush, in target XY space.
ToBrushUVApplies the transform to convert a target XY coordinate to Brush UV space.

Static Methods

FromRectCreates an axis-aligned BrushTransform from a rectangle.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961