[][src]Struct kalast::base::body::Body

pub struct Body {
    pub name: &'static str,
    pub position: V3<f64>,
    pub object: Object3D,
    pub properties: Properties,
    // some fields omitted
}

A celestial body representation.

Definition

Body is defined by its name, its position with respect to the Sun, the shape model of its object file, the physical properties of its ground layers and its surface temperatures

Example

use kalast::{Properties, Body, ASTRONAUMICAL_UNIT, HOUR, V3};
use std::path::Path;

let mut body = Body::new(
    "Dimorphos", // name
    V3::new(0., 1., 0.) * ASTRONAUMICAL_UNIT, // distance to Sun
    Path::new("path/to/dimorphos.obj"), // 3D object path
    Properties::new(
        11.92 * HOUR, // rotation period
        11.92 * HOUR, // revolution period
        0.,           // obliquity
        500.,         // thermal inertia
        2146.,        // density
        600.,         // heat capacity
        0.07,         // albedo
        0.9,          // emissivity
    ),
);

Fields

name: &'static str

Name of the celestial body.

position: V3<f64>

Position of the celestial body with respect to the Sun (in meters).

object: Object3D

Path to the 3D object file for the shape model of the celestial body.

properties: Properties

Ground properties of the celestial body (completed with time).

Implementations

impl Body[src]

pub fn new(
    name: &'static str,
    position: V3<f64>,
    path: &'static Path,
    properties: Properties
) -> Self
[src]

Celestial body constructor.

pub fn temperatures(&mut self) -> &mut VX<f64>[src]

Temperatures getter that applies 3D object faces' mask.

  • return masked temperatures if available
  • fill masked temperatures with unmasked temperatures if available and masked temperatures unavailable

pub fn set_temperatures(&mut self, temperatures: VX<f64>)[src]

Temperatures setter that shall match 3D object faces' mask.

Also update unmasked temperatures at masked indices, for the computed temperatures with mask will not be lost in case the memoized masked temperatures is reset.

pub fn revolution_iteration(&mut self)[src]

Iterate in the revolution of the celestial body around its spin axis over a time step.

pub fn solar_flux(&mut self) -> VX<f64>[src]

Compute solar flux at the surface of the celestial body. This fixes the surface flux conditions.

pub fn illumination_cosine(&mut self) -> VX<f64>[src]

Compute the illumation angles for each face at the surface of the celestial body (angle between the normal of each face and the direction of the Sun).

pub fn facets_directions_to_sun(&mut self) -> V3X<f64>[src]

Compute the direction of the Sun for each face at the surface of the celestial body.

pub fn distance_to_sun(&self) -> f64[src]

Compute the distance of the celestial body to the Sun.

pub fn distance_to_body(&self, other: &Self) -> f64[src]

Compute the distance to another body.

pub fn position_relative_to_body(&self, other: &Self) -> V3<f64>[src]

Compute the distance to another body.

pub fn direction_to_body(&self, other: &Self) -> Unit<V3<f64>>[src]

Compute the direction to another body.

pub fn set_faces_mask_equator(&mut self)[src]

Update the view with the indices of the faces that are located at the equator.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,