pub struct Camera {
pub eye: Vec3<f32>,
pub target: Vec3<f32>,
pub up: Vec3<f32>,
pub projection: Projection,
}Expand description
Validated look-at camera.
Fields§
§eye: Vec3<f32>Camera position in world coordinates.
target: Vec3<f32>Look-at target in world coordinates.
up: Vec3<f32>Approximate world-space up direction.
projection: ProjectionCamera projection.
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn try_new(
eye: Vec3<f32>,
target: Vec3<f32>,
up: Vec3<f32>,
projection: Projection,
) -> VizResult<Self>
pub fn try_new( eye: Vec3<f32>, target: Vec3<f32>, up: Vec3<f32>, projection: Projection, ) -> VizResult<Self>
Creates a validated look-at camera.
Sourcepub fn fit_perspective_bounds(
min: Vec3<f32>,
max: Vec3<f32>,
view_direction: Vec3<f32>,
up: Vec3<f32>,
vertical_fov_radians: f32,
aspect: f32,
padding: f32,
) -> VizResult<Self>
pub fn fit_perspective_bounds( min: Vec3<f32>, max: Vec3<f32>, view_direction: Vec3<f32>, up: Vec3<f32>, vertical_fov_radians: f32, aspect: f32, padding: f32, ) -> VizResult<Self>
Fits a perspective camera around finite axis-aligned bounds.
view_direction points from the eye toward the bounds center. padding
must be at least one and expands the bounding sphere used for clipping.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Camera
impl<'de> Deserialize<'de> for Camera
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Camera
impl StructuralPartialEq for Camera
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
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
Mutably borrows from an owned value. Read more