Skip to main content

WorldPartition

Struct WorldPartition 

Source
pub struct WorldPartition<S: CellSource> { /* private fields */ }
Expand description

Kopflose, deterministische Welt-Partition (siehe Modul-Doku).

Implementations§

Source§

impl<S: CellSource> WorldPartition<S>

Source

pub fn new(cfg: PartitionConfig, source: S) -> Self

Source

pub fn time(&self) -> f64

Weltzeit in Sekunden (Start bei 0, wächst um jedes dt).

Source

pub fn config(&self) -> &PartitionConfig

Source

pub fn clipmap(&self) -> &Clipmap

Source

pub fn streamer(&self) -> &Streamer<S>

Source

pub fn hlod(&self) -> &HlodSet

Die HLOD-Cluster-Menge (Fernfeld am Clipmap-Rand, siehe hlod).

Source

pub fn enable_hlod(&mut self, cfg: HlodConfig)

HLOD mit anderer Übernahmezone/anderem Raster neu aufsetzen — der Bestand startet versteckt (der Bake wird danach eingetragen).

Source

pub fn hlod_mut(&mut self) -> &mut HlodSet

Bake-Nachschub: Cluster registrieren/entfernen, ohne die Zone zu ändern.

Source

pub fn instances(&self) -> &[Instance]

Source

pub fn spawn(&mut self, position: Vec2, camera: Option<Vec2>) -> usize

Instanz hinzufügen; die Startstufe kommt sofort aus der Distanz zu camera (ohne Kamera-Angabe startet sie bei T4).

Source

pub fn despawn(&mut self, id: usize) -> Option<Instance>

Instanz entfernen. Achtung: remove verschiebt den letzten Eintrag nach id — alle Indizes > id wandern um eins zurück.

Source

pub fn tier_of(&self, id: usize) -> Option<Tier>

Stufe einer Instanz abfragen.

Source

pub fn set_instance_position(&mut self, id: usize, position: Vec2) -> bool

Positionsführung von außen (Bewegung, Physik, Ego-Handoff): Instanz umsetzen; die Stufenneubewertung passiert im nächsten update. false bei ungültigem Index.

Source

pub fn update(&mut self, camera: Vec2, dt: f32) -> PartitionDelta<S::Payload>

Ein Frame: Clipmap nachziehen, Streaming treiben, Stufen rechnen.

Die Reihenfolge ist Teil der Determinismus-Zusage: erst Zellen, dann Instanzen, und beide Ereignislisten in fester Sortierung.

Auto Trait Implementations§

§

impl<S> Freeze for WorldPartition<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for WorldPartition<S>
where S: RefUnwindSafe,

§

impl<S> Send for WorldPartition<S>
where S: Send,

§

impl<S> Sync for WorldPartition<S>
where S: Sync,

§

impl<S> Unpin for WorldPartition<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for WorldPartition<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for WorldPartition<S>
where S: UnwindSafe,

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> 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, 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.