Skip to main content

PlacedBox

Struct PlacedBox 

Source
pub struct PlacedBox {
    pub node: NodeId,
    pub foot: [i64; 4],
    pub floor: i64,
    pub clearance: u32,
    pub open: bool,
    pub base: Base,
    pub roof: Option<Roof>,
}
Expand description

One place, resolved into world cells: the play space the plan gives it.

Public because three readers need the same answer and two of them are in another crate: the stage-4 checks here, the blockout derivation that builds the mass, and the stage-5 battery that judges the built bytes against the plan. Two of those computing “where is this box” independently is how a builder and its observer come to agree about a world neither of them describes.

Fields§

§node: NodeId

The place this embeds.

§foot: [i64; 4]

Inclusive footprint [x0, x1, z0, z1].

§floor: i64

The walk plane’s world y.

§clearance: u32

Cells of headroom over the walk plane.

§open: bool

True when the plan declared the place sky-open — a courtyard, a shore, a summit. It claims exactly its declared courses of air (which is what PlacedBox::clearance holds); what it makes no claim on is the air above them.

§base: Base

What it stands on: the site’s ground, or hung n courses under its floor course (spec-0098 §2).

§roof: Option<Roof>

The roof the plan reserves over this place (spec-0098 §3), when it declares one. Never present on an open box (DW0988).

Implementations§

Source§

impl PlacedBox

Source

pub fn top(&self) -> i64

The top course of the play space.

Source

pub fn shell_top(&self) -> i64

The highest course of the shell: the lid on a roofed place, the top of the play space on an open one.

Source

pub fn roof_zone(&self) -> Option<Aabb>

The roof zone the plan declares, before any neighbour clips its eaves: the shell footprint grown by eaves on every horizontal side, from the ceiling course up courses courses. None when no roof is declared or the place is open.

Source

pub fn claim_top(&self) -> i64

The highest course this place could claim.

Source

pub fn floor_course_y(&self) -> i64

The floor course’s world y.

Source

pub fn is_ring_column(&self, x: i64, z: i64) -> bool

True when (x, z) is one of the ring’s columns: inside the shell footprint and outside the play space’s.

Source§

impl PlacedBox

Source

pub fn aloft(&self) -> Option<u32>

The underside courses under the floor course, on an aloft place.

Source

pub fn in_shell_footprint(&self, x: i64, z: i64) -> bool

True when (x, z) is inside the shell footprint: the play space’s footprint grown by the one-cell ring.

Source§

impl PlacedBox

Source

pub fn space(&self) -> ([i64; 3], [i64; 3])

The play space’s inclusive world AABB.

Source

pub fn centre(&self) -> [i64; 3]

The floor centre — where a body seated in this place stands.

Trait Implementations§

Source§

impl Clone for PlacedBox

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 PlacedBox

Source§

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

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

impl Eq for PlacedBox

Source§

impl PartialEq for PlacedBox

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 PlacedBox

Auto Trait Implementations§

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.