pub struct Environment {
    pub shape: EarthShape,
    pub atmosphere: Atmosphere,
}
Expand description

Structure storing the shape of the underlying world and the atmospheric model.

Fields

shape: EarthShapeatmosphere: Atmosphere

Implementations

Returns the refractive index of the air at the given altitude minus 1

Returns the refractive index of the air at the given altitude.

Returns the derivative of the refractive index of the air with respect to the altitude, at the given altitude

Returns Some(radius in meters) if the planet model is spherical, or None if it’s flat.

Returns an object representing a light path.

The path is defined by 3 parameters:

  • start_h - the starting altitude of the path in meters
  • start_ang - the initial angle in radians between the path and the horizontal plane; -π/2 is down, 0 is horizontal, π/2 is up
  • straight - true if the path should be a straight line, false if it should be a ray affected by the atmosphere

Returns an object representing a light path.

Instead of using the initial angle, this method chooses a ray that will hit a given target. The target is defined as distance and altitude.

  • start_h - the initial altitude of the path in meters
  • tgt_h - the altitude of the target point in meters
  • tgt_dist - the distance of the target point from the initial point, in meters
  • straight - true if the path should be a straight line, false if it should be a ray affected by the atmosphere

The ray is calculated by performing a binary search on the initial angle.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.