pub struct Camera3D {
pub position: Vec3,
pub target: Vec3,
pub up: Vec3,
pub fov_y: f32,
pub near: f32,
pub far: f32,
pub perspective: bool,
pub aspect: f32,
}Expand description
Camera definition for 3D rendering.
Fields§
§position: Vec3World-space camera position.
target: Vec3World-space point the camera looks at.
up: Vec3World-space up vector.
fov_y: f32Field of view in radians (perspective) or half-height (orthographic).
near: f32Near clipping plane distance.
far: f32Far clipping plane distance.
perspective: boolIf true, use perspective projection. If false, use orthographic.
aspect: f32Aspect ratio (width / height). Used for perspective projection.
Implementations§
Source§impl Camera3D
impl Camera3D
Sourcepub fn view_matrix(&self) -> Mat4
pub fn view_matrix(&self) -> Mat4
Compute the view matrix (world → camera space).
Sourcepub fn projection_matrix(&self) -> Mat4
pub fn projection_matrix(&self) -> Mat4
Compute the projection matrix.
Sourcepub fn view_projection(&self) -> Mat4
pub fn view_projection(&self) -> Mat4
Compute the combined view-projection matrix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Camera3D
impl RefUnwindSafe for Camera3D
impl Send for Camera3D
impl Sync for Camera3D
impl Unpin for Camera3D
impl UnsafeUnpin for Camera3D
impl UnwindSafe for Camera3D
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.