pub struct TextureSwitchView {
pub reference_fov_y: f32,
pub reference_height: u32,
pub state: TextureSwitchState,
}Expand description
The view the distances of every TextureSwitch are stated for, and the state they are evaluated in
(core.texture_switch_view, a world resource): a camera of vertical field of view reference_fov_y measures them
as they are, a narrower one as nearer; with a reference_height, a view taller than it as nearer too. A world with
texture switches has it.
Fields§
§reference_fov_y: f32Radians, more than 0 and less than pi.
reference_height: u32The view height in pixels the distances are stated for; 0 is none: the view’s height takes no part.
state: TextureSwitchStateThe factors on the thresholds the source states the switch in.
Implementations§
Source§impl TextureSwitchView
impl TextureSwitchView
Sourcepub fn factor(&self, fov_y: f32, height: u32) -> f32
pub fn factor(&self, fov_y: f32, height: u32) -> f32
What a camera of vertical field of view fov_y (radians) drawing a view height pixels tall multiplies its
distances by before comparing them to the thresholds: tan(fov_y / 2) / tan(reference_fov_y / 2), divided by
height / reference_height where reference_height is not 0.
Trait Implementations§
Source§impl Clone for TextureSwitchView
impl Clone for TextureSwitchView
impl Copy for TextureSwitchView
Source§impl Debug for TextureSwitchView
impl Debug for TextureSwitchView
Source§impl PartialEq for TextureSwitchView
impl PartialEq for TextureSwitchView
Source§impl Resource for TextureSwitchView
impl Resource for TextureSwitchView
Source§fn verify(&self, _w: &World) -> Result<(), String>
fn verify(&self, _w: &World) -> Result<(), String>
A field of view strictly between 0 and pi; each factor of the state from 0 to 1.
const NAME: &'static str = "core.texture_switch_view"
const VERSION: u32 = 1
Source§fn references(&self, _out: &mut Vec<Entity>)
fn references(&self, _out: &mut Vec<Entity>)
out. A resource holding entity references must declare
every one of them and implement Resource::retain_references.Source§fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
keep refuses (set it to “none”). The world calls it whenever entities
leave it (World::despawn, World::retain, World::move_components) and on the copy a
World::subset or World::split_off part gets, so a resource never refers to an entity its world lacks.