Struct quicksilver::geom::Rectangle[][src]

pub struct Rectangle {
    pub x: f32,
    pub y: f32,
    pub width: f32,
    pub height: f32,
}

A rectangle with a top-left position and a size

Fields

The top-left x coordinate of the rectangle

The top-left y coordinate of the rectangle

The width of the rectangle

The height of the rectangle

Methods

impl Rectangle
[src]

Create a positioned rectangle with dimensions

Create a rectangle from a top-left vector and a size vector

Create a rectangle at the origin with the given size

Create a rectangle at the origin with a size given by a Vector

Create a rectangle with a given center and Cuboid from ncollide

Convert this rect into an ncollide Cuboid2

Convert this rect into an ncollide AABB2

Get the top left coordinate of the Rectangle

Get the size of the Rectangle

Checks if a point falls within the rectangle

Check if any of the area bounded by this rectangle is bounded by another

Check if any of the area bounded by this rectangle is bounded by a circle

Move the rectangle so it is entirely contained with another

Translate the rectangle by a given vector

Create a rectangle with the same size at a given center

Trait Implementations

impl Clone for Rectangle
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Rectangle
[src]

impl Default for Rectangle
[src]

Returns the "default value" for a type. Read more

impl Debug for Rectangle
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Rectangle
[src]

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

This method tests for !=.

impl Eq for Rectangle
[src]

impl Positioned for Rectangle
[src]

Its center as a vector

The smallest possible rectangle that fully contains the shape

impl From<AABB<f32>> for Rectangle
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Rectangle

impl Sync for Rectangle