元編程參考文件

標量場

61 個節點

本頁內容 61

物理比例

函數

Meters per unit cell.
This applies only to width and "height" of the heightmap grid, not physical height.

簽名
物理比例(Scalar Field: Scalar Field) -> 數字
double PhysicalScale(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字

備註

Recommended range for large scale terrain work: 1m/px to 10m/px.
As a reference, a 2K heightmap representing 4km square landscape should use a ScalarField2D.PhysicalScale of 2, aka. 2 meters per unit cell.

Use lower value (e.g. 0.5) if we wish to represent dense details on smaller regions.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

標量場

函數

過載 1/2

簽名
標量場(寬度: 整數, 高度: 整數) -> Scalar Field
ScalarField2D ScalarField2D(int width, int height)

Initializes a new instance of the Heightmap class with the specified dimensions.

參數

名稱型別預設值說明
寬度整數—The width (number of columns) of the heightmap.
高度整數—The height (number of rows) of the heightmap.

返回

標量場Scalar Field

過載 2/2

簽名
標量場(初始資料: 數字陣列陣列) -> Scalar Field
ScalarField2D ScalarField2D(double[][] initialData)

Initializes a new instance of the Heightmap class with the specified data.

參數

名稱型別預設值說明
初始資料數字陣列陣列—A jagged array of doubles representing the heightmap data.

返回

標量場Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

相加

函數

Adds another heightmap to this heightmap, element-wise.

簽名
相加(Scalar Field: Scalar Field, 另一個: Scalar Field)
void Add(ScalarField2D Scalar Field, ScalarField2D other)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
另一個Scalar Field—The other heightmap to add.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

應用

函數

Applies a custom transformation function to each height value in the heightmap.

過載 1/2

簽名
應用(Scalar Field: Scalar Field, 變換: Func<數字, 數字>)
void Apply(
    ScalarField2D Scalar Field,
    Func<double, double> transform)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
變換Func<數字, 數字>—The function to apply to each height value.

過載 2/2

簽名
應用
    Scalar Field: Scalar Field
    變換: Func<整數, 整數, 數字, 數字>
void Apply(
    ScalarField2D Scalar Field,
    Func<int, int, double, double> transform)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
變換Func<整數, 整數, 數字, 數字>—The function to apply to each height value.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

複製標量場

函數

Clones the heightmap, creating a deep copy.

簽名
複製標量場(Scalar Field: Scalar Field) -> Scalar Field
ScalarField2D Clone(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

建立範本

函數

Creates a heightmap with same dimensions and attributes but initialized with fresh empty data.

簽名
建立範本 -> Scalar Field
    Scalar Field: Scalar Field
    新用途: 文字
ScalarField2D CreateTemplate(
    ScalarField2D Scalar Field,
    string newUsage)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
新用途文字—

返回

結果Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

裁剪

函數

Crops the heightmap to the specified rectangular region.

簽名
裁剪 -> Scalar Field
    Scalar Field: Scalar Field
    起點 X: 整數
    起點 Y: 整數
    裁剪寬度: 整數
    裁剪高度: 整數
ScalarField2D Crop(
    ScalarField2D Scalar Field,
    int startX,
    int startY,
    int cropWidth,
    int cropHeight)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
起點 X整數—The starting x-coordinate (column index).
起點 Y整數—The starting y-coordinate (row index).
裁剪寬度整數—The width of the cropped region.
裁剪高度整數—The height of the cropped region.

返回

結果Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

侵蝕筆刷

函數

過載 1/2

簽名
侵蝕筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void ErodeBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Simple erosion

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—
中心 Y整數—
半徑整數—
衰減數字—
筆刷形狀ScalarField2D.PaintbrushShape圓形

過載 2/2

簽名
侵蝕筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    迭代次數: 整數
    休止角: 數字
    侵蝕係數: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void ErodeBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    int iterations,
    double talusAngle,
    double erosionFactor,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Applies thermal erosion within a brush area.

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—The x-coordinate of the brush center.
中心 Y整數—The y-coordinate of the brush center.
半徑整數—The radius of the brush.
衰減數字—The fall-off parameter (0 to 1).
迭代次數整數—The number of erosion iterations to perform.
休止角數字—The maximum stable slope (in height units).
侵蝕係數數字—Controls how much material moves per iteration (0 to 1).
筆刷形狀ScalarField2D.PaintbrushShape圓形The shape of the brush ("circle" or "rectangle").
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

壓平筆刷

函數

Flattens the terrain within a brush area to a target height.

簽名
壓平筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    目標高度: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void FlattenBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double targetHeight,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—The x-coordinate of the brush center.
中心 Y整數—The y-coordinate of the brush center.
半徑整數—The radius of the brush.
衰減數字—The fall-off parameter (0 to 1).
目標高度數字—The target height to flatten to.
筆刷形狀ScalarField2D.PaintbrushShape圓形The shape of the brush ("circle" or "rectangle").
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

列數

函數

Gets the width of the heightmap (number of columns).

簽名
列數(Scalar Field: Scalar Field) -> 整數
int Columns(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得資料

函數

Row-major: height (y), width (x).

簽名
取得資料(Scalar Field: Scalar Field) -> 數字陣列陣列
double[][] Data(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字陣列陣列

備註

Every read of the values goes through here, the field's own members' included, so a field whose values are kept elsewhere - on the graphics card, where a GPU kernel left them (round 26) - brings them here the first time anything reads it, and from then on is an ordinary field.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得高程

函數

此節點沒有文件說明。

簽名
取得高程(Scalar Field: Scalar Field) -> ScalarField2D.ElevationRange
ScalarField2D.ElevationRange Elevations(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果ScalarField2D.ElevationRange
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

是否已歸一化

函數

Gets whether all values in this scalar field are valid normalized values in the inclusive 0..1 range.

簽名
是否已歸一化(Scalar Field: Scalar Field) -> 真否
bool IsNormalized(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果真否

備註

This does not require the field minimum to be exactly 0 or the maximum to be exactly 1.
A constant mask value such as 0.5 is considered normalized because it is already directly usable as opacity.

Non-finite values are never considered normalized.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

是否為正方形

函數

Occassionally useful due to output engine requirements - some usage scenarios require square maps.

簽名
是否為正方形(Scalar Field: Scalar Field) -> 真否
bool IsSquare(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果真否
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

值

函數

Gets or sets the height value at the specified (x, y) coordinate.

簽名
值(Scalar Field: Scalar Field, X: 整數, Y: 整數) -> 數字
double Item(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

行數

函數

Gets the height of the heightmap (number of rows).

簽名
行數(Scalar Field: Scalar Field) -> 整數
int Rows(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

用途

函數

An indicator what this heightmap is used for.
Some valid values: Height, Mask, Slope/Steepness, Wetness, etc.

簽名
用途(Scalar Field: Scalar Field) -> 文字
string Usage(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果文字

備註

Currently only for display purpose; No functional distinction.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得世界深度

函數

此節點沒有文件說明。

簽名
取得世界深度(Scalar Field: Scalar Field) -> 數字
double WorldDepth(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得世界寬度

函數

此節點沒有文件說明。

簽名
取得世界寬度(Scalar Field: Scalar Field) -> 數字
double WorldWidth(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得角度(度)

函數

Calculates the slope angle in degrees based on the gradient at a given point.

簽名
取得角度(度) -> 數字
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
double GetAngleDegree(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得平均高度

函數

Gets the average height value of the heightmap.

簽名
取得平均高度(Scalar Field: Scalar Field) -> 數字
double GetAverageHeight(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得顏色

函數

此節點沒有文件說明。

簽名
取得顏色(Scalar Field: Scalar Field, X: 整數, Y: 整數) -> 顏色
ColorElement GetColor(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—

返回

結果顏色
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得陣列形式的資料

函數

Gets a copy of data.

簽名
取得陣列形式的資料(Scalar Field: Scalar Field) -> 數字陣列陣列
double[][] GetDataAsArrays(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字陣列陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得陣列形式的資料(低精度)

函數

Gets a copy of data in floats.

簽名
取得陣列形式的資料(低精度)(Scalar Field: Scalar Field) -> 低精度數字陣列陣列
float[][] GetDataAsArraysLD(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果低精度數字陣列陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得浮點值

函數

This is very slow!

簽名
取得浮點值 -> 低精度數字
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
float GetFloatValue(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—

返回

結果低精度數字

備註

Currently this is very slow, e.g. when used with `PixelImageSampling.GetGrayClamped` on `ImageFilter.DirectionalGradientSmudge`. It's recommended to conver the Topology.ScalarField2D to a grayscale image first.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得梯度

函數

Gets the gradient (partial derivatives) at the specified (x, y) coordinate.

簽名
取得梯度 -> (數字, 數字)
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
    使用物理比例: 真否
(double, double) GetGradient(
    ScalarField2D Scalar Field,
    int x,
    int y,
    bool usePhysicalScale = true)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).
使用物理比例真否True

返回

結果(數字, 數字)
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得梯度大小

函數

此節點沒有文件說明。

簽名
取得梯度大小 -> 數字
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
    使用物理比例: 真否
double GetGradientMagnitude(
    ScalarField2D Scalar Field,
    int x,
    int y,
    bool usePhysicalScale)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—
使用物理比例真否—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得灰度位元組

函數

此節點沒有文件說明。

簽名
取得灰度位元組 -> 位元組
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
byte GetGrayByte(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—

返回

結果位元組
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得高度變化

函數

此節點沒有文件說明。

簽名
取得高度變化 -> 數字
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
double GetHeightChange(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得最大高度

函數

Gets the maximum height value in the heightmap.

簽名
取得最大高度(Scalar Field: Scalar Field) -> 數字
double GetMaxHeight(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字

備註

Consider using ScalarField2D.Elevations

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得最小高度

函數

Gets the minimum height value in the heightmap.

簽名
取得最小高度(Scalar Field: Scalar Field) -> 數字
double GetMinHeight(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字

備註

Consider using ScalarField2D.Elevations

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得法線

函數

過載 1/2

簽名
取得法線 -> (數字, 數字, 數字)
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
(double, double, double) GetNormal(
    ScalarField2D Scalar Field,
    int x,
    int y)

Gets the normal vector at the specified (x, y) coordinate.

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).

返回

結果(數字, 數字, 數字)

過載 2/2

簽名
取得法線 -> Vector3dhd
    Scalar Field: Scalar Field
    點 1: Vector3dhd
    點 2: Vector3dhd
    點 3: Vector3dhd
Vector3DHD GetNormal(
    ScalarField2D Scalar Field,
    Vector3DHD p1,
    Vector3DHD p2,
    Vector3DHD p3)

Computes the normal vector of a triangle defined by three 3D points.
Points should be specified in counter-clockwise order to ensure the normal points outward (right-hand rule).

參數

名稱型別預設值說明
Scalar FieldScalar Field—
點 1Vector3dhd—
點 2Vector3dhd—
點 3Vector3dhd—

返回

結果Vector3dhd
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得物理高度變化

函數

此節點沒有文件說明。

簽名
取得物理高度變化 -> 數字
    Scalar Field: Scalar Field
    X: 整數
    Y: 整數
double GetPhysicalHeightChange(
    ScalarField2D Scalar Field,
    int x,
    int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—
Y整數—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得值

函數

Gets the height value at the specified (x, y) coordinate.

簽名
取得值(Scalar Field: Scalar Field, X: 整數, Y: 整數) -> 數字
double GetValue(ScalarField2D Scalar Field, int x, int y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得 Z

函數

此節點沒有文件說明。

簽名
取得 Z -> 低精度數字
    Scalar Field: Scalar Field
    X: 低精度數字
    Y: 低精度數字
float GetZ(ScalarField2D Scalar Field, float x, float y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X低精度數字—
Y低精度數字—

返回

結果低精度數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

插值高度

函數

Interpolates the height value at the specified (x, y) coordinate using bilinear interpolation.

簽名
插值高度(Scalar Field: Scalar Field, X: 數字, Y: 數字) -> 數字
double InterpolateHeight(
    ScalarField2D Scalar Field,
    double x,
    double y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X數字—The x-coordinate (can be fractional).
Y數字—The y-coordinate (can be fractional).

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

噪聲筆刷

函數

此節點沒有文件說明。

簽名
噪聲筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    噪聲振幅: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void NoiseBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double noiseAmplitude,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—
中心 Y整數—
半徑整數—
衰減數字—
噪聲振幅數字—
筆刷形狀ScalarField2D.PaintbrushShape圓形
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

就地歸一化並限制範圍

函數

Normalizes every value in _heightData in place so the result is between 0.0 and 1.0 (as specified by Max Value).
For data values smaller than zero, it becomes 0.

簽名
就地歸一化並限制範圍(Scalar Field: Scalar Field, 最大值: 數字)
void NormalizeInPlaceWithClamp(
    ScalarField2D Scalar Field,
    double maxValue)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
最大值數字—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

抬升降低筆刷

函數

Raises or lowers the terrain within a brush area.

簽名
抬升降低筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    高度增量: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void RaiseLowerBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double deltaHeight,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—The x-coordinate of the brush center.
中心 Y整數—The y-coordinate of the brush center.
半徑整數—The radius of the brush.
衰減數字—The fall-off parameter (0 to 1).
高度增量數字—The amount to raise or lower the height.
筆刷形狀ScalarField2D.PaintbrushShape圓形The shape of the brush ("circle" or "rectangle").
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

調整大小

函數

過載 1/2

簽名
調整大小(Scalar Field: Scalar Field, 新寬度: 整數, 新高度: 整數)
void Resize(
    ScalarField2D Scalar Field,
    int newWidth,
    int newHeight)

Resizes the heightmap to the specified dimensions using nearest neighbor scaling.

參數

名稱型別預設值說明
Scalar FieldScalar Field—
新寬度整數—The new width (number of columns).
新高度整數—The new height (number of rows).

過載 2/2

簽名
調整大小
    Scalar Field: Scalar Field
    新寬度: 整數
    新高度: 整數
    插值方式: ScalarField2D.HeightmapResizeInterpolation
    保持海拔範圍: 真否
void Resize(
    ScalarField2D Scalar Field,
    int newWidth,
    int newHeight,
    ScalarField2D.HeightmapResizeInterpolation interpolation = HeightmapResizeInterpolation.Bilinear,
    bool preserveElevationRange = false)

Resizes the heightmap to the specified dimensions.

參數

名稱型別預設值說明
Scalar FieldScalar Field—
新寬度整數—The new width (number of columns).
新高度整數—The new height (number of rows).
插值方式ScalarField2D.HeightmapResizeInterpolation雙線性Interpolation method.
保持海拔範圍真否FalsePrescales result so original min/max elevation remains unchanged. Only neeed as a post to ensure exact min/max elevations, otherwise matters not.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

逆時針旋轉

函數

Rotates the heightmap data 90 degrees counterclockwise.

簽名
逆時針旋轉(Scalar Field: Scalar Field)
void RotateCCW(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

順時針旋轉

函數

Rotates the heightmap data 90 degrees clockwise.

簽名
順時針旋轉(Scalar Field: Scalar Field)
void RotateCW(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

雙線性取樣(限制邊界)

函數

Bilinearly samples the field using grid coordinates and clamps samples at the outer border.

簽名
雙線性取樣(限制邊界) -> 數字
    Scalar Field: Scalar Field
    X: 數字
    Y: 數字
double SampleBilinearClamped(
    ScalarField2D Scalar Field,
    double x,
    double y)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X數字—
Y數字—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

世界座標雙線性取樣(限制邊界)

函數

Bilinearly samples the field using physical world coordinates.
Cell values are treated as samples located at cell centres.

簽名
世界座標雙線性取樣(限制邊界) -> 數字
    Scalar Field: Scalar Field
    世界 X: 數字
    世界 Y: 數字
double SampleWorldBilinearClamped(
    ScalarField2D Scalar Field,
    double worldX,
    double worldY)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
世界 X數字—
世界 Y數字—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

縮放高度

函數

Scales the heightmap vertically by the specified factor.

簽名
縮放高度(Scalar Field: Scalar Field, 縮放: 數字)
void ScaleHeights(ScalarField2D Scalar Field, double scale)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
縮放數字—The scale factor to apply.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

設定值

函數

Sets the height value at the specified (x, y) coordinate.

簽名
設定值(Scalar Field: Scalar Field, X: 整數, Y: 整數, 值: 數字)
void SetValue(
    ScalarField2D Scalar Field,
    int x,
    int y,
    double value)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
X整數—The x-coordinate (column index).
Y整數—The y-coordinate (row index).
值數字—The height value to set.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

平滑

函數

Smooths the heightmap using a simple averaging filter.

簽名
平滑(Scalar Field: Scalar Field)
void Smooth(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

平滑筆刷

函數

Applies a smoothing operation within a brush area.

簽名
平滑筆刷
    Scalar Field: Scalar Field
    中心 X: 整數
    中心 Y: 整數
    半徑: 整數
    衰減: 數字
    筆刷形狀: ScalarField2D.PaintbrushShape
void SmoothBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
中心 X整數—The x-coordinate of the brush center.
中心 Y整數—The y-coordinate of the brush center.
半徑整數—The radius of the brush.
衰減數字—The fall-off parameter (0 to 1).
筆刷形狀ScalarField2D.PaintbrushShape圓形The shape of the brush ("Circle" or "Rectangle").
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

細分

函數

Subdivides each heightmap cell into a finer grid while preserving the overall physical dimensions.

簽名
細分
    Scalar Field: Scalar Field
    係數: 整數
    插值方式: ScalarField2D.HeightmapResizeInterpolation
    保持海拔範圍: 真否
void Subdivide(
    ScalarField2D Scalar Field,
    int factor = 2,
    ScalarField2D.HeightmapResizeInterpolation interpolation = HeightmapResizeInterpolation.Bilinear,
    bool preserveElevationRange = false)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
係數整數2Number of cells created along each axis for every existing cell. Must be greater than or equal to 1.
插值方式ScalarField2D.HeightmapResizeInterpolation雙線性Interpolation method used to generate the additional samples.
保持海拔範圍真否FalseRescales the result so the original minimum and maximum elevations remain unchanged.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

彙總

函數

Returns a technical summary of the heightmap, one parameter per line.

簽名
彙總(Scalar Field: Scalar Field) -> 文字
string Summarize(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

轉為平鋪陣列

函數

Flattened array.

簽名
轉為平鋪陣列(Scalar Field: Scalar Field) -> 數字陣列
double[] ToFlattenArray(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果數字陣列

備註

Used for high-performance purposes.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

轉為平鋪陣列(低精度)

函數

Flattened array.

簽名
轉為平鋪陣列(低精度)(Scalar Field: Scalar Field) -> 低精度數字陣列
float[] ToFlattenArrayLD(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果低精度數字陣列

備註

Used for high-performance purposes.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

轉為像素影像

函數

此節點沒有文件說明。

簽名
轉為像素影像(Scalar Field: Scalar Field) -> Pixel Image
PixelImage ToPixelImage(ScalarField2D Scalar Field)

參數

名稱型別預設值說明
Scalar FieldScalar Field—

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

作為顏色資料修改

函數

此節點沒有文件說明。

簽名
作為顏色資料修改
    Scalar Field: Scalar Field
    更新函數: Func<顏色陣列陣列, 顏色陣列陣列>
void UpdateColorData(
    ScalarField2D Scalar Field,
    Func<ColorElement[][], ColorElement[][]> updater)

參數

名稱型別預設值說明
Scalar FieldScalar Field—
更新函數Func<顏色陣列陣列, 顏色陣列陣列>—

備註

Converts the current heightmap into a grayscale image, lets caller-provided code modify that image, then writes the modified grayscale values back into the heightmap as heights.
Per IPixelImageSampler.UpdateColorData.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
標量場
所屬包
程序化生成

建立派生圖

函數

此節點沒有文件說明。

簽名
建立派生圖(源: Scalar Field, 用途: 文字) -> Scalar Field
ScalarField2D CreateDerivedMap(
    ScalarField2D source,
    string usage)

參數

名稱型別預設值說明
源Scalar Field—
用途文字—

返回

結果Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

從陣列建立

函數

此節點沒有文件說明。

簽名
從陣列建立 -> Scalar Field
    初始資料: 低精度數字陣列陣列
    用途: 文字
    物理比例: 數字
ScalarField2D FromArrays(
    float[][] initialData,
    string usage = "Height",
    double physicalScale = 1)

參數

名稱型別預設值說明
初始資料低精度數字陣列陣列—
用途文字Height
物理比例數字1

返回

結果Scalar Field
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

生成生物群系紋理

函數

此節點沒有文件說明。

簽名
生成生物群系紋理(高度圖: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTexture(ScalarField2D heightmap)

參數

名稱型別預設值說明
高度圖Scalar Field—

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

生成生物群系漸層紋理

函數

此節點沒有文件說明。

簽名
生成生物群系漸層紋理(高度圖: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTextureGradient(ScalarField2D heightmap)

參數

名稱型別預設值說明
高度圖Scalar Field—

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

取得坡度圖用途標記

函數

Returns the canonical usage/term string for a slope map type.

簽名
取得坡度圖用途標記(坡度圖型別: Slope Map Type) -> 文字
string GetSlopeMapUsageToken(ScalarField2D.SlopeMapType slopeMapType)

參數

名稱型別預設值說明
坡度圖型別Slope Map Type—

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

轉為灰度像素影像

函數

此節點沒有文件說明。

簽名
轉為灰度像素影像(高度圖: Scalar Field) -> Pixel Image
PixelImage ToGrayscalePixelImage(ScalarField2D heightmap)

參數

名稱型別預設值說明
高度圖Scalar Field—

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成

驗證物理比例

函數

此節點沒有文件說明。

簽名
驗證物理比例(源: Scalar Field, 使用物理比例: 真否)
void ValidatePhysicalScale(
    ScalarField2D source,
    bool usePhysicalScale)

參數

名稱型別預設值說明
源Scalar Field—
使用物理比例真否—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
標量場
所屬包
程序化生成