Skip to main content

Eye

Struct Eye 

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

The eye of a window’s 3D scene.

Read in a scene3d closure through Eye::scene, it moves the scene’s camera without recomposition. The scene tells the renderer where the eye stands among the spaces behind its doorways, and the renderer leaves the eye what it can bump into there each time it places the scene, which Eye::walk reads.

Implementations§

Source§

impl Eye

Source

pub fn new(pose: EyePose, radius: f32) -> Self

An eye at pose: a ball of radius, in the units of the space it stands in, that stops short of solid surfaces.

Source

pub fn pose(&self) -> EyePose

Where the eye stands and which way it looks.

Source

pub fn scene(&self, focal_length: f32, light: Option<Light>) -> Scene3d

The scene seen through the eye: its camera, with focal_length, in the space it stands in, and light.

Source

pub fn walk(&self, step: Vec3)

Walks the eye step, in the coordinates of the space it stands in: through the doorways the step passes, and pushed back from the solid surfaces of the space it walks into, along which it slides.

Source

pub fn turn(&self, yaw: f32, pitch: f32)

Turns the eye yaw radians to the right and pitch up (see EyePose::turn).

Source

pub fn place(&self, pose: EyePose)

Puts the eye at pose, through no doorway and stopped by nothing.

Source

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

Where the eye stands and which way it looks, in the coordinates of the space of the scene node scene: the one it stands in or one a doorway from it. None when no such space lies there.

Source

pub fn enter(&self, scene: NodeId, pose: EyePose) -> bool

Puts the eye at pose, in the coordinates of the space of the scene node scene, as if it walked there: that space is the one the eye stands in or one a doorway from it. False, and the eye stays where it is, when no such space lies there.

Trait Implementations§

Source§

impl Clone for Eye

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 PartialEq for Eye

Two handles are equal when they hold the same eye.

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

Auto Trait Implementations§

§

impl Freeze for Eye

§

impl RefUnwindSafe for Eye

§

impl Send for Eye

§

impl Sync for Eye

§

impl Unpin for Eye

§

impl UnsafeUnpin for Eye

§

impl UnwindSafe for Eye

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> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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