Struct lodtree::coords::OctVec[][src]

pub struct OctVec {
    pub x: u64,
    pub y: u64,
    pub z: u64,
    pub depth: u8,
}
Expand description

A Lod Vector for use in an octree It subdivides into 8 children of equal size

Fields

x: u64

x position in the octree

y: u64

y position in the octree

z: u64

z position in the octree

depth: u8

lod depth in the octree this is limited, hence we use u8

Implementations

creates a new vector from the raw x and y coords

Args

  • x The x position in the tree. Allowed range scales with the depth (doubles as the depth increases by one)
  • y The y position in the tree. Allowed range scales with the depth (doubles as the depth increases by one)
  • z The z position in the tree. Allowed range scales with the depth (doubles as the depth increases by one)
  • depth the lod depth the coord is at. This is soft limited at roughly 60, and the tree might behave weird if it gets higher

creates a new vector from floating point coords mapped so that (0, 0, 0) is the front bottom left corner and (1, 1, 1) is the back top right

Args

  • x x coord of the float vector, from 0 to 1
  • y y coord of the float vector, from 0 to 1
  • z z coord of the float vector, from 0 to 1
  • depth The lod depth of the coord

converts the coord into float coords Returns a tuple of (x: f64, y: f64, z: f64) to represent the coordinates, at the front bottom left corner

gets the size the chunk of this lod vector takes up, with the root taking up

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

get the number of child nodes a node can have in the tree

returns the lod vector as if it’s at the root of the tree

gets one of the child node position of this node, defined by it’s index

wether the node can subdivide, compared to another node and the required detail. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.