pub struct ParticleRenderer {
pub camera_pos: [f32; 3],
pub camera_right: [f32; 3],
pub camera_up: [f32; 3],
}Expand description
Collects alive particles, depth-sorts them back-to-front, and generates billboard quad geometry aligned to the view plane.
Fields§
§camera_pos: [f32; 3]Camera position used for depth sorting and billboard orientation.
camera_right: [f32; 3]Camera right vector (normalised).
camera_up: [f32; 3]Camera up vector (normalised).
Implementations§
Source§impl ParticleRenderer
impl ParticleRenderer
Sourcepub fn set_camera(&mut self, pos: [f32; 3], right: [f32; 3], up: [f32; 3])
pub fn set_camera(&mut self, pos: [f32; 3], right: [f32; 3], up: [f32; 3])
Update camera orientation.
Sourcepub fn render(&self, particles: &[GpuParticle]) -> RenderBatch
pub fn render(&self, particles: &[GpuParticle]) -> RenderBatch
Build a RenderBatch from alive particles, sorted back-to-front.
Trait Implementations§
Source§impl Clone for ParticleRenderer
impl Clone for ParticleRenderer
Source§fn clone(&self) -> ParticleRenderer
fn clone(&self) -> ParticleRenderer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParticleRenderer
impl Debug for ParticleRenderer
Auto Trait Implementations§
impl Freeze for ParticleRenderer
impl RefUnwindSafe for ParticleRenderer
impl Send for ParticleRenderer
impl Sync for ParticleRenderer
impl Unpin for ParticleRenderer
impl UnsafeUnpin for ParticleRenderer
impl UnwindSafe for ParticleRenderer
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<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