GridMap

Node for 3D tile-based maps.

GridMap lets you place meshes on a grid interactively. It works both from the editor and can help you create in-game level editors. GridMaps use a MeshLibrary which contain a list of tiles: meshes with materials plus optional collisions and extra elements. A GridMap contains a collection of cells. Each grid cell refers to a MeshLibrary item. All cells in the map have the same dimensions. A GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells.

@GodotBaseClass
struct GridMap {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants

Functions

_updateOctantsCallback
void _updateOctantsCallback()
clear
void clear()

Clear all cells.

clearBakedMeshes
void clearBakedMeshes()
getBakeMeshInstance
RID getBakeMeshInstance(long idx)
getBakeMeshes
Array getBakeMeshes()
getCellItem
long getCellItem(long x, long y, long z)

The MeshLibrary item index located at the grid-based X, Y and Z coordinates. If the cell is empty, INVALID_CELL_ITEM will be returned.

getCellItemOrientation
long getCellItemOrientation(long x, long y, long z)

The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty.

getCellScale
double getCellScale()
getCellSize
Vector3 getCellSize()
getCenterX
bool getCenterX()
getCenterY
bool getCenterY()
getCenterZ
bool getCenterZ()
getCollisionLayer
long getCollisionLayer()
getCollisionLayerBit
bool getCollisionLayerBit(long bit)
getCollisionMask
long getCollisionMask()
getCollisionMaskBit
bool getCollisionMaskBit(long bit)
getMeshLibrary
Ref!MeshLibrary getMeshLibrary()
getMeshes
Array getMeshes()

Array of Transform and Mesh references corresponding to the non empty cells in the grid. The transforms are specified in world space.

getOctantSize
long getOctantSize()
getTheme
Ref!MeshLibrary getTheme()
getUsedCells
Array getUsedCells()

Array of Vector3 with the non empty cell coordinates in the grid map.

makeBakedMeshes
void makeBakedMeshes(bool gen_lightmap_uv, double lightmap_uv_texel_size)
mapToWorld
Vector3 mapToWorld(long x, long y, long z)
opAssign
GridMap opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(GridMap other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
resourceChanged
void resourceChanged(Resource resource)
setCellItem
void setCellItem(long x, long y, long z, long item, long orientation)

Set the mesh index for the cell referenced by its grid-based X, Y and Z coordinates. A negative item index will clear the cell. Optionally, the item's orientation can be passed.

setCellScale
void setCellScale(double scale)
setCellSize
void setCellSize(Vector3 size)
setCenterX
void setCenterX(bool enable)
setCenterY
void setCenterY(bool enable)
setCenterZ
void setCenterZ(bool enable)
setClip
void setClip(bool enabled, bool clipabove, long floor, long axis)
setCollisionLayer
void setCollisionLayer(long layer)
setCollisionLayerBit
void setCollisionLayerBit(long bit, bool value)
setCollisionMask
void setCollisionMask(long mask)
setCollisionMaskBit
void setCollisionMaskBit(long bit, bool value)
setMeshLibrary
void setMeshLibrary(MeshLibrary mesh_library)
setOctantSize
void setOctantSize(long size)
setTheme
void setTheme(MeshLibrary theme)
worldToMap
Vector3 worldToMap(Vector3 pos)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

cellCenterX
bool cellCenterX [@property getter]
bool cellCenterX [@property setter]

If true grid items are centered on the X axis.

cellCenterY
bool cellCenterY [@property getter]
bool cellCenterY [@property setter]

If true grid items are centered on the Y axis.

cellCenterZ
bool cellCenterZ [@property getter]
bool cellCenterZ [@property setter]

If true grid items are centered on the Z axis.

cellOctantSize
long cellOctantSize [@property getter]
long cellOctantSize [@property setter]

The size of each octant measured in number of cells. This applies to all three axis.

cellScale
double cellScale [@property getter]
double cellScale [@property setter]
cellSize
Vector3 cellSize [@property getter]
Vector3 cellSize [@property setter]

The dimensions of the grid's cells.

collisionLayer
long collisionLayer [@property getter]
long collisionLayer [@property setter]
collisionMask
long collisionMask [@property getter]
long collisionMask [@property setter]
meshLibrary
MeshLibrary meshLibrary [@property getter]
MeshLibrary meshLibrary [@property setter]

The assigned MeshLibrary.

theme
MeshLibrary theme [@property getter]
MeshLibrary theme [@property setter]

Deprecated, use meshLibrary instead.

Static functions

_new
GridMap _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta