- A+
所属分类:编程茶楼
// Specifies a configuration to use when performing Recast builds.
struct rcConfig
{
/// The minimum/maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
/// 环境Mesh中顶点XYZ的最大最小值构成的AABB包围盒,将环境都包含在内。
/// 这个值也可以自定义,毕竟真实的游戏很复杂,有些区域不需要寻路,比如:水里、天空、不可到达的区域...
float bmin[3];
float bmax[3];
/// The xz-plane/y-axis cell size/height to use for fields. [Limit: > 0] [Units: wu]
/// 体素细分单位。体素长宽高单位大小。
float cs; // cell size -> 立方体XZ的大小 -> XZ平面正方形
float ch; // cell height -> 立方体高度大小
/// The width/height of the field along the x-axis/z-axis. [Limit: >= 0] [Units: vx]
/// 将上面的AABB包围盒细分。将X轴细分为width块,将Z轴细分为height块。
int width; // X轴细分。浮点数向上取整。如:width = (fAABBMax_X - fAABBMin_X)/(cs + 0.5f)
int height; // Z轴细分。
// 注意:Y轴没有被细分。
/// The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
/// 边界区域大小,这些边界区域不会生成导航网格。
int borderSize;
/// The width/height size of tile's on the xz-plane. [Limit: >= 0] [Units: vx]
int tileSize;
/// The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]
/// 爬坡下坎的角度,斜面超过这个角度不能导航。
float walkableSlopeAngle;
/// Minimum floor to 'ceiling(天花板)' height
/// that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
/// 可行走的最小高度 - 体素坐标系 - 单位为体素的高
int walkableHeight;
/// Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
/// 可以攀爬的最大高度 - 体素坐标系 - 单位为体素的高
int walkableClimb;
/// The distance to erode/shrink the walkable area of the heightfield away from obstructions. [Limit: >=0] [Units: vx]
/// 行走半径。区域圆的半径大于该值时才可以行走。每个物体都有半径,行走物应该都有半径![Limit: >=0]
int walkableRadius;
/// The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]
int maxEdgeLen;
/// The maximum distance a simplified contour's border edges should deviate the original raw contour. [Limit: >=0] [Units: vx]
float maxSimplificationError;
/// The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]
/// 平面XZ最小可行走区域。
int minRegionArea;
/// Any regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx]
int mergeRegionArea;
/// The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. [Limit: >= 3]
int maxVertsPerPoly;
/// Sets the sampling distance to use when generating the detail mesh.(For height detail only.) [Limits: 0 or >= 0.9] [Units: wu]
float detailSampleDist;
/// The maximum distance the detail mesh surface should deviate from heightfield data. (For height detail only.) [Limit: >=0] [Units: wu]
float detailSampleMaxError;
};
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫