Skip to main content

GridRectangleLike

Trait GridRectangleLike 

Source
pub trait GridRectangleLike {
    // Required method
    fn grid_rectangle(&self) -> GridRectangle;

    // Provided methods
    fn lower_left_corner(&self) -> GridCoordinates { ... }
    fn lower_right_corner(&self) -> GridCoordinates { ... }
    fn upper_left_corner(&self) -> GridCoordinates { ... }
    fn upper_right_corner(&self) -> GridCoordinates { ... }
    fn size_x(&self) -> u16 { ... }
    fn size_y(&self) -> u16 { ... }
    fn x_range(&self) -> RangeInclusive<u16> { ... }
    fn y_range(&self) -> RangeInclusive<u16> { ... }
    fn contains(&self, grid_coordinates: &GridCoordinates) -> bool { ... }
    fn intersect<O>(&self, other: &O) -> Option<GridRectangle>
       where O: GridRectangleLike { ... }
    fn pps_hud_config(&self) -> String { ... }
}
Expand description

represents a grid rectangle like type (usually one that contains a grid rectangle or one that contains a corner and is of a known size

Required Methods§

Source

fn grid_rectangle(&self) -> GridRectangle

the GridRectangle represented by this map like image

Provided Methods§

Source

fn lower_left_corner(&self) -> GridCoordinates

returns the lower left corner of the rectangle

Source

fn lower_right_corner(&self) -> GridCoordinates

returns the lower right corner of the rectangle

Source

fn upper_left_corner(&self) -> GridCoordinates

returns the upper left corner of the rectangle

Source

fn upper_right_corner(&self) -> GridCoordinates

returns the upper right corner of the rectangle

Source

fn size_x(&self) -> u16

the size of the map like image in regions in the x direction (width)

Source

fn size_y(&self) -> u16

the size of the map like image in regions in the y direction (width)

Source

fn x_range(&self) -> RangeInclusive<u16>

returns a range for the region x coordinates of this rectangle

Source

fn y_range(&self) -> RangeInclusive<u16>

returns a range for the region y coordinates of this rectangle

Source

fn contains(&self, grid_coordinates: &GridCoordinates) -> bool

checks if a given set of GridCoordinates is within this GridRectangle

Source

fn intersect<O>(&self, other: &O) -> Option<GridRectangle>

returns a new GridRectangle which is the area where this GridRectangle and another intersect each other or None if there is no intersection

Source

fn pps_hud_config(&self) -> String

returns a PPS HUD description string for this GridRectangle

The PPS HUD is a map HUD commonly used in the SL sailing community and usually you need to configure it by clicking on the HUD while you are at the matching location in-world to calibrate the coordinates on the map texture.

This string needs to be put in the description of the PPS HUD dot prim with “Edit linked objects” to avoid the need for manual calibration.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§