pub struct BeamDesc {
pub start: [f32; 3],
pub end: [f32; 3],
pub start_color: [f32; 4],
pub end_color: [f32; 4],
pub width: f32,
pub lifetime: f32,
}Fields§
§start: [f32; 3]§end: [f32; 3]§start_color: [f32; 4]§end_color: [f32; 4]§width: f32§lifetime: f32Implementations§
Source§impl BeamDesc
impl BeamDesc
Sourcepub fn validate(&self) -> Result<(), BeamError>
pub fn validate(&self) -> Result<(), BeamError>
Checks finite endpoints/colors, width in 0..=1e6, and lifetime in
0..=MAX_EFFECT_LIFETIME excluding zero. Coincident endpoints are valid.
Colors may contain finite HDR values; they are not clamped.
use ferravex_play::particles::{BeamDesc, BeamError};
let mut desc = BeamDesc::default();
assert_eq!(desc.validate(), Ok(()));
desc.lifetime = 0.0;
assert_eq!(desc.validate(), Err(BeamError::InvalidBeam));Trait Implementations§
impl Copy for BeamDesc
impl StructuralPartialEq for BeamDesc
Auto Trait Implementations§
impl Freeze for BeamDesc
impl RefUnwindSafe for BeamDesc
impl Send for BeamDesc
impl Sync for BeamDesc
impl Unpin for BeamDesc
impl UnwindSafe for BeamDesc
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