Struct mgf::Rectangle
[−]
[src]
pub struct Rectangle {
pub c: Point3<f32>,
pub u: [Vector3<f32>; 2],
pub e: [f32; 2],
}Rectangles are a center point, two directions and two half widths.
Fields
c: Point3<f32>
u: [Vector3<f32>; 2]
e: [f32; 2]
Trait Implementations
impl Collider<Contact, Moving<Component>> for Rectangle[src]
fn collide<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool[src]
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Copy for Rectangle[src]
impl Clone for Rectangle[src]
fn clone(&self) -> Rectangle[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Into<Plane> for Rectangle[src]
impl MinDistance<Point3<f32>> for Rectangle[src]
impl Add<Vector3<f32>> for Rectangle[src]
type Output = Self
The resulting type after applying the + operator.
fn add(self, v: Vector3<f32>) -> Self[src]
Performs the + operation.
impl Sub<Vector3<f32>> for Rectangle[src]
type Output = Self
The resulting type after applying the - operator.
fn sub(self, v: Vector3<f32>) -> Self[src]
Performs the - operation.
impl AddAssign<Vector3<f32>> for Rectangle[src]
fn add_assign(&mut self, v: Vector3<f32>)[src]
Performs the += operation.
impl SubAssign<Vector3<f32>> for Rectangle[src]
fn sub_assign(&mut self, v: Vector3<f32>)[src]
Performs the -= operation.
impl Shape for Rectangle[src]
fn center(&self) -> Point3<f32>[src]
Returns the center of mass of the geometry, assuming a regular density.
fn set_pos(&mut self, p: Point3<f32>)[src]
Sets the center of the shape to p.
impl Polygon for Rectangle[src]
type FaceType = Self
Type of the face object the polygon returns.
fn num_vertices(&self) -> usize[src]
The number of edges available to query.
fn vertex(&self, i: usize) -> Point3<f32>[src]
Returns the ith vertex as a Point.
fn num_edges(&self) -> usize[src]
The number of edges available to query.
fn edge(&self, i: usize) -> (usize, usize)[src]
Returns the ith edge of the polygon as a pair of indices.
fn face(&self) -> &Rectangle[src]
impl Collider<Contains, Point3<f32>> for Rectangle[src]
fn check_collision(&self, p: &Point3<f32>) -> Option<Contains>[src]
Returns the first collision found if any exists.
fn collide<F: FnMut(CollisionType)>(&self, other: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
impl Collider<Intersection, Ray> for Rectangle[src]
fn collide<F: FnMut(Intersection)>(&self, r: &Ray, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.