pub struct PointCloud { /* private fields */ }Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn new(
points: Vec<Vec3<i64>>,
min: i64,
max: i64,
fov_factor: i64,
camera: Camera<i64>,
rotation: Vec3<f64>,
size: usize,
) -> Self
pub fn new( points: Vec<Vec3<i64>>, min: i64, max: i64, fov_factor: i64, camera: Camera<i64>, rotation: Vec3<f64>, size: usize, ) -> Self
Examples found in repository?
examples/points_cloud.rs (lines 47-55)
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 project_points(&self) -> Vec<Vec2<i64>>
pub fn set_rotation(&mut self, rotation: Vec3<f64>)
Sourcepub fn rotation(&mut self) -> &mut Vec3<f64>
pub fn rotation(&mut self) -> &mut Vec3<f64>
Examples found in repository?
examples/points_cloud.rs (line 23)
16 fn update<T: Canvas>(&mut self, canvas: &mut T) {
17 canvas.change_color(color::BLACK);
18 canvas.fill();
19
20 canvas.change_color(color::GREEN);
21 canvas.draw_shape(&mut self.point_cloud);
22
23 let rotation = self.point_cloud.rotation();
24 rotation.set_z(rotation.z() + 1f64);
25
26 return;
27 }Trait Implementations§
Source§impl Project<i64> for PointCloud
impl Project<i64> for PointCloud
Auto Trait Implementations§
impl Freeze for PointCloud
impl RefUnwindSafe for PointCloud
impl Send for PointCloud
impl Sync for PointCloud
impl Unpin for PointCloud
impl UnwindSafe for PointCloud
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> 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.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>
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