pub struct Frame {
pub node: NodeId,
pub lo: [i64; 3],
pub hi: [i64; 3],
pub floor: i64,
pub bottom: i64,
pub owned: Vec<Aabb>,
pub owned_cells: usize,
pub voids: Vec<Void>,
pub fixed: Vec<([i64; 3], String)>,
pub clipped: Vec<(Aabb, NodeId)>,
}Expand description
What a piece owns: the place’s claim — the ground under its plot, its
floor course, its play space, the one-cell ring its walls may stand in and,
roofed, its lid and the roof zone the plan declares — minus the ring’s fixed
ground and every cell spec-0098 §2’s ownership rule awards to another place
or to nobody (siteplan::Site::owner).
One derivation, Frame::of, and every reader that must not disagree: the
exactness check (DW0843), the face check (DW0844), the void and ring
checks (DW0987, DW0990), the blockout’s stand-ins and holes, the
placement inside Plan::build, and delvec allocation. Two of them
computing “whose cell is this” independently is how a builder and its
observer come to agree about a world neither describes.
The frame is the bounding box of the owned cells, because a piece is a
structure template and a template is a box. Cells inside it the place does
not own are its Frame::voids: the piece holds structure_void there and
the owner’s block shows through, in the game and in the model alike.
Fields§
§node: NodeIdThe place this frames.
lo: [i64; 3]Inclusive low corner in world cells.
hi: [i64; 3]Inclusive high corner in world cells.
floor: i64The walk plane’s world y.
bottom: i64The claim’s bottom: the lowest course of ground under the plot.
owned: Vec<Aabb>The cells the place owns, merged into disjoint AABBs.
owned_cells: usizeHow many cells the place owns.
voids: Vec<Void>Every cell of the frame the place does not own, with who does.
fixed: Vec<([i64; 3], String)>The ring’s fixed ground inside the frame, each cell with the block the whole writes there (spec-0098 §2 rule 0).
clipped: Vec<(Aabb, NodeId)>Eaves cells the plan clipped at a neighbour’s shell.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn of(site: &Site<'_>, i: usize) -> Frame
pub fn of(site: &Site<'_>, i: usize) -> Frame
The frame of the plan’s ith place, derived from the whole plan:
who owns a party plane depends on what stands on its other side, and the
ring’s ground on the site’s terrain.
Sourcepub fn extent(&self) -> [i64; 3]
pub fn extent(&self) -> [i64; 3]
The frame’s size in cells, [x, y, z] — what a piece’s structure size
must equal on every axis (DW0843).
Sourcepub fn datum_y(&self) -> i64
pub fn datum_y(&self) -> i64
The walk plane’s piece-local y — where the piece’s own floor
surface must be: one over the floor course, plus every course of ground
the claim reaches below it (spec-0098 §2).
Sourcepub fn to_local(&self, world: [i64; 3]) -> [i64; 3]
pub fn to_local(&self, world: [i64; 3]) -> [i64; 3]
A world cell in this frame’s local coordinates.
Sourcepub fn contains(&self, world: [i64; 3]) -> bool
pub fn contains(&self, world: [i64; 3]) -> bool
True when world is inside the frame, inclusive.
Sourcepub fn owns(&self, world: [i64; 3]) -> bool
pub fn owns(&self, world: [i64; 3]) -> bool
True when world is a cell the place owns — inside the frame and in no
void.