pub struct FractureModifier {
pub config: FractureConfig,
pub stress: ScalarField3D,
pub cracks: Vec<Crack>,
pub enabled: bool,
}Expand description
Fracture modifier: stress accumulation and crack propagation
Fields§
§config: FractureConfigConfiguration
stress: ScalarField3DAccumulated stress field
cracks: Vec<Crack>Active cracks
enabled: boolWhether modifier is enabled
Implementations§
Source§impl FractureModifier
impl FractureModifier
Sourcepub fn new(
config: FractureConfig,
resolution: usize,
min: (f32, f32, f32),
max: (f32, f32, f32),
) -> Self
pub fn new( config: FractureConfig, resolution: usize, min: (f32, f32, f32), max: (f32, f32, f32), ) -> Self
Create a new fracture modifier
Sourcepub fn apply_stress_at(
&mut self,
x: f32,
y: f32,
z: f32,
amount: f32,
radius: f32,
)
pub fn apply_stress_at( &mut self, x: f32, y: f32, z: f32, amount: f32, radius: f32, )
Apply stress at a point (from impact or load)
Sourcepub fn active_crack_count(&self) -> usize
pub fn active_crack_count(&self) -> usize
Number of active cracks
Source§impl FractureModifier
impl FractureModifier
Sourcepub const PARTICIPANT_KIND: ParticipantKind
pub const PARTICIPANT_KIND: ParticipantKind
Snapshot tag of this type as a world participant: "FRAC", the four
ASCII bytes read big endian. Never changes.
Trait Implementations§
Source§impl Participant for FractureModifier
One update(h) per world substep (h converted with
Fix128::to_f32); see the module documentation of
crate::sim_modifier for the payload and what is not coupled yet.
impl Participant for FractureModifier
One update(h) per world substep (h converted with
Fix128::to_f32); see the module documentation of
crate::sim_modifier for the payload and what is not coupled yet.
Observations: channel 0 the highest cell stress (absent for a grid without cells), channel 1 the number of cracks, channel 2 the number of cracks still growing.
Source§fn kind(&self) -> ParticipantKind
fn kind(&self) -> ParticipantKind
Snapshot tag of this participant type.
Source§fn substep(
&mut self,
_ctx: &mut SubstepCtx<'_>,
h: Fix128,
) -> Result<(), ParticipantFault>
fn substep( &mut self, _ctx: &mut SubstepCtx<'_>, h: Fix128, ) -> Result<(), ParticipantFault>
Advance by one world substep of width
h (ctx.h()). Read bodies
from ctx, stage forces on them through ctx. Read moreSource§fn observe(&self, out: &mut ObservationSink)
fn observe(&self, out: &mut ObservationSink)
Report observable values. The world reports them as
Observed::Undecided while a fault is recorded.Source§fn write_state(&self, out: &mut Vec<u8>)
fn write_state(&self, out: &mut Vec<u8>)
Append the whole state to
out.Source§fn check_state(&self, bytes: &[u8]) -> Result<(), StateError>
fn check_state(&self, bytes: &[u8]) -> Result<(), StateError>
Source§fn read_state(&mut self, bytes: &[u8])
fn read_state(&mut self, bytes: &[u8])
Replace the state with
bytes. Only called with a payload
Self::check_state accepted.Source§fn step_rule(&self) -> StepRule
fn step_rule(&self) -> StepRule
How this participant’s time step relates to the world substep.
Source§fn ports(&self) -> &[Port]
fn ports(&self) -> &[Port]
The ports this participant reads and writes, empty by default. The
world reads them once, at registration, to fix the execution order
(
execution_order); they must not change while the participant is
registered.Source§impl PhysicsModifier for FractureModifier
impl PhysicsModifier for FractureModifier
Auto Trait Implementations§
impl Freeze for FractureModifier
impl RefUnwindSafe for FractureModifier
impl Send for FractureModifier
impl Sync for FractureModifier
impl Unpin for FractureModifier
impl UnsafeUnpin for FractureModifier
impl UnwindSafe for FractureModifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more