[][src]Struct ncollide2d::shape::HeightField

pub struct HeightField<N: RealField> { /* fields omitted */ }

A 2D heightfield.


impl<N: RealField> HeightField<N>[src]

pub fn new(heights: DVector<N>, scale: Vector<N>) -> Self[src]

Creates a new 2D heightfield with the given heights and scale factor.

pub fn num_cells(&self) -> usize[src]

The number of cells of this heightfield.

pub fn heights(&self) -> &DVector<N>[src]

The height at each cell endpoint.

pub fn scale(&self) -> &Vector<N>[src]

The scale factor applied to this heightfield.

pub fn aabb(&self) -> &AABB<N>[src]

The AABB of this heightfield.

pub fn cell_width(&self) -> N[src]

The width of a single cell of this heightfield.

pub fn unit_cell_width(&self) -> N[src]

The width of a single cell of this heightfield, without taking the scale factor into account.

pub fn start_x(&self) -> N[src]

The left-most x-coordinate of this heightfield.

pub fn cell_at_point(&self, pt: &Point2<N>) -> Option<usize>[src]

Index of the cell a point is on after vertical projection.

pub fn segments<'a>(&'a self) -> impl Iterator<Item = Segment<N>> + 'a[src]

Iterator through all the segments of this heightfield.

pub fn segment_at(&self, i: usize) -> Option<Segment<N>>[src]

The i-th segment of the heightfield if it has not been removed.

pub fn set_segment_removed(&mut self, i: usize, removed: bool)[src]

Mark the i-th segment of this heightfield as removed or not.

pub fn is_segment_removed(&self, i: usize) -> bool[src]

Checks if the i-th segment has been removed.

pub fn map_elements_in_local_aabb(
    aabb: &AABB<N>,
    f: &mut impl FnMut(usize, &Segment<N>, &dyn ContactPreprocessor<N>)

Applies f to each segment of this heightfield that intersects the given aabb.

Trait Implementations

impl<N: Clone + RealField> Clone for HeightField<N>[src]

impl<N: Debug + RealField> Debug for HeightField<N>[src]

impl<N: RealField> HasBoundingVolume<N, AABB<N>> for HeightField<N>[src]

impl<N: RealField> HasBoundingVolume<N, BoundingSphere<N>> for HeightField<N>[src]

impl<N: RealField> PointQuery<N> for HeightField<N>[src]

impl<N: RealField> PointQueryWithLocation<N> for HeightField<N>[src]

type Location = (usize, TrianglePointLocation<N>)

Additional shape-specific projection information Read more

impl<N: RealField> RayCast<N> for HeightField<N>[src]

impl<N: RealField> Shape<N> for HeightField<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for HeightField<N> where
    N: RefUnwindSafe + Scalar

impl<N> Send for HeightField<N> where
    N: Scalar

impl<N> Sync for HeightField<N> where
    N: Scalar

impl<N> Unpin for HeightField<N> where
    N: Scalar + Unpin

impl<N> UnwindSafe for HeightField<N> where
    N: Scalar + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,