pub type OrientedRectangle2 = Rectangle2;Expand description
The oriented rectangle this module used to define itself.
Kept as an alias rather than a distinct type: it stored four corners plus a
cached area and side pair, which is the same rectangle Rectangle2 models
as an origin and two edge vectors, and having two spellings of one concept
forced every caller to convert. The edge-vector form is also the one that
cannot drift – four independently stored corners can be edited into a
non-parallelogram, and the cached area can disagree with them.
Aliased Type§
struct OrientedRectangle2 {
pub origin: DVec2,
pub x: DVec2,
pub y: DVec2,
}Fields§
§origin: DVec2Corner the edge vectors start from.
x: DVec2First edge vector, from origin.
y: DVec2Second edge vector, from origin.