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§
Sourcefn grid_rectangle(&self) -> GridRectangle
fn grid_rectangle(&self) -> GridRectangle
the GridRectangle represented by this map like image
Provided Methods§
Sourcefn lower_left_corner(&self) -> GridCoordinates
fn lower_left_corner(&self) -> GridCoordinates
returns the lower left corner of the rectangle
Sourcefn lower_right_corner(&self) -> GridCoordinates
fn lower_right_corner(&self) -> GridCoordinates
returns the lower right corner of the rectangle
Sourcefn upper_left_corner(&self) -> GridCoordinates
fn upper_left_corner(&self) -> GridCoordinates
returns the upper left corner of the rectangle
Sourcefn upper_right_corner(&self) -> GridCoordinates
fn upper_right_corner(&self) -> GridCoordinates
returns the upper right corner of the rectangle
Sourcefn x_range(&self) -> RangeInclusive<u16>
fn x_range(&self) -> RangeInclusive<u16>
returns a range for the region x coordinates of this rectangle
Sourcefn y_range(&self) -> RangeInclusive<u16>
fn y_range(&self) -> RangeInclusive<u16>
returns a range for the region y coordinates of this rectangle
Sourcefn contains(&self, grid_coordinates: &GridCoordinates) -> bool
fn contains(&self, grid_coordinates: &GridCoordinates) -> bool
checks if a given set of GridCoordinates is within this GridRectangle
Sourcefn intersect<O>(&self, other: &O) -> Option<GridRectangle>where
O: GridRectangleLike,
fn intersect<O>(&self, other: &O) -> Option<GridRectangle>where
O: GridRectangleLike,
returns a new GridRectangle which is the area where this GridRectangle
and another intersect each other or None if there is no intersection
Sourcefn pps_hud_config(&self) -> String
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.