pub struct QuantumBlob {
pub blob: SoftBodyBlob,
pub eigenstate: u8,
pub superposed: bool,
}Expand description
A soft body that oscillates between two shapes (Eigenstate boss mechanic). The frequency can be configured and represents the quantum superposition oscillation.
Fields§
§blob: SoftBodyBlob§eigenstate: u8Current eigenstate (0 or 1), toggled on “collapse”.
superposed: boolWhether currently oscillating (superposition) or collapsed.
Implementations§
Source§impl QuantumBlob
impl QuantumBlob
Sourcepub fn new(
center: Vec3,
radius: f32,
resolution: usize,
shape_a: Vec<Vec3>,
shape_b: Vec<Vec3>,
frequency: f32,
) -> Self
pub fn new( center: Vec3, radius: f32, resolution: usize, shape_a: Vec<Vec3>, shape_b: Vec<Vec3>, frequency: f32, ) -> Self
Create a quantum blob with two shape configurations.
Sourcepub fn new_default(
center: Vec3,
radius: f32,
resolution: usize,
frequency: f32,
) -> Self
pub fn new_default( center: Vec3, radius: f32, resolution: usize, frequency: f32, ) -> Self
Create with default shapes: circle (shape A) and elongated ellipse (shape B).
Sourcepub fn collapse(&mut self, state: u8)
pub fn collapse(&mut self, state: u8)
Collapse the superposition to one eigenstate. Stops oscillation.
Sourcepub fn enter_superposition(&mut self, frequency: f32)
pub fn enter_superposition(&mut self, frequency: f32)
Resume superposition oscillation.
pub fn get_hull(&self) -> Vec<Vec3>
pub fn center_position(&self) -> Vec3
Trait Implementations§
Source§impl Clone for QuantumBlob
impl Clone for QuantumBlob
Auto Trait Implementations§
impl Freeze for QuantumBlob
impl RefUnwindSafe for QuantumBlob
impl Send for QuantumBlob
impl Sync for QuantumBlob
impl Unpin for QuantumBlob
impl UnsafeUnpin for QuantumBlob
impl UnwindSafe for QuantumBlob
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.