pub struct ModelParticle {
pub position: Vec3,
pub character: char,
pub color: Vec4,
pub emission: f32,
pub normal: Vec3,
pub bone_weights: [f32; 4],
pub bone_indices: [u8; 4],
pub group_id: u32,
pub layer_id: u8,
pub selected: bool,
pub locked: bool,
}Fields§
§position: Vec3§character: char§color: Vec4§emission: f32§normal: Vec3§bone_weights: [f32; 4]§bone_indices: [u8; 4]§group_id: u32§layer_id: u8§selected: bool§locked: boolImplementations§
Source§impl ModelParticle
impl ModelParticle
pub fn new(position: Vec3, character: char, color: Vec4) -> Self
pub fn with_normal(self, normal: Vec3) -> Self
pub fn with_emission(self, emission: f32) -> Self
pub fn with_group(self, group_id: u32) -> Self
Sourcepub fn snapped_position(&self, grid_size: f32) -> Vec3
pub fn snapped_position(&self, grid_size: f32) -> Vec3
Returns the position snapped to a grid of given cell size.
Trait Implementations§
Source§impl Clone for ModelParticle
impl Clone for ModelParticle
Source§impl Debug for ModelParticle
impl Debug for ModelParticle
Auto Trait Implementations§
impl Freeze for ModelParticle
impl RefUnwindSafe for ModelParticle
impl Send for ModelParticle
impl Sync for ModelParticle
impl Unpin for ModelParticle
impl UnsafeUnpin for ModelParticle
impl UnwindSafe for ModelParticle
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.