Struct cell_map::CellMapParams[][src]

pub struct CellMapParams {
    pub cell_size: Vector2<f64>,
    pub cell_bounds: Bounds,
    pub rotation_in_parent_rad: f64,
    pub position_in_parent: Vector2<f64>,
    pub cell_boundary_precision: f64,
}
Expand description

Contains parameters required to construct a CellMap

Fields

cell_size: Vector2<f64>

The size (resolution) of each cell in the map, in parent frame coordinates.

Default

The default value is [1.0, 1.0].

cell_bounds: Bounds

The number of cells in the x and y directions.

Default

The default value is Bounds::empty().

rotation_in_parent_rad: f64

The rotation of the map’s Z axis about the parent Z axis in radians.

Default

The default value is 0.0.

position_in_parent: Vector2<f64>

The position of the origin of the map in the parent frame, in parent frame units.

Default

The default value is [0.0, 0.0].

cell_boundary_precision: f64

The precision to use when determining cell boundaries.

This precision factor allows us to account for times when a cell position should fit into a particular cell index, but due to floating point rounding does not. For example take a map with a cell_size = [0.1, 0.1], the cell index of the position [0.7, 0.1] should be [7, 1], however the positions floating point index would be calculated as [6.999999999999998, 0.9999999999999999], which if floor()ed to fit into a usize would give the incorrect index [6, 0].

When calculating cell index we therefore floor the floating point index unless it is within cell_size * cell_boundary_precision, in which case we round up to the next cell. Mutliplying by cell_size allows this value to be independent of the scale of the map.

Default

The default value is 1e-10.

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

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. 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.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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.