pub struct ExtStressSolver { /* private fields */ }Expand description
High-level stress solver that manages NvBlast families, actors, and fracture commands.
This is the primary API for most users. It wraps the C++ ExtStressSolver which internally
manages an NvBlast asset, family, and actors alongside the stress computation.
Implementations§
Source§impl ExtStressSolver
impl ExtStressSolver
Sourcepub fn new(
nodes: &[NodeDesc],
bonds: &[BondDesc],
settings: &SolverSettings,
) -> Option<Self>
pub fn new( nodes: &[NodeDesc], bonds: &[BondDesc], settings: &SolverSettings, ) -> Option<Self>
Create a solver from node and bond descriptors with the given settings.
Sourcepub fn set_settings(&mut self, settings: &SolverSettings)
pub fn set_settings(&mut self, settings: &SolverSettings)
Update solver settings.
Sourcepub fn add_force(
&mut self,
node_index: u32,
position: Vec3,
force: Vec3,
mode: ForceMode,
)
pub fn add_force( &mut self, node_index: u32, position: Vec3, force: Vec3, mode: ForceMode, )
Apply a force to a specific node.
Sourcepub fn add_gravity(&mut self, gravity: Vec3)
pub fn add_gravity(&mut self, gravity: Vec3)
Apply gravity to all actors.
Sourcepub fn add_actor_gravity(&mut self, actor_index: u32, gravity: Vec3) -> bool
pub fn add_actor_gravity(&mut self, actor_index: u32, gravity: Vec3) -> bool
Apply gravity to a specific actor.
Sourcepub fn overstressed_bond_count(&self) -> u32
pub fn overstressed_bond_count(&self) -> u32
Number of bonds that exceeded their fatal stress limit after the last update().
Sourcepub fn linear_error(&self) -> f32
pub fn linear_error(&self) -> f32
Linear error residual from the last solve.
Sourcepub fn angular_error(&self) -> f32
pub fn angular_error(&self) -> f32
Angular error residual from the last solve.
Sourcepub fn actor_count(&self) -> u32
pub fn actor_count(&self) -> u32
Number of actors currently in the family.
Sourcepub fn node_count(&self) -> u32
pub fn node_count(&self) -> u32
Total number of graph nodes.
Sourcepub fn bond_count(&self) -> u32
pub fn bond_count(&self) -> u32
Total number of bonds.
Sourcepub fn generate_fracture_commands(&self) -> Vec<FractureCommand>
pub fn generate_fracture_commands(&self) -> Vec<FractureCommand>
Generate fracture commands for all actors with overstressed bonds.
Sourcepub fn apply_fracture_commands(
&mut self,
commands: &[FractureCommand],
) -> Vec<SplitEvent>
pub fn apply_fracture_commands( &mut self, commands: &[FractureCommand], ) -> Vec<SplitEvent>
Apply fracture commands and return split events.
Trait Implementations§
Source§impl Drop for ExtStressSolver
impl Drop for ExtStressSolver
impl Send for ExtStressSolver
impl Sync for ExtStressSolver
Auto Trait Implementations§
impl Freeze for ExtStressSolver
impl RefUnwindSafe for ExtStressSolver
impl Unpin for ExtStressSolver
impl UnsafeUnpin for ExtStressSolver
impl UnwindSafe for ExtStressSolver
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.