pub struct PyParticleRenderer {
pub positions: Vec<f64>,
pub radii: Vec<f64>,
pub colors: Vec<f64>,
pub billboard: bool,
pub use_instancing: bool,
pub colormap: Option<PyColormap>,
}Expand description
Renderer for particle systems using billboard or instanced geometry.
Fields§
§positions: Vec<f64>Flat array of particle positions: [x0, y0, z0, x1, y1, z1, …].
radii: Vec<f64>Per-particle radii. If length is 1, all particles share that radius.
colors: Vec<f64>Per-particle RGBA colors. Flat array: [r0, g0, b0, a0, r1, …].
billboard: boolWhether to use billboard rendering (always face camera).
use_instancing: boolWhether to use hardware instancing (more efficient for large counts).
colormap: Option<PyColormap>Optional colormap applied over a scalar field.
Implementations§
Source§impl PyParticleRenderer
impl PyParticleRenderer
Sourcepub fn set_uniform_radius(&mut self, radius: f64)
pub fn set_uniform_radius(&mut self, radius: f64)
Set uniform radius for all particles.
Sourcepub fn set_colors_from_scalars(
&mut self,
scalars: &[f64],
colormap: &PyColormap,
)
pub fn set_colors_from_scalars( &mut self, scalars: &[f64], colormap: &PyColormap, )
Set per-particle colors from a colormap and scalar values.
Sourcepub fn particle_count(&self) -> usize
pub fn particle_count(&self) -> usize
Return the number of particles.
Trait Implementations§
Source§impl Clone for PyParticleRenderer
impl Clone for PyParticleRenderer
Source§fn clone(&self) -> PyParticleRenderer
fn clone(&self) -> PyParticleRenderer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PyParticleRenderer
impl Debug for PyParticleRenderer
Source§impl<'de> Deserialize<'de> for PyParticleRenderer
impl<'de> Deserialize<'de> for PyParticleRenderer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PyParticleRenderer
impl RefUnwindSafe for PyParticleRenderer
impl Send for PyParticleRenderer
impl Sync for PyParticleRenderer
impl Unpin for PyParticleRenderer
impl UnsafeUnpin for PyParticleRenderer
impl UnwindSafe for PyParticleRenderer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.