Skip to main content

EyeWorld

Struct EyeWorld 

Source
pub struct EyeWorld { /* private fields */ }
Expand description

What an eye can bump into and walk through around where it stood when the renderer last placed the scene: the space it stood in, the spaces next to it through doorways, their solid surfaces and the doorways between them, all in the coordinates of the space it stood in.

Implementations§

Source§

impl EyeWorld

Source

pub fn set_window_scene(&mut self, scene: usize)

Names scene as the scene node of the window’s scene, whose own space is the one an eye stands in through no doorway.

Source

pub fn doorways_to(&self, scene: usize) -> Option<Arc<[usize]>>

The doorways an eye walks through from the window’s scene into the space of the scene node scene, when the world holds that space: the space the eye stood in, or one a doorway from it.

Source

pub fn pose_in(&self, pose: &EyePose, scene: usize) -> Option<EyePose>

pose, of an eye in a space of the world, in the coordinates of the space of the scene node scene; None when the world holds either space not.

Source

pub fn add_space(&mut self, doorways: Arc<[usize]>, to_base: Mat4) -> usize

Adds the space an eye that walked through doorways stands in, whose coordinates to_base maps into the world’s, and returns its number.

Source

pub fn add_solid( &mut self, _: (usize, Arc<Mesh>), transform: Mat4, _: (Size, impl IntoIterator<Item = Rect>), )

Adds a surface of space space that an eye cannot walk through: mesh placed by transform in the world’s coordinates, carrying content of size in which holes are doorways the eye passes.

Source

pub fn add_doorway(&mut self, _: (usize, usize), door: Mat4)

Adds the doorway from space outer into space inner that door spans: the unit square placed in the world’s coordinates, with inner lying beyond it along its z.

Source

pub fn walk(&self, from: &EyePose, step: Vec3, radius: f32) -> EyePose

Where an eye at from, a ball of radius, ends up when it walks step, both in the units of the space it stands in: through the doorways the step passes into the spaces behind them, and pushed out of the solid surfaces of the space it walks in, along which it slides. Its ball keeps radius in the units of each space it walks into. The step goes in pieces of at most half the radius in the smallest space, so it cannot pass through a wall. An eye whose space the world does not hold walks freely.

Trait Implementations§

Source§

impl Debug for EyeWorld

Source§

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

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

impl Default for EyeWorld

Source§

fn default() -> EyeWorld

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> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.