#[repr(C)]pub struct Rect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}
Expand description
A pretty straightforward 2D rectangle, defined by the top left corner of the rectangle, and its width/height. https://stereokit.net/Pages/StereoKit/Rect.html
Fields§
§x: f32
The X axis position of the top left corner of the rectangle.
y: f32
The Y axis position of the top left corner of the rectangle.
width: f32
The width of the rectangle.
height: f32
The height of the rectangle.
Implementations§
Source§impl Rect
impl Rect
Sourcepub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
Create a 2D rectangle, defined by the top left corner of the rectangle, and its width/height. https://stereokit.net/Pages/StereoKit/Rect/Rect.html
§Examples
use stereokit_rust::maths::{Rect};
let rect = Rect::new(0.0, 0.0, 1920.0, 1080.0);
let rect_b = Rect {x:0.0, y:0.0, width:1920.0, height:1080.0};
assert_eq!(rect, rect_b);
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more