Skip to main content

Frame

Struct Frame 

Source
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: NodeId

The place this frames.

§lo: [i64; 3]

Inclusive low corner in world cells.

§hi: [i64; 3]

Inclusive high corner in world cells.

§floor: i64

The walk plane’s world y.

§bottom: i64

The 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: usize

How 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

Source

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.

Source

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).

Source

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).

Source

pub fn to_local(&self, world: [i64; 3]) -> [i64; 3]

A world cell in this frame’s local coordinates.

Source

pub fn contains(&self, world: [i64; 3]) -> bool

True when world is inside the frame, inclusive.

Source

pub fn owns(&self, world: [i64; 3]) -> bool

True when world is a cell the place owns — inside the frame and in no void.

Source

pub fn all(c: &Campaign) -> Vec<(Frame, PlacedBox)>

Every frame of a campaign’s plan, in plan document order.

Source

pub fn is_fixed(&self, world: [i64; 3]) -> bool

True when world is fixed ground inside this frame.

Trait Implementations§

Source§

impl Clone for Frame

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Frame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Frame

Source§

impl PartialEq for Frame

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.