Skip to main content

Floors

Struct Floors 

Source
pub struct Floors {
    pub counts: Vec<u8>,
    pub meshes: BTreeMap<usize, Floor>,
    /* private fields */
}
Expand description

The map’s floors: per cell how many floors cover it and every floor’s mesh with its transform (the map’s picking scene, map).

Fields§

§counts: Vec<u8>

How many floors cover each cell.

§meshes: BTreeMap<usize, Floor>

Every floor’s mesh with its transform, by entity.

Implementations§

Source§

impl Floors

Source

pub fn new(cells: usize) -> Floors

No floors, for a map of cells cells.

Source

pub fn add(&mut self, size: usize, entity: usize, floor: Floor)

A floor that was added goes first; every cell of the rectangle counts one more and the mesh joins the scene.

Original: FUN_140124860.

Source

pub fn remove(&mut self, size: usize, entity: usize)

The rectangle counts one less and the mesh leaves.

Original: FUN_140124770, FUN_1400a2070.

Source

pub fn ground( &self, size: usize, terrain: &HeightGrid<'_>, x: f32, y: f32, ) -> f32

The ground under (x, y): the terrain, or, on a cell with a floor, the nearest floor that a ray from 50 above hits, when it is above the terrain.

Original: FUN_1400a48b0(point, skip floors = false).

Source

pub fn ground_normal( &self, size: usize, terrain: &HeightGrid<'_>, x: f32, y: f32, normal: &mut [f32; 3], ) -> f32

As Floors::ground, with the normal there (param_5): the terrain’s, or on a floor the hit triangle’s turned back into the map (Intersect’s last accepted hit).

Trait Implementations§

Source§

impl Clone for Floors

Source§

fn clone(&self) -> Floors

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 Floors

Source§

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

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

impl Default for Floors

Source§

fn default() -> Floors

Returns the “default value” for a type. Read more

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.