pub struct SearchlightRenderer {
pub c: f64,
pub observer_pos: Vec3,
pub max_boost: f32,
}Expand description
Renderer that modifies entity brightness based on velocity direction relative to observer.
Fields§
§c: f64§observer_pos: Vec3§max_boost: f32Implementations§
Source§impl SearchlightRenderer
impl SearchlightRenderer
pub fn new(c: f64, observer_pos: Vec3) -> Self
Sourcepub fn entity_brightness(
&self,
entity_pos: Vec3,
entity_velocity: Vec3,
base_luminosity: f32,
) -> f32
pub fn entity_brightness( &self, entity_pos: Vec3, entity_velocity: Vec3, base_luminosity: f32, ) -> f32
Compute the apparent brightness of an entity given its position, velocity, and base luminosity.
Sourcepub fn batch_brightness(&self, entities: &[(Vec3, Vec3, f32)]) -> Vec<f32>
pub fn batch_brightness(&self, entities: &[(Vec3, Vec3, f32)]) -> Vec<f32>
Compute brightness for multiple entities.
Sourcepub fn beamed_color(
&self,
entity_pos: Vec3,
entity_velocity: Vec3,
base_color: Vec4,
) -> Vec4
pub fn beamed_color( &self, entity_pos: Vec3, entity_velocity: Vec3, base_color: Vec4, ) -> Vec4
Apply beaming to a color by scaling its RGB components.
Sourcepub fn beaming_half_angle(&self, v: f64) -> f64
pub fn beaming_half_angle(&self, v: f64) -> f64
Compute the half-angle of the beaming cone (angle where intensity drops to half of forward max).
Trait Implementations§
Source§impl Clone for SearchlightRenderer
impl Clone for SearchlightRenderer
Auto Trait Implementations§
impl Freeze for SearchlightRenderer
impl RefUnwindSafe for SearchlightRenderer
impl Send for SearchlightRenderer
impl Sync for SearchlightRenderer
impl Unpin for SearchlightRenderer
impl UnsafeUnpin for SearchlightRenderer
impl UnwindSafe for SearchlightRenderer
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.