[−][src]Struct kalast::base::body::Body
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]
name: &'static str,
position: V3<f64>,
path: &'static Path,
properties: Properties
) -> Self
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
impl RefUnwindSafe for Body
[src]
impl Send for Body
[src]
impl Sync for Body
[src]
impl Unpin for Body
[src]
impl UnwindSafe for Body
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub unsafe fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,