pub struct ImpostorBillboard {
pub atlas_uv_min: Vec2,
pub atlas_uv_max: Vec2,
pub world_position: Vec3,
pub scale: Vec2,
pub pivot_offset: Vec3,
pub facing_angle_rad: f32,
pub num_views: u32,
pub current_view_index: u32,
pub last_update_frame: u64,
pub is_dirty: bool,
pub depth_prepass_enabled: bool,
}Fields§
§atlas_uv_min: Vec2§atlas_uv_max: Vec2§world_position: Vec3§scale: Vec2§pivot_offset: Vec3§facing_angle_rad: f32§num_views: u32§current_view_index: u32§last_update_frame: u64§is_dirty: bool§depth_prepass_enabled: boolImplementations§
Source§impl ImpostorBillboard
impl ImpostorBillboard
pub fn new(world_position: Vec3, scale: Vec2, num_views: u32) -> Self
pub fn update_view_index(&mut self, camera_pos: Vec3)
pub fn compute_billboard_matrix( &self, camera_pos: Vec3, camera_up: Vec3, ) -> Mat4
pub fn screen_space_bounds(&self, camera: &StreamingCamera) -> (Vec2, Vec2)
pub fn mark_dirty(&mut self)
pub fn clear_dirty(&mut self, frame: u64)
pub fn should_update(&self, camera_pos: Vec3, angle_threshold_deg: f32) -> bool
Trait Implementations§
Source§impl Clone for ImpostorBillboard
impl Clone for ImpostorBillboard
Auto Trait Implementations§
impl Freeze for ImpostorBillboard
impl RefUnwindSafe for ImpostorBillboard
impl Send for ImpostorBillboard
impl Sync for ImpostorBillboard
impl Unpin for ImpostorBillboard
impl UnsafeUnpin for ImpostorBillboard
impl UnwindSafe for ImpostorBillboard
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.