pub struct BeamView {
pub start: [f32; 3],
pub end: [f32; 3],
pub start_color: [f32; 4],
pub end_color: [f32; 4],
pub width: f32,
pub normalized_age: f32,
}Fields§
§start: [f32; 3]§end: [f32; 3]§start_color: [f32; 4]§end_color: [f32; 4]§width: f32§normalized_age: f32Implementations§
Source§impl BeamView
impl BeamView
pub fn points(self) -> [RibbonPoint; 2]
Sourcepub fn triangles(
self,
facing: RibbonFacing,
) -> Result<impl Iterator<Item = RibbonTriangle>, RibbonError>
pub fn triangles( self, facing: RibbonFacing, ) -> Result<impl Iterator<Item = RibbonTriangle>, RibbonError>
Generates at most two triangles using the shared ribbon tessellator,
without allocation or borrowing the view/pool. Invalid geometry fields
return RibbonError::InvalidPoint; invalid facing returns
RibbonError::InvalidView. normalized_age is metadata, not geometry.
Coincident endpoints emit no triangles. Camera-parallel segments use
projected camera up, then a deterministic perpendicular when up is also
parallel. Non-finite output vertices are skipped by the tessellator.
Colors, distance UVs and winding match RibbonTriangles over
Self::points. No random state or elapsed time is consumed.
use ferravex_play::particles::{BeamDesc, BeamPool, OverflowPolicy, RibbonFacing};
let mut pool = BeamPool::new(1, OverflowPolicy::DropNewest);
pool.spawn(BeamDesc::default()).unwrap();
let beam = pool.iter().next().unwrap();
let triangles = beam.triangles(RibbonFacing::Camera {
eye: [0.0, 0.0, 5.0], up: [0.0, 0.0, 1.0],
}).unwrap();
assert_eq!(triangles.count(), 2);Trait Implementations§
impl Copy for BeamView
impl StructuralPartialEq for BeamView
Auto Trait Implementations§
impl Freeze for BeamView
impl RefUnwindSafe for BeamView
impl Send for BeamView
impl Sync for BeamView
impl Unpin for BeamView
impl UnwindSafe for BeamView
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