[][src]Struct ncollide3d::shape::HeightField

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

An heightfield implicitly discretized with triangles.

Methods

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

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

Initializes a new heightfield with the given heights and a scaling factor.

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

The number of rows of this heightfield.

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

The number of columns of this heightfield.

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

The pair of index of the cell containing the vertical projection of the given point.

pub fn x_at(&self, j: usize) -> N[src]

The smallest x coordinate of the j-th column of this heightfield.

pub fn z_at(&self, i: usize) -> N[src]

The smallest z coordinate of the start of the i-th row of this heightfield.

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

An iterator through all the triangles of this heightfield.

pub fn triangles_at(
    &self,
    i: usize,
    j: usize
) -> (Option<Triangle<N>>, Option<Triangle<N>>)
[src]

The two triangles at the cell (i, j) of this heightfield.

Returns None fore triangles that have been removed because of their user-defined status flags (described by the HeightFieldCellStatus bitfield).

pub fn cell_status(&self, i: usize, j: usize) -> HeightFieldCellStatus[src]

The status of the (i, j)-th cell.

pub fn set_cell_status(
    &mut self,
    i: usize,
    j: usize,
    status: HeightFieldCellStatus
)
[src]

Set the status of the (i, j)-th cell.

pub fn cells_statuses(&self) -> &DMatrix<HeightFieldCellStatus>[src]

The statuses of all the cells of this heightfield.

pub fn cells_statuses_mut(&mut self) -> &mut DMatrix<HeightFieldCellStatus>[src]

The mutable statuses of all the cells of this heightfield.

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

The heights of this heightfield.

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

The scale factor applied to this heightfield.

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

The width (extent along its local x axis) of each cell of this heightmap, including the scale factor.

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

The height (extent along its local z axis) of each cell of this heightmap, including the scale factor.

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

The width (extent along its local x axis) of each cell of this heightmap, excluding the scale factor.

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

The height (extent along its local z axis) of each cell of this heightmap, excluding the scale factor.

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

The AABB of this heightmap.

pub fn convert_triangle_feature_id(
    &self,
    i: usize,
    j: usize,
    left: bool,
    fid: FeatureId
) -> FeatureId
[src]

Converts the FeatureID of the left or right triangle at the cell (i, j) into a FeatureId of the whole heightfield.

pub fn map_elements_in_local_aabb(
    &self,
    aabb: &AABB<N>,
    f: &mut impl FnMut(usize, &Triangle<N>, &dyn ContactPreprocessor<N>)
)
[src]

Applies the function f to all the triangles of this heightfield intersecting 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 toi_and_normal_and_uv_with_ray(
    &self,
    m: &Isometry<N>,
    ray: &Ray<N>,
    solid: bool
) -> Option<RayIntersection<N>>
[src]

Computes time of impact, normal, and texture coordinates (uv) between this transformed shape and a ray. Read more

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: Real> ToTriMesh<N> for HeightField<N>[src]

type DiscretizationParameter = ()

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 = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?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