pub struct FluidRenderer {
pub iso_threshold: f32,
pub base_color: [f32; 4],
pub dense_color: [f32; 4],
pub glyph_scale: f32,
pub show_interior: bool,
}Expand description
Extracts density iso-surface points and colors for integration with GlyphPool.
Fields§
§iso_threshold: f32Iso-density threshold for surface extraction.
base_color: [f32; 4]Base color for the fluid.
dense_color: [f32; 4]Color at high density.
glyph_scale: f32Glyph scale.
show_interior: boolWhether to include interior particles.
Implementations§
Source§impl FluidRenderer
impl FluidRenderer
pub fn new() -> Self
pub fn with_color(self, color: [f32; 4]) -> Self
pub fn with_iso_threshold(self, t: f32) -> Self
pub fn with_scale(self, s: f32) -> Self
Sourcepub fn extract(&self, sim: &SphSimulation) -> Vec<FluidGlyph>
pub fn extract(&self, sim: &SphSimulation) -> Vec<FluidGlyph>
Extract glyph positions and colors from a simulation.
Sourcepub fn extract_region(
&self,
sim: &SphSimulation,
min: Vec3,
max: Vec3,
) -> Vec<FluidGlyph>
pub fn extract_region( &self, sim: &SphSimulation, min: Vec3, max: Vec3, ) -> Vec<FluidGlyph>
Extract a subset limited to a bounding box.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FluidRenderer
impl RefUnwindSafe for FluidRenderer
impl Send for FluidRenderer
impl Sync for FluidRenderer
impl Unpin for FluidRenderer
impl UnsafeUnpin for FluidRenderer
impl UnwindSafe for FluidRenderer
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> 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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.