Struct ark_api::world::Environment
source · [−]pub struct Environment { /* private fields */ }
Expand description
Environment component accessor.
An environment is represented by an entity with the Environment component. It lets you control the sun direction (and in the future other sky and environmental properties).
Currently, the last created environment is the one that will be used.
Implementations
sourceimpl Environment
impl Environment
sourcepub fn create(name: &str) -> Self
pub fn create(name: &str) -> Self
Creates an environment entity.
name
- Just a name, to keep track of the entity during development.
sourcepub fn sun_direction(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn sun_direction(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the sun direction of the environment.
Used to set/get/animate where the sun shines from. Note: World-space direction (extended to infinity).
sourcepub fn sun_size_multiplier(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn sun_size_multiplier(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the sun size muliplier of the environment.
Used to set/get/animate the sun color. The base of the sun size is based on real life values.
sourcepub fn gravity_vector(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn gravity_vector(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the gravity vector of the environment.
Used to set/get/animate the gravity vector.
Will be used for objects that have dynamic physics enabled.
sourcepub fn fog_density(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn fog_density(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the fog density of the environment.
Used to set/get/animate the fog density. Fog density means the tickness of the fog where zero is no fog and infinity means infinitely thick fog.
sourcepub fn fog_height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn fog_height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the fog height of the environment.
Used to set/get/animate the fog height. The world height at which the base of the exponential falloff starts
sourcepub fn fog_height_falloff(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn fog_height_falloff(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the fog height falloff of the environment.
Used to set/get/animate the fog height falloff. The exponential rate of falloff. Zero means no falloff, and infinity means a sharp boundary
sourcepub fn fog_start(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn fog_start(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the minimum fog distance of the environment.
Used to set/get/animate the minimum fog distance. Fog within this distance does not contribute.
sourcepub fn fog_color(&self) -> ValueAccessorReadWriteAnimate<Vec4>
pub fn fog_color(&self) -> ValueAccessorReadWriteAnimate<Vec4>
Returns a ValueAccessor
for the fog color of the environment.
Used to set/get/animate the fog color. The alpha component can be used to specify a maximum opacity for the final fog result.
sourcepub fn exposure(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn exposure(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the fog color of the environment.
Used to set/get/animate the fog color. The alpha component can be used to specify a maximum opacity for the final fog result.
sourcepub fn gi_volume_size(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn gi_volume_size(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the global illumination volume size.
Used to set/get/animate the global illumination volume size. The square size of the global illumination region around the world origin.
sourcepub fn sun_color_multiplier(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn sun_color_multiplier(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the sun color multiplier.
Used to set/get/animate the sun color multiplier.
sourcepub fn ambient_color(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn ambient_color(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the ambient color.
Used to set/get/animate the ambient color. The tint of the sky
sourcepub fn planet_radius(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn planet_radius(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the planet radius.
Used to set/get/animate the planet radius.
sourcepub fn atmosphere_density(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn atmosphere_density(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the atmosphere density.
Used to set/get/animate the atmosphere density.
sourcepub fn atmosphere_height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn atmosphere_height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the atmosphere height.
Used to set/get/animate the atmosphere height in meters. The highest point of the atmosphere.
sourcepub fn rayleigh_height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn rayleigh_height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the rayleigh height.
Used to set/get/animate the rayleigh height in meters. The highest point of the gas molecule layer. Should always be less then the atmosphere height.
sourcepub fn ozone_height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn ozone_height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the ozone height.
Used to set/get/animate the ozone height in meters. The highest point of the ozone layer. Should always be less then the atmosphere height.
sourcepub fn mie_height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn mie_height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the mie height.
Used to set/get/animate the mie height. The highest point of the aerosol layer in meters. Should always be less then the atmosphere height.
sourcepub fn ozone_width(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn ozone_width(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the ozone width.
Used to set/get/animate the ozone width. The width of the ozone layer in meters.
sourcepub fn sky_exposure(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn sky_exposure(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the sky exposure.
Used to set/get/animate the sky exposure.
sourcepub fn set_collision_matrix(&self, matrix: &CollisionMatrix)
pub fn set_collision_matrix(&self, matrix: &CollisionMatrix)
Sets a global collision matrix.
Currently not actually bound to the environment. Can be set at any time to change collision behavior of entities with matching layers.
sourcepub fn set_active(&self)
pub fn set_active(&self)
Makes this the active environment.
Simplified wrapper for EntityMessenger::set_active
.
Trait Implementations
sourceimpl ComponentTrait for Environment
impl ComponentTrait for Environment
sourcefn get_type() -> ComponentType
fn get_type() -> ComponentType
The type of the component, as a ComponentType
enum.
sourcefn from_entity(handle: Entity) -> Self
fn from_entity(handle: Entity) -> Self
Adopt an Entity
, wrap in a component struct.
Auto Trait Implementations
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnwindSafe for Environment
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more