Skip to content

Commit

Permalink
feat: add a way to retrieve/modify the heightfield flags
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed May 5, 2024
1 parent 5255645 commit e6fd532
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/shape/heightfield3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bitflags::bitflags! {
)]
#[repr(C)]
#[derive(Default)]
/// The status of the cell of an heightfield.
/// Flags controlling the behavior of some operations involving heightfields.
pub struct HeightFieldFlags: u8 {
/// If set, a special treatment will be applied to contact manifold calculation to eliminate
/// or fix contacts normals that could lead to incorrect bumps in physics simulation (especially
Expand Down Expand Up @@ -527,6 +527,16 @@ impl HeightField {
&mut self.status
}

/// The heightfield’s flags controlling internal-edges handling.
pub fn flags(&self) -> HeightFieldFlags {
self.flags
}

/// Sets the heightfield’s flags controlling internal-edges handling.
pub fn set_flags(&mut self, flags: HeightFieldFlags) {
self.flags = flags;
}

/// The heights of this heightfield.
pub fn heights(&self) -> &DMatrix<Real> {
&self.heights
Expand Down

0 comments on commit e6fd532

Please sign in to comment.