#[repr(C)]pub struct GpuDensityEntityData {
pub position_scale: [f32; 4],
pub color: [f32; 4],
pub params: [f32; 4],
pub params2: [f32; 4],
pub bones: [GpuBone; 16],
}Expand description
Everything the GPU needs to draw one entity this frame.
Fields§
§position_scale: [f32; 4]World position, and the scale from entity space to world units.
color: [f32; 4]A tint over every bone’s colour. White leaves them alone.
params: [f32; 4](hp_ratio, breath_phase, breath_amplitude, density_falloff).
params2: [f32; 4](bone_count, particle_count, jitter, binding_strength).
bones: [GpuBone; 16]Implementations§
Source§impl GpuDensityEntityData
impl GpuDensityEntityData
Sourcepub fn bone_count(&self) -> usize
pub fn bone_count(&self) -> usize
How many bones are live.
Sourcepub fn requested_particles(&self) -> u32
pub fn requested_particles(&self) -> u32
How many particles the entity asked to be drawn with.
Sourcepub fn particle_count(&self, budget: u32) -> u32
pub fn particle_count(&self, budget: u32) -> u32
The particle count actually drawn, under a budget.
Trait Implementations§
Source§impl Clone for GpuDensityEntityData
impl Clone for GpuDensityEntityData
impl Copy for GpuDensityEntityData
Source§impl Debug for GpuDensityEntityData
impl Debug for GpuDensityEntityData
Source§impl PartialEq for GpuDensityEntityData
impl PartialEq for GpuDensityEntityData
impl Pod for GpuDensityEntityData
impl StructuralPartialEq for GpuDensityEntityData
Auto Trait Implementations§
impl Freeze for GpuDensityEntityData
impl RefUnwindSafe for GpuDensityEntityData
impl Send for GpuDensityEntityData
impl Sync for GpuDensityEntityData
impl Unpin for GpuDensityEntityData
impl UnsafeUnpin for GpuDensityEntityData
impl UnwindSafe for GpuDensityEntityData
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.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.