pub struct SurfSample {
pub position: [f32; 3],
pub normal: [f32; 3],
pub face_index: usize,
}
Expand description
Surface sample returned from surface distributions
Fields§
§position: [f32; 3]
Generated point on the model surface
normal: [f32; 3]
Normalized normal vector of the triangle the point resides in.
OBS: The normal will be pointing out of the positively oriented side of the triangle. As
an example, the triangle
defined by the verticies [a, b, c]
where a = [0.0, 0.0, 0.0]
, b = [1.0, 0.0, 0.0]
and
c = [0.0, 1.0, 0.0]
has the normal [0.0, 0.0, 1.0]``. While a triangle defined by
[b, a, c]has the normal
[0.0, 0.0, -1.0]`.
face_index: usize
Index of the triangle the point resides in, in the face slice used for initialization
Trait Implementations§
Source§impl Clone for SurfSample
impl Clone for SurfSample
Source§fn clone(&self) -> SurfSample
fn clone(&self) -> SurfSample
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SurfSample
impl Debug for SurfSample
Source§impl Distribution<SurfSample> for MeshSurface
impl Distribution<SurfSample> for MeshSurface
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> SurfSample
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> SurfSample
Samples the model surface uniformly, returning an instance of the SurfSample struct
Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
Create an iterator that generates random values of
T
, using rng
as
the source of randomness. Read moreSource§impl PartialEq for SurfSample
impl PartialEq for SurfSample
Source§impl PartialOrd for SurfSample
impl PartialOrd for SurfSample
impl Copy for SurfSample
impl StructuralPartialEq for SurfSample
Auto Trait Implementations§
impl Freeze for SurfSample
impl RefUnwindSafe for SurfSample
impl Send for SurfSample
impl Sync for SurfSample
impl Unpin for SurfSample
impl UnwindSafe for SurfSample
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