pub struct RenderCamera {
pub view: Mat4,
pub projection: Mat4,
pub eye_position: [f32; 3],
pub forward: [f32; 3],
pub orientation: Quat,
pub near: f32,
pub far: f32,
pub fov: f32,
pub aspect: f32,
}Expand description
Canonical renderer-facing camera state.
Replaces the flat camera fields that were previously scattered across
FrameData. Application-side orbit cameras resolve into this type
before frame submission.
Fields§
§view: Mat4World-to-view transform matrix.
projection: Mat4View-to-clip (projection) matrix.
eye_position: [f32; 3]Camera eye position in world space.
forward: [f32; 3]Camera forward direction in world space.
orientation: QuatCamera orientation quaternion.
near: f32Near clip plane distance. Default: 0.1.
far: f32Far clip plane distance. Default: 1000.0.
fov: f32Vertical field of view in radians. Default: PI/4.
aspect: f32Aspect ratio (width / height). Default: 1.333.
Implementations§
Source§impl RenderCamera
impl RenderCamera
Sourcepub fn camera_uniform(&self) -> CameraUniform
pub fn camera_uniform(&self) -> CameraUniform
Build the GPU-facing camera uniform from this camera’s state.
Sourcepub fn from_camera(cam: &Camera) -> Self
pub fn from_camera(cam: &Camera) -> Self
Build a RenderCamera from an app-side Camera.
This is the intended conversion path: resolve the orbit camera to a
RenderCamera once per frame and pass it through CameraFrame.
Trait Implementations§
Source§impl Clone for RenderCamera
impl Clone for RenderCamera
Source§fn clone(&self) -> RenderCamera
fn clone(&self) -> RenderCamera
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderCamera
impl Debug for RenderCamera
Auto Trait Implementations§
impl Freeze for RenderCamera
impl RefUnwindSafe for RenderCamera
impl Send for RenderCamera
impl Sync for RenderCamera
impl Unpin for RenderCamera
impl UnsafeUnpin for RenderCamera
impl UnwindSafe for RenderCamera
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
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.