HammeriteCell
Core: the map. Inherits Resource
One convex piece of carved air, derived by the compiler; rooms are groups of these.
Every cell belongs to exactly one authored air HammeriteBrush, whose HammeriteBrush.id it carries as air_brush_id. Carving can break that brush into several convex pieces - one cell each - and pieces that stay connected share a region, so a room's identity is key(), not the cell. Cells are rebuilt on every edit and never saved with a map: read them from HammeriteMap.get_cells() or HammeriteMap.get_region_cells(), and bind to key(). The compile cache keeps their numbers rather than the objects.
Properties
| Type | Name | Default |
|---|---|---|
int | air_brush_id | 0 |
int | region | 0 |
Plane[] | planes | [] |
PackedVector3Array | vertices | PackedVector3Array() |
AABB | aabb | AABB(0, 0, 0, 0, 0, 0) |
float | volume | 0.0 |
Methods
| Returns | Method |
|---|---|
Vector2i | key() |
bool | contains_point(point: Vector3, margin: float = 0.0) |
PackedVector3Array | cross_section(slice: Plane) |
Property descriptions
air_brush_id
var air_brush_id: int = 0
The HammeriteBrush.id of the air brush this piece was carved from. Shared by every piece of that brush, so on its own it names the brush, not the room - see key(). Stable under nudges.
region
var region: int = 0
Which of the owning air brush's ROOMS this convex piece belongs to. Carving decomposes: a pillar in a hall leaves four convex pieces that are still one room, while a wall driven across it leaves two pieces that are two rooms. Fragments of one connected group share a region index, so this is the discriminator that means "a different room", and pieces are not. Assigned in a canonical geometric order (lowest corner, then descending volume) rather than in decomposition order, so it stays with the same room when the author nudges something.
planes
var planes: Plane[] = []
The bounding planes of this convex piece (world space), normals pointing out of the air.
vertices
var vertices: PackedVector3Array = PackedVector3Array()
The corner vertices of this convex piece (world space).
aabb
var aabb: AABB = AABB(0, 0, 0, 0, 0, 0)
World-space axis-aligned bounds of this convex piece, not of the whole room.
volume
var volume: float = 0.0
Volume of this cell's whole REGION - the room, summed over its convex pieces - cached for the point-in-cell tiebreak: bigger volume wins. Every piece of one room shares this value, and two rooms carved from one air brush each carry their own.
Method descriptions
key()
func key() -> Vector2i
Identity of the ROOM this piece belongs to: its air brush and its region within that brush. This is what a consumer binds to when it wants to say "this space", and what survives a recompile.
contains_point()
func contains_point(point: Vector3, margin: float = 0.0) -> bool
Whether point (world space) is inside this convex piece, or within margin of it. Only this piece: the room a point is in is HammeriteMap.point_in_cell()'s to find.
cross_section()
func cross_section(slice: Plane) -> PackedVector3Array
The convex polygon where slice cuts this piece (world space, sorted about the slice normal), or empty if the plane misses the region. Feeds the 2D depth-slice floorplan: filling a cell's cross-section at the view depth shows the walkable space at that height and cuts correctly around a pillar, which a projected silhouette cannot.