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
impl EyeWorld
Sourcepub fn set_window_scene(&mut self, scene: usize)
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.
Sourcepub fn doorways_to(&self, scene: usize) -> Option<Arc<[usize]>>
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.
Sourcepub fn pose_in(&self, pose: &EyePose, scene: usize) -> Option<EyePose>
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.
Sourcepub fn add_space(&mut self, doorways: Arc<[usize]>, to_base: Mat4) -> usize
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.
Sourcepub fn add_solid(
&mut self,
_: (usize, Arc<Mesh>),
transform: Mat4,
_: (Size, impl IntoIterator<Item = Rect>),
)
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.
Sourcepub fn add_doorway(&mut self, _: (usize, usize), door: Mat4)
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.
Sourcepub fn walk(&self, from: &EyePose, step: Vec3, radius: f32) -> EyePose
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§
Auto Trait Implementations§
impl Freeze for EyeWorld
impl RefUnwindSafe for EyeWorld
impl Send for EyeWorld
impl Sync for EyeWorld
impl Unpin for EyeWorld
impl UnsafeUnpin for EyeWorld
impl UnwindSafe for EyeWorld
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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