pub struct CameraState {
pub pos: [f32; 3],
pub right: [f32; 3],
pub down: [f32; 3],
pub forward: [f32; 3],
pub xs: [f32; 3],
pub ys: [f32; 3],
pub zs: [f32; 3],
pub add: [f32; 3],
pub corn: [[f32; 3]; 4],
pub nor: [[f32; 3]; 4],
}Expand description
Per-frame state derived from a Camera + screen parameters.
Fields§
§pos: [f32; 3]Camera position in world voxel units, narrowed from f64.
right: [f32; 3]Camera basis — right / down / forward.
down: [f32; 3]§forward: [f32; 3]§xs: [f32; 3]Transposed basis: row-major if camera basis was column-major.
xs.0 = right.x, xs.1 = down.x, xs.2 = forward.x, etc.
ys: [f32; 3]§zs: [f32; 3]§add: [f32; 3]add[k] = -dot(pos, basis[k]), the translation half of the
world → camera-relative-coords transform.
corn: [[f32; 3]; 4]Four-corner view-frustum direction vectors.
nor: [[f32; 3]; 4]Frustum edge normals: nor[i] = corn[i] × corn[(i + 1) % 4].
Trait Implementations§
Source§impl Clone for CameraState
impl Clone for CameraState
Source§fn clone(&self) -> CameraState
fn clone(&self) -> CameraState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraState
impl Debug for CameraState
impl Copy for CameraState
Auto Trait Implementations§
impl Freeze for CameraState
impl RefUnwindSafe for CameraState
impl Send for CameraState
impl Sync for CameraState
impl Unpin for CameraState
impl UnsafeUnpin for CameraState
impl UnwindSafe for CameraState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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