pub struct Camera {
pub pos: [f64; 3],
pub right: [f64; 3],
pub down: [f64; 3],
pub forward: [f64; 3],
}Expand description
Camera state. All vectors are in voxel-world units (1 unit = 1
voxel); the basis is right-handed with down aligned to +z (i.e.
z grows downward into the map, matching voxlap’s coordinate
system).
§Examples
use roxlap_core::Camera;
let cam = Camera::default();
assert_eq!(cam.pos, [1024.0, 1024.0, 128.0]);
assert_eq!(cam.forward, [0.0, 1.0, 0.0]); // looking +y (north)Fields§
§pos: [f64; 3]Camera position (ipo / dpoint3d in voxlaptest).
right: [f64; 3]Right vector (ist).
down: [f64; 3]Down vector (ihe).
forward: [f64; 3]Forward vector (ifo).
Trait Implementations§
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
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