Skip to main content

MdfNode

Struct MdfNode 

Source
pub struct MdfNode {
    pub cell_mn: V3,
    pub cell_mx: V3,
    pub c: V3,
    pub center_d: f32,
    pub sub_mn: V3,
    pub sub_mx: V3,
    pub child0: u32,
    pub child1: u32,
    pub tri0: u32,
    pub trin: u32,
}
Expand description

Ein Baumknoten. Die Feldreihenfolge ist Speichervertrag mit MdfNode in meshdf.wgsl (6 × 16 Byte). cell_mn/cell_mx sind die Zellgrenzen (der Split-Raum), sub_mn/sub_mx die Hüllbox der Dreiecke unter dem Knoten — die darf über die Zelle hinausragen, weil zugewiesene Dreiecke aus der Zelle herausragen dürfen.

Fields§

§cell_mn: V3§cell_mx: V3§c: V3

Zellenmittelpunkt (cell_mn + cell_mx) * 0.5 — gebacken, nicht zur Laufzeit rekonstruiert, damit beide Seiten denselben Wert führen.

§center_d: f32§sub_mn: V3§sub_mx: V3§child0: u32

Index des ersten Kindes; NO_CHILD markiert das Blatt.

§child1: u32§tri0: u32

Dreiecksscheibe im Blatt (tris[tri0 .. tri0+trin]).

§trin: u32

Implementations§

Source§

impl MdfNode

Source

pub fn pack(&self) -> [u32; 24]

Words für den Storage-Buffer — 24 Words = 96 Bytes, Wort für Wort identisch zum MdfNode-Speichervertrag in meshdf.wgsl (vec3-Felder an 16-Byte-Grenzen, Kind- und Scheibenwerte als u32 im letzten Wortpaar-Satz).

Trait Implementations§

Source§

impl Clone for MdfNode

Source§

fn clone(&self) -> MdfNode

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 MdfNode

Source§

impl Debug for MdfNode

Source§

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

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

impl PartialEq for MdfNode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MdfNode

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.