pub struct WorldCoord {
pub position: DVec3,
}Expand description
A position in projected world space (meters, typically EPSG:3857).
The coordinate system is right-handed Z-up:
- X points east
- Y points north
- Z points up (altitude / terrain elevation)
Backed by a glam::DVec3 for f64 precision. The engine performs
all math in f64 and only casts to f32 at GPU upload time
(camera-relative to avoid jitter).
§Default
Default returns the origin (0, 0, 0).
§Display
Formats as "(1234.56, 5678.90, 0.00)m".
§Serde
When the serde feature is enabled, serializes as
{ "x": ..., "y": ..., "z": ... } (manual impl because DVec3
does not derive serde).
Fields§
§position: DVec3The 3D position vector in meters (X=east, Y=north, Z=up).
Implementations§
Trait Implementations§
Source§impl Clone for WorldCoord
impl Clone for WorldCoord
Source§fn clone(&self) -> WorldCoord
fn clone(&self) -> WorldCoord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorldCoord
impl Debug for WorldCoord
Source§impl<'de> Deserialize<'de> for WorldCoord
Available on crate feature serde only.
impl<'de> Deserialize<'de> for WorldCoord
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WorldCoord
impl Display for WorldCoord
Source§impl From<WorldCoord> for [f64; 3]
impl From<WorldCoord> for [f64; 3]
Source§fn from(c: WorldCoord) -> Self
fn from(c: WorldCoord) -> Self
Convert to [x, y, z] in meters.
Source§impl From<WorldCoord> for DVec3
impl From<WorldCoord> for DVec3
Source§fn from(c: WorldCoord) -> Self
fn from(c: WorldCoord) -> Self
Extract the inner DVec3.
Source§impl PartialEq for WorldCoord
impl PartialEq for WorldCoord
Source§impl Serialize for WorldCoord
Available on crate feature serde only.
impl Serialize for WorldCoord
Available on crate feature
serde only.impl Copy for WorldCoord
impl StructuralPartialEq for WorldCoord
Auto Trait Implementations§
impl Freeze for WorldCoord
impl RefUnwindSafe for WorldCoord
impl Send for WorldCoord
impl Sync for WorldCoord
impl Unpin for WorldCoord
impl UnsafeUnpin for WorldCoord
impl UnwindSafe for WorldCoord
Blanket Implementations§
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