Struct HierarchicalSpacetimeCoord
#[repr(C)]pub struct HierarchicalSpacetimeCoord {
pub sector_id: u64,
pub scale_tier: u8,
pub _pad: [u8; 7],
pub local_xyz: [f32; 3],
pub local_t: f32,
}Expand description
Hierarchical multi-scale spacetime coordinate (32 bytes, #[repr(C)], Pod).
Fields§
§sector_id: u64Coarse sector ID (e.g., 64-bit Hilbert / HEALPix / Astro-Grid cell)
scale_tier: u8Scale tier exponent S in [0..7] -> step = 10^(3*S - 9) meters
_pad: [u8; 7]§local_xyz: [f32; 3]Fine local offset within sector in f32
local_t: f32Coordinate time t (seconds relative to sector epoch)
Implementations§
§impl HierarchicalSpacetimeCoord
impl HierarchicalSpacetimeCoord
pub fn scale_step_meters(scale_tier: u8) -> f64
pub fn scale_step_meters(scale_tier: u8) -> f64
Computes metric step in meters for scale tier S in [0..7]: 10^(3*S - 9).
pub fn to_meters_f64(&self) -> [f64; 3]
pub fn to_meters_f64(&self) -> [f64; 3]
Convert local offset to meters in double-precision f64.
pub fn from_meters_f64(
sector_id: u64,
scale_tier: u8,
xyz_meters: [f64; 3],
local_t: f32,
) -> HierarchicalSpacetimeCoord
pub fn from_meters_f64( sector_id: u64, scale_tier: u8, xyz_meters: [f64; 3], local_t: f32, ) -> HierarchicalSpacetimeCoord
Construct from metric position in meters at a given scale tier.
pub fn camera_relative_offset(
&self,
cam: &HierarchicalSpacetimeCoord,
sector_span_meters: f64,
) -> [f32; 3]
pub fn camera_relative_offset( &self, cam: &HierarchicalSpacetimeCoord, sector_span_meters: f64, ) -> [f32; 3]
Calculate camera-relative fine offset in meters.
Trait Implementations§
§impl Clone for HierarchicalSpacetimeCoord
impl Clone for HierarchicalSpacetimeCoord
§fn clone(&self) -> HierarchicalSpacetimeCoord
fn clone(&self) -> HierarchicalSpacetimeCoord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HierarchicalSpacetimeCoord
§impl Debug for HierarchicalSpacetimeCoord
impl Debug for HierarchicalSpacetimeCoord
§impl Default for HierarchicalSpacetimeCoord
impl Default for HierarchicalSpacetimeCoord
§fn default() -> HierarchicalSpacetimeCoord
fn default() -> HierarchicalSpacetimeCoord
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for HierarchicalSpacetimeCoord
impl<'de> Deserialize<'de> for HierarchicalSpacetimeCoord
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HierarchicalSpacetimeCoord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HierarchicalSpacetimeCoord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq for HierarchicalSpacetimeCoord
impl PartialEq for HierarchicalSpacetimeCoord
impl Pod for HierarchicalSpacetimeCoord
§impl Serialize for HierarchicalSpacetimeCoord
impl Serialize for HierarchicalSpacetimeCoord
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for HierarchicalSpacetimeCoord
Auto Trait Implementations§
impl Freeze for HierarchicalSpacetimeCoord
impl RefUnwindSafe for HierarchicalSpacetimeCoord
impl Send for HierarchicalSpacetimeCoord
impl Sync for HierarchicalSpacetimeCoord
impl Unpin for HierarchicalSpacetimeCoord
impl UnsafeUnpin for HierarchicalSpacetimeCoord
impl UnwindSafe for HierarchicalSpacetimeCoord
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> NoUninit for Twhere
T: Pod,
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.