Skip to main content

ShipModelDistance

Struct ShipModelDistance 

Source
pub struct ShipModelDistance(/* private fields */);
Expand description

Distance in ship-model coordinate units (1 unit = 15 meters). Hull geometry uses this space: .visual node matrices, the .skel_ext nodes hung off them, and the meshes they position.

The 15 is measured, and good to roughly +/-3%. That is the precision budget of anything derived from it: a position 100 m from the hull origin carries about 3 m of scale uncertainty.

The tightest evidence does not come from geometry at all. Solving the main-battery dispersion formula against published port dispersion gives 14.976 for North Carolina and 14.851 for Yamato (wowsunpack::game_params::ttx::constants::BW_TO_SHIP). That route is only independent of the geometry if the dispersion formula’s ship space and the .visual/.skel_ext space are the same space, which is inferred from the shared engine import name and not otherwise established.

Geometric measurements agree but individually are looser: Iowa’s waterline beam puts the scale at 15.06 m/unit, while the model bounding box against A_Hull.size[0] implies about 14.8 across the roster. The exported hierarchy carries no scale of its own; Scene Root, export and the hull nodes are identity. See docs/FIRE_CHANCE.md section 5.1.

Implementations§

Source§

impl ShipModelDistance

Source

pub const ZERO: ShipModelDistance

Source

pub const fn new(v: f32) -> Self

Const constructor for use in static/const contexts.

Source

pub fn value(self) -> f32

Source

pub fn max_zero(self) -> Self

Clamp to a non-negative distance.

Source

pub fn to_meters(self) -> Meters

Source

pub fn to_bigworld(self) -> BigWorldDistance

Trait Implementations§

Source§

impl Add for ShipModelDistance

Source§

type Output = ShipModelDistance

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ShipModelDistance) -> ShipModelDistance

Performs the + operation. Read more
Source§

impl Clone for ShipModelDistance

Source§

fn clone(&self) -> ShipModelDistance

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ShipModelDistance

Source§

impl Debug for ShipModelDistance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShipModelDistance

Source§

fn default() -> ShipModelDistance

Returns the “default value” for a type. Read more
Source§

impl From<f32> for ShipModelDistance

Source§

fn from(v: f32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ShipModelDistance

Source§

fn eq(&self, other: &ShipModelDistance) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ShipModelDistance

Source§

fn partial_cmp(&self, other: &ShipModelDistance) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for ShipModelDistance

Source§

impl Sub for ShipModelDistance

Source§

type Output = ShipModelDistance

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ShipModelDistance) -> ShipModelDistance

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.