pub struct PolygonCollider { /* private fields */ }Expand description
Bounded simple polygon obstacle, prepared once rather than per particle.
Implementations§
Source§impl PolygonCollider
impl PolygonCollider
Sourcepub fn new(
vertices: Arc<[Point]>,
response: CollisionResponse,
) -> Result<Self, ValidationError>
pub fn new( vertices: Arc<[Point]>, response: CollisionResponse, ) -> Result<Self, ValidationError>
Validates 3..=256 finite vertices and rejects intersecting nonadjacent edges.
Trait Implementations§
Source§impl Clone for PolygonCollider
impl Clone for PolygonCollider
Source§impl Debug for PolygonCollider
impl Debug for PolygonCollider
Source§impl ParticleModifier for PolygonCollider
impl ParticleModifier for PolygonCollider
Source§fn apply(
&self,
particle: &mut Particle,
step: f32,
_: Time,
_: &mut Random,
) -> Result<(), ValidationError>
fn apply( &self, particle: &mut Particle, step: f32, _: Time, _: &mut Random, ) -> Result<(), ValidationError>
Updates one live particle; index and canonical age remain engine-owned.
Source§fn apply_event(
&self,
particle: &mut Particle,
step: f32,
_: Time,
_: &mut Random,
) -> Result<bool, ValidationError>
fn apply_event( &self, particle: &mut Particle, step: f32, _: Time, _: &mut Random, ) -> Result<bool, ValidationError>
Optional predicted-step collision response, preserving the original callback API.
Source§fn resets_color(&self) -> bool
fn resets_color(&self) -> bool
Requests birth-color restoration before the ordered modifier chain.
Multiplicative lifetime energy curves use this to avoid frame-count accumulation.
Auto Trait Implementations§
impl Forget for PolygonCollider
impl Freeze for PolygonCollider
impl Move for PolygonCollider
impl RefUnwindSafe for PolygonCollider
impl Send for PolygonCollider
impl Sync for PolygonCollider
impl Unpin for PolygonCollider
impl UnsafeUnpin for PolygonCollider
impl UnwindSafe for PolygonCollider
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