Skip to main content

EyeView

Struct EyeView 

Source
pub struct EyeView<'a> {
    pub camera: Camera,
    pub size: Size,
    pub cell: usize,
    pub seen: Vec<SeenSpace>,
    pub surfaces: Vec<SeenSurface<'a>>,
}
Expand description

Where the window’s eye stands, with its camera, and what it sees from there: the spaces it sees through doorways and their surfaces, all in the coordinates of the space it stands in.

Fields§

§camera: Camera

The eye’s camera.

§size: Size

The window scene node’s size, which the camera fills.

§cell: usize

The space the eye stands in, by its number in the tree.

§seen: Vec<SeenSpace>

The spaces the eye sees: its own first, then each through the doorway it shows through, before the spaces seen through it.

§surfaces: Vec<SeenSurface<'a>>

The surfaces of the spaces it sees, in draw order.

Implementations§

Source§

impl<'a> EyeView<'a>

Source

pub fn of(tree: &SpaceTree<'a>, size: Size) -> Self

What the window’s eye sees of tree, the scene of a node of size: it stands where the window scene’s Scene3d::eye says, and sees through each doorway whose opening shows on screen.

Source

pub fn build_world(&self, tree: &SpaceTree<'_>, world: &mut EyeWorld)

Fills world with what the eye can bump into and walk through: the space it stands in, the spaces one doorway from it, their solid surfaces and the doorways between them, in the eye’s space.

Source§

impl EyeView<'_>

Source

pub fn content_to_window( &self, seen: &SeenSurface<'_>, to_window: ProjectiveTransform, ) -> Option<ProjectiveTransform>

The map from the content of seen surface seen to the window, as the eye shows it, given to_window for the scene node’s own coordinates; None for a surface whose mesh carries no texture plane.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for EyeView<'a>

§

impl<'a> !Send for EyeView<'a>

§

impl<'a> !Sync for EyeView<'a>

§

impl<'a> !UnwindSafe for EyeView<'a>

§

impl<'a> Freeze for EyeView<'a>

§

impl<'a> Unpin for EyeView<'a>

§

impl<'a> UnsafeUnpin for EyeView<'a>

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