Struct rapier3d::geometry::HeightField[][src]

pub struct HeightField { /* fields omitted */ }

An heightfield implicitly discretized with triangles.

Implementations

impl HeightField[src]

pub fn aabb(&self, pos: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>) -> AABB[src]

Computes the world-space AABB of this heightfield, transformed by pos.

pub fn local_aabb(&self) -> AABB[src]

Computes the local-space AABB of this heightfield.

impl HeightField[src]

pub fn bounding_sphere(
    &self,
    pos: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>
) -> BoundingSphere
[src]

Computes the world-space bounding sphere of this height-field, transformed by pos.

pub fn local_bounding_sphere(&self) -> BoundingSphere[src]

Computes the local-space bounding sphere of this height-field.

impl HeightField[src]

pub fn new(
    heights: Matrix<f32, Dynamic, Dynamic, VecStorage<f32, Dynamic, Dynamic>>,
    scale: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> HeightField
[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: &Point<f32, 3_usize>) -> 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) -> f32[src]

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

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

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

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

An iterator through all the triangles of this heightfield.

pub fn triangles_at(
    &self,
    i: usize,
    j: usize
) -> (Option<Triangle>, Option<Triangle>)
[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
) -> &Matrix<HeightFieldCellStatus, Dynamic, Dynamic, VecStorage<HeightFieldCellStatus, Dynamic, Dynamic>>
[src]

The statuses of all the cells of this heightfield.

pub fn cells_statuses_mut(
    &mut self
) -> &mut Matrix<HeightFieldCellStatus, Dynamic, Dynamic, VecStorage<HeightFieldCellStatus, Dynamic, Dynamic>>
[src]

The mutable statuses of all the cells of this heightfield.

pub fn heights(
    &self
) -> &Matrix<f32, Dynamic, Dynamic, VecStorage<f32, Dynamic, Dynamic>>
[src]

The heights of this heightfield.

pub fn scale(
    &self
) -> &Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
[src]

The scale factor applied to this heightfield.

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

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

pub fn cell_height(&self) -> f32[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) -> f32[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) -> f32[src]

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

pub fn root_aabb(&self) -> &AABB[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,
    f: &mut impl FnMut(u32, &Triangle)
)
[src]

Applies the function f to all the triangles of this heightfield intersecting the given AABB.

impl HeightField[src]

pub fn to_trimesh(
    &self
) -> (Vec<Point<f32, 3_usize>, Global>, Vec<[u32; 3], Global>)
[src]

Discretize the boundary of this ball as a triangle-mesh.

Trait Implementations

impl Clone for HeightField[src]

impl Debug for HeightField[src]

impl From<HeightField> for TriMesh[src]

impl PointQuery for HeightField[src]

impl PointQueryWithLocation for HeightField[src]

type Location = (usize, TrianglePointLocation)

Additional shape-specific projection information Read more

impl RayCast for HeightField[src]

impl Shape for HeightField[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.