GridMap

Inherits: Spatial < Node < Object

类别: 核心

简要说明

用于基于三维平铺的地图的节点。

方法

无效

clear ( )

无效

clear_baked_meshes ( )

RID

get_bake_mesh_instance ( int idx )

Array

get_bake_meshes ( )

int

get_cell_item ( int x, int y, int z ) const

int

get_cell_item_orientation ( int x, int y, int z ) const

bool

get_collision_layer_bit ( int bit ) const

bool

get_collision_mask_bit ( int bit ) const

Array

get_meshes ( )

Array

get_used_cells ( ) const

无效

make_baked_meshes ( bool gen_lightmap_uv=false, float lightmap_uv_texel_size=0.1 )

Vector3

map_to_world ( int x, int y, int z ) const

无效

resource_changed ( Resource resource )

无效

set_cell_item ( int x, int y, int z, int item, int orientation=0 )

无效

set_clip ( bool enabled, bool clipabove=true, int floor=0, Vector3.Axis axis=0 )

无效

set_collision_layer_bit ( int bit, bool value )

无效

set_collision_mask_bit ( int bit, bool value )

Vector3

world_to_map ( Vector3 pos ) const

常量

描述

使用“网格地图”可以交互地将网格放置在网格上。它既可以从编辑器中工作,也可以帮助您创建游戏级编辑器。

网格图使用 MeshLibrary 它包含一个平铺列表:网格和材质以及可选的碰撞和额外的元素。

网格图包含一组单元格。每个网格单元引用 MeshLibrary 项目。地图中的所有单元格的尺寸都相同。

一个网格图被分割成一个稀疏的八进制集合,以便高效地渲染和物理处理。每一个八分之一都有相同的尺寸,可以包含几个单元。

属性描述

  • bool cell_center_x

违约

设定器

设置中心x(值)

吸气剂

获取_center_x()

如果 true ,网格项在X轴上居中。

  • bool cell_center_y

违约

设定器

设置中心(值)

吸气剂

获取中心(Y)

如果 true ,网格项在Y轴上居中。

  • bool cell_center_z

违约

设定器

设置中心(值)

吸气剂

获取u中心u z()

如果 true ,网格项在Z轴上居中。

  • int cell_octant_size

违约

8

设定器

设置_Octant_大小(值)

吸气剂

获取_Octant_大小()

每一个八分之一的大小,以细胞的数量来衡量。这适用于所有三个轴。

违约

1.0

设定器

设置单元格刻度(值)

吸气剂

获取_cell_scale()

违约

矢量3(2,2,2)

设定器

设置单元格大小(值)

吸气剂

获取单元格大小()

网格单元格的尺寸。

  • int collision_layer

违约

1

设定器

设置碰撞层(值)

吸气剂

获取“碰撞层”()

  • int collision_mask

违约

1

设定器

设置碰撞屏蔽(值)

吸气剂

获取碰撞掩模(

设定器

设置网格库(值)

吸气剂

获取网格库()

分配的 MeshLibrary .

设定器

设置主题(值)

吸气剂

获取主题()

弃用,使用 mesh_library 相反。

方法说明

  • void clear ( )

清除所有单元格。

  • void clear_baked_meshes ( )

  • RID get_bake_mesh_instance ( int idx )

  • Array get_bake_meshes ( )

这个 MeshLibrary 项目索引位于基于网格的X、Y和Z坐标。如果电池是空的, INVALID_CELL_ITEM 将被退回。

  • int get_cell_item_orientation ( int x, int y, int z ) const

单元格在基于网格的X、Y和Z坐标处的方向。-如果单元格为空,则返回1。

  • bool get_collision_layer_bit ( int bit ) const

  • bool get_collision_mask_bit ( int bit ) const

数组 TransformMesh 与网格中的非空单元格相对应的引用。变换是在世界空间中指定的。

  • Array get_used_cells ( ) const

数组 Vector3 网格图中的非空单元格坐标。

  • void make_baked_meshes ( bool gen_lightmap_uv=false, float lightmap_uv_texel_size=0.1 )

  • void resource_changed ( Resource resource )

设置由基于网格的X、Y和Z坐标引用的单元的网格索引。

负的项目索引将清除单元格。

或者,可以传递项的方向。

  • void set_clip ( bool enabled, bool clipabove=true, int floor=0, Vector3.Axis axis=0 )

  • void set_collision_layer_bit ( int bit, bool value )

  • void set_collision_mask_bit ( int bit, bool value )