元编程参考文档

标量场

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—
使用物理比例真否—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
标量场
所属包
程序化生成