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

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

A 2D heightfield.

Methods

impl<N: Real> 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(
    &self,
    aabb: &AABB<N>,
    f: &mut impl FnMut(usize, &Segment<N>, &dyn ContactPreprocessor<N>)
)
[src]

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

Trait Implementations

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

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

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

fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N[src]

Computes the minimal distance between a point and self transformed by m.

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

type Location = (usize, TrianglePointLocation<N>)

Additional shape-specific projection information Read more

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

fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>[src]

Computes the time of impact between this transform shape and a ray.

fn intersects_ray(&self, m: &Isometry<N>, ray: &Ray<N>) -> bool[src]

Tests whether a ray intersects this transformed shape.

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

fn as_convex_polyhedron(&self) -> Option<&dyn ConvexPolyhedron<N>>[src]

The convex polyhedron representation of self if applicable.

fn as_support_map(&self) -> Option<&dyn SupportMap<N>>[src]

The support mapping of self if applicable.

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<N>>[src]

The composite shape representation of self if applicable.

fn as_deformable_shape(&self) -> Option<&dyn DeformableShape<N>>[src]

The deformable shape representation of self if applicable.

fn as_deformable_shape_mut(&mut self) -> Option<&mut dyn DeformableShape<N>>[src]

The mutable deformable shape representation of self if applicable.

fn is_convex_polyhedron(&self) -> bool[src]

Whether self uses a convex polyhedron representation.

fn is_support_map(&self) -> bool[src]

Whether self uses a support-mapping based representation.

fn is_composite_shape(&self) -> bool[src]

Whether self uses a composite shape-based representation.

fn is_deformable_shape(&self) -> bool[src]

Whether self uses a composite shape-based representation.

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> Same for T

type Output = T

Should always be Self