logo
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

Creates an environment entity.

  • name - Just a name, to keep track of the entity during development.

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).

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.

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.

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.

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

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

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.

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.

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.

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.

Returns a ValueAccessor for the sun color multiplier.

Used to set/get/animate the sun color multiplier.

Returns a ValueAccessor for the ambient color.

Used to set/get/animate the ambient color. The tint of the sky

Returns a ValueAccessor for the planet radius.

Used to set/get/animate the planet radius.

Returns a ValueAccessor for the atmosphere density.

Used to set/get/animate the atmosphere density.

Returns a ValueAccessor for the atmosphere height.

Used to set/get/animate the atmosphere height in meters. The highest point of the atmosphere.

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.

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.

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.

Returns a ValueAccessor for the ozone width.

Used to set/get/animate the ozone width. The width of the ozone layer in meters.

Returns a ValueAccessor for the sky exposure.

Used to set/get/animate the sky exposure.

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.

Makes this the active environment.

Simplified wrapper for EntityMessenger::set_active.

Trait Implementations

The type of the component, as a ComponentType enum.

Adopt an Entity, wrap in a component struct.

Get the entity that the component belongs to.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.