pub struct Camera<T: Sized + Copy> { /* private fields */ }Implementations§
Source§impl<T> Camera<T>
impl<T> Camera<T>
Sourcepub fn new(position: Vec3<T>, direction: Vec3<T>, fov_angle: T) -> Self
pub fn new(position: Vec3<T>, direction: Vec3<T>, fov_angle: T) -> Self
Examples found in repository?
examples/points_cloud.rs (line 45)
30fn create_point_cloud() -> PointCloud {
31 let min = -10;
32 let max = 10;
33 let fov_factor = 150;
34 let mut points = Vec::<Vec3<i64>>::new();
35 let size = 2;
36
37 for x in min..max {
38 for y in min..max {
39 for z in min..max {
40 points.push(Vec3::new(x, y, z));
41 }
42 }
43 }
44
45 let camera = Camera::new(Vec3::new(0, 0, -20), Vec3::new(0, 0, 0), 90);
46
47 PointCloud::new(
48 points,
49 min,
50 max,
51 fov_factor,
52 camera,
53 Vec3::<f64>::new(0f64, 0f64, 0f64),
54 size,
55 )
56}pub fn position(&self) -> &Vec3<T>
Auto Trait Implementations§
impl<T> Freeze for Camera<T>where
T: Freeze,
impl<T> RefUnwindSafe for Camera<T>where
T: RefUnwindSafe,
impl<T> Send for Camera<T>where
T: Send,
impl<T> Sync for Camera<T>where
T: Sync,
impl<T> Unpin for Camera<T>where
T: Unpin,
impl<T> UnwindSafe for Camera<T>where
T: UnwindSafe,
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> 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